mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
Compare commits
646 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
b33c777493 | ||
![]() |
392964617a | ||
![]() |
f8f92a2360 | ||
![]() |
827e267800 | ||
![]() |
cc52060245 | ||
![]() |
bd3ea7227e | ||
![]() |
0ef0c17837 | ||
![]() |
5e876388e5 | ||
![]() |
1ecbfd19db | ||
![]() |
b12e5fa8bd | ||
![]() |
9b19335c6e | ||
![]() |
1ce80d8676 | ||
![]() |
1d1574e0ac | ||
![]() |
79e7c03f91 | ||
![]() |
2be51f5e85 | ||
![]() |
d9cada146f | ||
![]() |
7b955802b3 | ||
![]() |
46bd3c0f77 | ||
![]() |
3cf8ad6f48 | ||
![]() |
86c5696c27 | ||
![]() |
69e448d1d8 | ||
![]() |
add02b675d | ||
![]() |
863e1c91a6 | ||
![]() |
f5c112c949 | ||
![]() |
4cbe52b3a3 | ||
![]() |
7aaffb7001 | ||
![]() |
924cacd2fc | ||
![]() |
4f4b8ea448 | ||
![]() |
79a6983c0c | ||
![]() |
8e92b7f9fc | ||
![]() |
a4ea4dac45 | ||
![]() |
ac88c35d32 | ||
![]() |
f104ce2d15 | ||
![]() |
3d15cab29d | ||
![]() |
5308585adf | ||
![]() |
ad5cb87d7a | ||
![]() |
1a356e6439 | ||
![]() |
3f314d40be | ||
![]() |
64038bf4e2 | ||
![]() |
ef662498b1 | ||
![]() |
3e3d2d783c | ||
![]() |
830678d5f9 | ||
![]() |
208f9dd09d | ||
![]() |
76086b36b7 | ||
![]() |
be1d5a61be | ||
![]() |
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 | ||
![]() |
da4bf813da | ||
![]() |
515b7e3eff | ||
![]() |
a984203bd6 | ||
![]() |
7179f43666 | ||
![]() |
73234bfec6 | ||
![]() |
f8ad215d25 | ||
![]() |
8f22031708 | ||
![]() |
5ffe1425c9 | ||
![]() |
0e546d8b38 | ||
![]() |
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 | ||
![]() |
291495a7b0 | ||
![]() |
e1d81178cc | ||
![]() |
31047607f8 | ||
![]() |
a15cfb4d52 | ||
![]() |
c5f37c0fc0 | ||
![]() |
7c94b2c343 | ||
![]() |
3915ac2409 | ||
![]() |
4d0c511354 | ||
![]() |
d22a821ce3 | ||
![]() |
ee56470157 | ||
![]() |
4172ce4eb0 | ||
![]() |
d4430dc3eb | ||
![]() |
c8b487ae40 | ||
![]() |
50c4c56967 | ||
![]() |
f583e51209 | ||
![]() |
0ccd1ef725 | ||
![]() |
feb70192a8 | ||
![]() |
ce17037e3e | ||
![]() |
8048699f7d | ||
![]() |
34904efd9d | ||
![]() |
b8ed507e3b | ||
![]() |
8b86f1103a | ||
![]() |
22230196cb | ||
![]() |
f1aec23c09 | ||
![]() |
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
|
# libuv queue.h pointer arithmetic is not accepted by asan
|
||||||
fun:queue_node_data
|
fun:queue_node_data
|
||||||
|
fun:dictwatcher_node_data
|
||||||
|
@@ -7,4 +7,4 @@ if [[ -n "${CI_TARGET}" ]]; then
|
|||||||
exit
|
exit
|
||||||
fi
|
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."
|
echo "\$LLVM_SYMBOLIZER: '${LLVM_SYMBOLIZER}' is not executable."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
if [[ "${TRAVIS_OS_NAME}" == osx ]]; then
|
||||||
# Adds user to a dummy group.
|
# Adds user to a dummy group.
|
||||||
|
@@ -1,10 +1,5 @@
|
|||||||
build_deps() {
|
build_deps() {
|
||||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
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}"
|
DEPS_CMAKE_FLAGS="${DEPS_CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
fi
|
fi
|
||||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||||
@@ -42,11 +37,6 @@ build_nvim() {
|
|||||||
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
CMAKE_FLAGS="${CMAKE_FLAGS} -DCLANG_${CLANG_SANITIZER}=ON"
|
||||||
fi
|
fi
|
||||||
if [[ "${BUILD_32BIT}" == ON ]]; then
|
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}"
|
CMAKE_FLAGS="${CMAKE_FLAGS} ${CMAKE_FLAGS_32BIT}"
|
||||||
fi
|
fi
|
||||||
if [[ "${BUILD_MINGW}" == ON ]]; then
|
if [[ "${BUILD_MINGW}" == ON ]]; then
|
||||||
|
@@ -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
|
# binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 mingw-w64-dev mingw-w64-tools
|
||||||
|
|
||||||
echo "Downloading MinGW..."
|
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
|
fi
|
||||||
|
|
||||||
# Set CC to default to avoid compilation problems
|
# Set CC to default to avoid compilation problems
|
||||||
|
@@ -4,7 +4,7 @@ set -e
|
|||||||
set -o pipefail
|
set -o pipefail
|
||||||
|
|
||||||
if [[ -n "${CI_TARGET}" ]]; then
|
if [[ -n "${CI_TARGET}" ]]; then
|
||||||
make lint
|
make "${CI_TARGET}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
5
.gitignore
vendored
5
.gitignore
vendored
@@ -38,6 +38,9 @@ tags
|
|||||||
# Folder generated by the unit tests
|
# Folder generated by the unit tests
|
||||||
/test/includes/post/
|
/test/includes/post/
|
||||||
|
|
||||||
|
# generated by luacheck during `make testlint'
|
||||||
|
/test/.luacheckcache
|
||||||
|
|
||||||
# luarocks, not added as a subtree because of the large number of blobs
|
# luarocks, not added as a subtree because of the large number of blobs
|
||||||
/third-party/luarocks
|
/third-party/luarocks
|
||||||
|
|
||||||
@@ -64,3 +67,5 @@ local.mk
|
|||||||
/runtime/doc/doctags
|
/runtime/doc/doctags
|
||||||
/runtime/doc/errors.log
|
/runtime/doc/errors.log
|
||||||
|
|
||||||
|
# clint errors, generated by `make lint`
|
||||||
|
/errors.json
|
||||||
|
19
.travis.yml
19
.travis.yml
@@ -12,8 +12,6 @@ env:
|
|||||||
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH"
|
- PATH="$(python2.7 -c 'import site; print(site.getuserbase())')/bin:$HOME/.local/mingw32/bin:$PATH"
|
||||||
# LLVM symbolizer path.
|
# LLVM symbolizer path.
|
||||||
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
|
- LLVM_SYMBOLIZER="$(which llvm-symbolizer-3.6)"
|
||||||
# Force verification of DLOG macros.
|
|
||||||
- CFLAGS="-DMIN_LOG_LEVEL=0"
|
|
||||||
# Build directory for Neovim.
|
# Build directory for Neovim.
|
||||||
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
- BUILD_DIR="$TRAVIS_BUILD_DIR/build"
|
||||||
# Build directory for third-party dependencies.
|
# Build directory for third-party dependencies.
|
||||||
@@ -28,9 +26,9 @@ env:
|
|||||||
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
- CMAKE_FLAGS="-DTRAVIS_CI_BUILD=ON
|
||||||
-DCMAKE_BUILD_TYPE=Debug
|
-DCMAKE_BUILD_TYPE=Debug
|
||||||
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
-DCMAKE_INSTALL_PREFIX:PATH=$INSTALL_PREFIX
|
||||||
-DUSE_GCOV=ON
|
|
||||||
-DBUSTED_OUTPUT_TYPE=gtest
|
-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"
|
- DEPS_CMAKE_FLAGS="-DDEPS_DOWNLOAD_DIR:PATH=$DEPS_DOWNLOAD_DIR"
|
||||||
# Additional CMake flags for 32-bit builds.
|
# Additional CMake flags for 32-bit builds.
|
||||||
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
- CMAKE_FLAGS_32BIT="-DCMAKE_SYSTEM_LIBRARY_PATH=/lib32:/usr/lib32:/usr/local/lib32
|
||||||
@@ -59,37 +57,34 @@ env:
|
|||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: linux
|
- os: linux
|
||||||
env: CI_TARGET=clint
|
env: CI_TARGET=lint
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: gcc-5
|
compiler: gcc-5
|
||||||
env: GCOV=gcov-5
|
|
||||||
- os: linux
|
- os: linux
|
||||||
# Travis creates a cache per compiler.
|
# Travis creates a cache per compiler.
|
||||||
# Set a different value here to store 32-bit
|
# Set a different value here to store 32-bit
|
||||||
# dependencies in a separate cache.
|
# dependencies in a separate cache.
|
||||||
compiler: gcc-5 -m32
|
compiler: gcc-5 -m32
|
||||||
env: GCOV=gcov-5 BUILD_32BIT=ON
|
env: BUILD_32BIT=ON
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang-3.6
|
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
|
- os: linux
|
||||||
compiler: clang-3.6
|
compiler: clang-3.6
|
||||||
env: GCOV=llvm-cov-3.6 CLANG_SANITIZER=MSAN
|
env: CLANG_SANITIZER=MSAN
|
||||||
- os: linux
|
- os: linux
|
||||||
compiler: clang-3.6
|
compiler: clang-3.6
|
||||||
env: CLANG_SANITIZER=TSAN
|
env: CLANG_SANITIZER=TSAN
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: clang
|
compiler: clang
|
||||||
env: GCOV=gcov
|
|
||||||
- os: osx
|
- os: osx
|
||||||
compiler: gcc-4.9
|
compiler: gcc-4.9
|
||||||
env: GCOV=gcov-4.9
|
|
||||||
- os: linux
|
- os: linux
|
||||||
env: BUILD_MINGW=ON
|
env: BUILD_MINGW=ON
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
allow_failures:
|
allow_failures:
|
||||||
# TODO: Remove when all MSan errors have been fixed.
|
# 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
|
before_install: .ci/before_install.sh
|
||||||
install: .ci/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
|
- Michael Ulm www.mulm.at
|
||||||
- Mikael Jansson http://mikaelj.se
|
- Mikael Jansson http://mikaelj.se
|
||||||
- Mikkel Høgh http://mikkel.hoegh.org/
|
- 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
|
- Holger Peters http://www.holger-peters.de
|
||||||
- Alexander Myshov http://myshov.com/
|
- Alexander Myshov http://myshov.com/
|
||||||
- Darren Cheng http://sanguinerane.com/
|
- Darren Cheng http://sanguinerane.com/
|
||||||
|
110
CMakeLists.txt
110
CMakeLists.txt
@@ -6,8 +6,13 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
|
|||||||
|
|
||||||
# Prefer our bundled versions of dependencies.
|
# Prefer our bundled versions of dependencies.
|
||||||
set(DEPS_PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/.deps/usr" CACHE PATH "Path prefix for finding 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})
|
if(CMAKE_CROSSCOMPILING AND NOT UNIX)
|
||||||
set(ENV{PKG_CONFIG_PATH} "$ENV{PKG_CONFIG_PATH}:${DEPS_PREFIX}/lib/pkgconfig")
|
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
|
# used for check_c_compiler_flag
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
@@ -35,36 +40,35 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|||||||
set(USE_FNAME_CASE TRUE)
|
set(USE_FNAME_CASE TRUE)
|
||||||
endif()
|
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.
|
# Set default build type.
|
||||||
if(NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
|
message(STATUS "CMAKE_BUILD_TYPE not given, defaulting to 'Dev'.")
|
||||||
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
set(CMAKE_BUILD_TYPE "Dev" CACHE STRING "Choose the type of build." FORCE)
|
||||||
endif()
|
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_MAJOR 0)
|
||||||
set(NVIM_VERSION_MINOR 1)
|
set(NVIM_VERSION_MINOR 1)
|
||||||
set(NVIM_VERSION_PATCH 0)
|
set(NVIM_VERSION_PATCH 2)
|
||||||
|
set(NVIM_VERSION_PRERELEASE "") # for package maintainers
|
||||||
|
|
||||||
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
file(TO_CMAKE_PATH ${CMAKE_CURRENT_LIST_DIR}/.git FORCED_GIT_DIR)
|
||||||
include(GetGitRevisionDescription)
|
include(GetGitRevisionDescription)
|
||||||
if(NVIM_VERSION_PRERELEASE)
|
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
||||||
get_git_head_revision(GIT_REFSPEC NVIM_VERSION_COMMIT)
|
if(NVIM_VERSION_COMMIT) # is a git repo
|
||||||
|
git_describe(NVIM_VERSION_MEDIUM)
|
||||||
# TODO(justinmk): UTC time would be nice here #1071
|
# `git describe` annotates the most recent tagged release; for pre-release
|
||||||
git_timestamp(GIT_TIMESTAMP)
|
# builds we must replace that with the unreleased version.
|
||||||
if(GIT_TIMESTAMP)
|
string(REGEX REPLACE "^v[0-9]+\\.[0-9]+\\.[0-9]+"
|
||||||
set(NVIM_VERSION_BUILD "+${GIT_TIMESTAMP}")
|
"v${NVIM_VERSION_MAJOR}.${NVIM_VERSION_MINOR}.${NVIM_VERSION_PATCH}"
|
||||||
endif()
|
NVIM_VERSION_MEDIUM
|
||||||
else()
|
${NVIM_VERSION_MEDIUM})
|
||||||
# If possible, get the Git tag for the current revision.
|
|
||||||
git_get_exact_tag(NVIM_VERSION_COMMIT)
|
|
||||||
set(NVIM_VERSION_BUILD "")
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
set(NVIM_VERSION_BUILD_TYPE "${CMAKE_BUILD_TYPE}")
|
||||||
@@ -203,6 +207,7 @@ endif()
|
|||||||
if(MINGW)
|
if(MINGW)
|
||||||
# Use POSIX compatible stdio in Mingw
|
# Use POSIX compatible stdio in Mingw
|
||||||
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
add_definitions(-D__USE_MINGW_ANSI_STDIO)
|
||||||
|
add_definitions(-D_WIN32_WINNT=0x0600)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
# OpenBSD's GCC (4.2.1) doesn't have -Wvla
|
||||||
@@ -211,12 +216,16 @@ if(HAS_WVLA_FLAG)
|
|||||||
add_definitions(-Wvla)
|
add_definitions(-Wvla)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
if(UNIX)
|
||||||
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
# -fstack-protector breaks non Unix builds even in Mingw-w64
|
||||||
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
check_c_compiler_flag(-fstack-protector-strong HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
add_definitions(-fstack-protector-strong)
|
check_c_compiler_flag(-fstack-protector HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
|
||||||
add_definitions(-fstack-protector --param ssp-buffer-size=4)
|
if(HAS_FSTACK_PROTECTOR_STRONG_FLAG)
|
||||||
|
add_definitions(-fstack-protector-strong)
|
||||||
|
elseif(HAS_FSTACK_PROTECTOR_FLAG)
|
||||||
|
add_definitions(-fstack-protector --param ssp-buffer-size=4)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
check_c_compiler_flag(-fdiagnostics-color=auto HAS_DIAG_COLOR_FLAG)
|
||||||
@@ -270,7 +279,7 @@ include(CheckLibraryExists)
|
|||||||
find_package(LibUV REQUIRED)
|
find_package(LibUV REQUIRED)
|
||||||
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
include_directories(SYSTEM ${LIBUV_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(Msgpack REQUIRED)
|
find_package(Msgpack 1.0.0 REQUIRED)
|
||||||
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
include_directories(SYSTEM ${MSGPACK_INCLUDE_DIRS})
|
||||||
|
|
||||||
find_package(LuaJit REQUIRED)
|
find_package(LuaJit REQUIRED)
|
||||||
@@ -327,9 +336,16 @@ endif()
|
|||||||
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
set(CMAKE_THREAD_PREFER_PTHREAD ON)
|
||||||
find_package(Threads REQUIRED)
|
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_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
|
||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_ARCHIVE_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
|
# Find Lua interpreter
|
||||||
include(LuaHelpers)
|
include(LuaHelpers)
|
||||||
@@ -364,6 +380,8 @@ if(NOT BUSTED_OUTPUT_TYPE)
|
|||||||
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
set(BUSTED_OUTPUT_TYPE "utfTerminal")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_program(LUACHECK_PRG luacheck)
|
||||||
|
|
||||||
include(InstallHelpers)
|
include(InstallHelpers)
|
||||||
|
|
||||||
file(GLOB MANPAGES
|
file(GLOB MANPAGES
|
||||||
@@ -374,6 +392,16 @@ install_helper(
|
|||||||
FILES ${MANPAGES}
|
FILES ${MANPAGES}
|
||||||
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
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.
|
# Go down the tree.
|
||||||
|
|
||||||
add_subdirectory(src/nvim)
|
add_subdirectory(src/nvim)
|
||||||
@@ -398,7 +426,11 @@ if(BUSTED_PRG)
|
|||||||
if(POLICY CMP0026)
|
if(POLICY CMP0026)
|
||||||
cmake_policy(SET CMP0026 OLD)
|
cmake_policy(SET CMP0026 OLD)
|
||||||
endif()
|
endif()
|
||||||
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
|
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||||
|
set(TEST_LIBNVIM_PATH ${CMAKE_BINARY_DIR}/lib/nvim-test.dll)
|
||||||
|
else()
|
||||||
|
get_target_property(TEST_LIBNVIM_PATH nvim-test LOCATION)
|
||||||
|
endif()
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
test/config/paths.lua.in
|
test/config/paths.lua.in
|
||||||
@@ -454,3 +486,23 @@ if(BUSTED_PRG)
|
|||||||
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
-P ${PROJECT_SOURCE_DIR}/cmake/RunTests.cmake
|
||||||
DEPENDS ${BENCHMARK_PREREQS})
|
DEPENDS ${BENCHMARK_PREREQS})
|
||||||
endif()
|
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.
|
your problem persists.
|
||||||
- If you're experiencing compile or runtime warnings/failures, try searching for
|
- 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].
|
the error message(s) you received (if any) on [Neovim's issue tracker][github-issues].
|
||||||
- For build issues, see
|
- For runtime issues, try reproducing it using `nvim` with the smallest
|
||||||
[Troubleshooting#build-issues][wiki-troubleshooting-build-issues].
|
possible `vimrc` (or none at all via `nvim -u NONE`), to rule out bugs in
|
||||||
- For runtime issues, see
|
plugins you're using. If you're using a plugin manager, comment out your
|
||||||
[Troubleshooting#runtime-issues][wiki-troubleshooting-runtime-issues].
|
plugins, then add them back in one by one.
|
||||||
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.
|
|
||||||
|
|
||||||
Include as much detail as possible; we generally need to know:
|
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.
|
otherwise prefer to leave things as they are.
|
||||||
|
|
||||||
For new code, run `make lint` (which runs [clint.py][clint]) to detect style
|
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
|
errors. It's not perfect, so some warnings may be false positives/negatives.
|
||||||
`clint-ignored-files.txt`. It's not perfect, so some warnings may be false
|
To have `clint.py` ignore certain cases, put `// NOLINT` at the end of the
|
||||||
positives/negatives. To have `clint.py` ignore certain cases, put `// NOLINT`
|
line.
|
||||||
at the end of the line.
|
|
||||||
|
|
||||||
We also provide a configuration file for [`clang-format`][clang-format], which
|
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
|
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-contributing]: https://github.com/neovim/neovim/wiki/Contributing
|
||||||
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
[wiki-faq]: https://github.com/neovim/neovim/wiki/FAQ
|
||||||
[wiki-review-checklist]: https://github.com/neovim/neovim/wiki/Code-review-checklist
|
[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
|
[wiki-troubleshooting]: https://github.com/neovim/neovim/wiki/Troubleshooting
|
||||||
|
7
Makefile
7
Makefile
@@ -86,7 +86,8 @@ oldtest: | nvim
|
|||||||
functionaltest: | nvim
|
functionaltest: | nvim
|
||||||
+$(BUILD_CMD) -C build functionaltest
|
+$(BUILD_CMD) -C build functionaltest
|
||||||
|
|
||||||
test: functionaltest
|
testlint: | nvim
|
||||||
|
$(BUILD_CMD) -C build testlint
|
||||||
|
|
||||||
unittest: | nvim
|
unittest: | nvim
|
||||||
+$(BUILD_CMD) -C build unittest
|
+$(BUILD_CMD) -C build unittest
|
||||||
@@ -94,6 +95,8 @@ unittest: | nvim
|
|||||||
benchmark: | nvim
|
benchmark: | nvim
|
||||||
+$(BUILD_CMD) -C build benchmark
|
+$(BUILD_CMD) -C build benchmark
|
||||||
|
|
||||||
|
test: functionaltest unittest
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
+test -d build && $(BUILD_CMD) -C build clean || true
|
+test -d build && $(BUILD_CMD) -C build clean || true
|
||||||
$(MAKE) -C src/nvim/testdir clean
|
$(MAKE) -C src/nvim/testdir clean
|
||||||
@@ -110,4 +113,4 @@ lint:
|
|||||||
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
|
-DLINT_SUPPRESS_URL="$(DOC_DOWNLOAD_URL_BASE)$(CLINT_ERRORS_FILE_PATH)" \
|
||||||
-P cmake/RunLint.cmake
|
-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',
|
||||||
'runtime/printf_format',
|
'runtime/printf_format',
|
||||||
'runtime/threadsafe_fn',
|
'runtime/threadsafe_fn',
|
||||||
|
'syntax/parenthesis',
|
||||||
|
'whitespace/alignment',
|
||||||
'whitespace/blank_line',
|
'whitespace/blank_line',
|
||||||
'whitespace/braces',
|
'whitespace/braces',
|
||||||
'whitespace/comma',
|
'whitespace/comma',
|
||||||
@@ -213,7 +215,7 @@ _ERROR_CATEGORIES = [
|
|||||||
'whitespace/parens',
|
'whitespace/parens',
|
||||||
'whitespace/semicolon',
|
'whitespace/semicolon',
|
||||||
'whitespace/tab',
|
'whitespace/tab',
|
||||||
'whitespace/todo'
|
'whitespace/todo',
|
||||||
]
|
]
|
||||||
|
|
||||||
# The default state of the category filter. This is overrided by the --filter=
|
# 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(
|
_RE_PATTERN_CLEANSE_LINE_ESCAPES = re.compile(
|
||||||
r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
|
r'\\([abfnrtv?"\\\']|\d+|x[0-9a-fA-F]+)')
|
||||||
# Matches strings. Escape codes should already be removed by ESCAPES.
|
# 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.
|
# 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.
|
# Matches multi-line C++ comments.
|
||||||
# This RE is a little bit more complicated than one might expect, because we
|
# 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
|
# have to take care of space removals tools so we can handle comments inside
|
||||||
@@ -923,39 +925,48 @@ def CleanseComments(line):
|
|||||||
|
|
||||||
class CleansedLines(object):
|
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,
|
1) elided member contains lines without strings and comments,
|
||||||
2) lines member contains lines without comments, and
|
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.
|
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.elided = []
|
||||||
self.lines = []
|
self.lines = []
|
||||||
self.raw_lines = lines
|
self.raw_lines = lines
|
||||||
self.num_lines = len(lines)
|
self.num_lines = len(lines)
|
||||||
|
self.init_lines = init_lines
|
||||||
self.lines_without_raw_strings = lines
|
self.lines_without_raw_strings = lines
|
||||||
|
self.elided_with_space_strings = []
|
||||||
for linenum in range(len(self.lines_without_raw_strings)):
|
for linenum in range(len(self.lines_without_raw_strings)):
|
||||||
self.lines.append(CleanseComments(
|
self.lines.append(CleanseComments(
|
||||||
self.lines_without_raw_strings[linenum]))
|
self.lines_without_raw_strings[linenum]))
|
||||||
elided = self._CollapseStrings(
|
elided = self._CollapseStrings(
|
||||||
self.lines_without_raw_strings[linenum])
|
self.lines_without_raw_strings[linenum])
|
||||||
self.elided.append(CleanseComments(elided))
|
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):
|
def NumLines(self):
|
||||||
"""Returns the number of lines represented."""
|
"""Returns the number of lines represented."""
|
||||||
return self.num_lines
|
return self.num_lines
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _CollapseStrings(elided):
|
def _CollapseStrings(elided, keep_spaces=False):
|
||||||
"""Collapses strings and chars on a line to simple "" or '' blocks.
|
"""Collapses strings and chars on a line to simple "" or '' blocks.
|
||||||
|
|
||||||
We nix strings first so we're not fooled by text like '"http://"'
|
We nix strings first so we're not fooled by text like '"http://"'
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
elided: The line being processed.
|
elided: The line being processed.
|
||||||
|
keep_spaces: If true, collapse to
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
The line with collapsed strings.
|
The line with collapsed strings.
|
||||||
@@ -964,12 +975,75 @@ class CleansedLines(object):
|
|||||||
# Remove escaped characters first to make quote/single quote
|
# Remove escaped characters first to make quote/single quote
|
||||||
# collapsing basic. Things that look like escaped characters
|
# collapsing basic. Things that look like escaped characters
|
||||||
# shouldn't occur outside of strings and chars.
|
# shouldn't occur outside of strings and chars.
|
||||||
elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub('', elided)
|
elided = _RE_PATTERN_CLEANSE_LINE_ESCAPES.sub(
|
||||||
elided = _RE_PATTERN_CLEANSE_LINE_SINGLE_QUOTES.sub("''", elided)
|
'' if not keep_spaces else lambda m: ' ' * len(m.group(0)),
|
||||||
elided = _RE_PATTERN_CLEANSE_LINE_DOUBLE_QUOTES.sub('""', elided)
|
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
|
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):
|
def FindEndOfExpressionInLine(line, startpos, depth, startchar, endchar):
|
||||||
"""Find the position just after the matching 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):
|
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.
|
linenum/pos that correspond to the closing of the expression.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@@ -1014,16 +1088,9 @@ def CloseExpression(clean_lines, linenum, pos):
|
|||||||
|
|
||||||
line = clean_lines.elided[linenum]
|
line = clean_lines.elided[linenum]
|
||||||
startchar = line[pos]
|
startchar = line[pos]
|
||||||
if startchar not in '({[<':
|
if startchar not in BRACES:
|
||||||
return (line, clean_lines.NumLines(), -1)
|
return (line, clean_lines.NumLines(), -1)
|
||||||
if startchar == '(':
|
endchar = BRACES[startchar]
|
||||||
endchar = ')'
|
|
||||||
if startchar == '[':
|
|
||||||
endchar = ']'
|
|
||||||
if startchar == '{':
|
|
||||||
endchar = '}'
|
|
||||||
if startchar == '<':
|
|
||||||
endchar = '>'
|
|
||||||
|
|
||||||
# Check first line
|
# Check first line
|
||||||
(end_pos, num_open) = FindEndOfExpressionInLine(
|
(end_pos, num_open) = FindEndOfExpressionInLine(
|
||||||
@@ -1300,6 +1367,23 @@ def CheckForMultilineCommentsAndStrings(filename, clean_lines, linenum, error):
|
|||||||
'Use C++11 raw strings or concatenation instead.')
|
'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 = (
|
threading_list = (
|
||||||
('asctime(', 'os_asctime_r('),
|
('asctime(', 'os_asctime_r('),
|
||||||
('ctime(', 'os_ctime_r('),
|
('ctime(', 'os_ctime_r('),
|
||||||
@@ -1968,6 +2052,92 @@ def FindPreviousMatchingAngleBracket(clean_lines, linenum, init_prefix):
|
|||||||
return False
|
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):
|
def CheckSpacing(filename, clean_lines, linenum, nesting_state, error):
|
||||||
"""Checks for the correctness of various spacing issues in the code.
|
"""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
|
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
|
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
|
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:
|
Args:
|
||||||
filename: The name of the current file.
|
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.
|
# Next we will look for issues with function calls.
|
||||||
CheckSpacingForFunctionCall(filename, line, linenum, error)
|
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
|
# Except after an opening paren, or after another opening brace (in case of
|
||||||
# an initializer list, for instance), you should have spaces before your
|
# 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,
|
# 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 [')
|
'Extra space before [')
|
||||||
|
|
||||||
# You shouldn't have a space before a semicolon at the end of the line.
|
# 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):
|
if Search(r':\s*;\s*$', line):
|
||||||
error(filename, linenum, 'whitespace/semicolon', 5,
|
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||||
'Semicolon defining empty statement. Use {} instead.')
|
'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,
|
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||||
'Line contains only semicolon. If this should be an empty'
|
'Line contains only semicolon. If this should be an empty'
|
||||||
' statement, use {} instead.')
|
' statement, use {} instead.')
|
||||||
elif (Search(r'\s+;\s*$', line) and
|
elif Search(r'\s+;\s*$', line):
|
||||||
not Search(r'\bfor\b', line)):
|
|
||||||
error(filename, linenum, 'whitespace/semicolon', 5,
|
error(filename, linenum, 'whitespace/semicolon', 5,
|
||||||
'Extra space before last semicolon. If this should be an empty '
|
'Extra space before last semicolon. If this should be an empty '
|
||||||
'statement, use {} instead.')
|
'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):
|
def GetPreviousNonBlankLine(clean_lines, linenum):
|
||||||
"""Return the most recent non-blank line and its line number.
|
"""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')
|
' of the previous line')
|
||||||
|
|
||||||
# An else clause should be on the same line as the preceding closing brace.
|
# 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):
|
if Match(r'\s*else\s*', line):
|
||||||
prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
|
prevline = GetPreviousNonBlankLine(clean_lines, linenum)[0]
|
||||||
if Match(r'\s*}\s*$', prevline):
|
if Match(r'\s*}\s*$', prevline):
|
||||||
error(filename, linenum, 'whitespace/newline', 4,
|
error(filename, linenum, 'whitespace/newline', 4,
|
||||||
'An else should appear on the same line as the preceding }')
|
'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}[^{{]*$'.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.
|
# 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!
|
# 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
|
arguments : filename, clean_lines, line, error
|
||||||
"""
|
"""
|
||||||
raw_lines = clean_lines.raw_lines
|
raw_lines = clean_lines.raw_lines
|
||||||
|
init_lines = clean_lines.init_lines
|
||||||
ParseNolintSuppressions(filename, raw_lines[line], line, error)
|
ParseNolintSuppressions(filename, raw_lines[line], line, error)
|
||||||
nesting_state.Update(filename, clean_lines, line, error)
|
nesting_state.Update(filename, clean_lines, line, error)
|
||||||
if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM:
|
if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM:
|
||||||
return
|
return
|
||||||
CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
|
CheckForFunctionLengths(filename, clean_lines, line, function_state, error)
|
||||||
CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
|
CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error)
|
||||||
|
CheckForOldStyleComments(filename, init_lines[line], line, error)
|
||||||
CheckStyle(
|
CheckStyle(
|
||||||
filename, clean_lines, line, file_extension, nesting_state, error)
|
filename, clean_lines, line, file_extension, nesting_state, error)
|
||||||
CheckLanguage(filename, clean_lines, line, file_extension, include_state,
|
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)):
|
for line in range(1, len(lines)):
|
||||||
ParseKnownErrorSuppressions(filename, lines, line)
|
ParseKnownErrorSuppressions(filename, lines, line)
|
||||||
|
|
||||||
if _cpplint_state.record_errors_file:
|
init_lines = lines[:]
|
||||||
raw_lines = lines[:]
|
|
||||||
|
|
||||||
|
if _cpplint_state.record_errors_file:
|
||||||
def RecordedError(filename, linenum, category, confidence, message):
|
def RecordedError(filename, linenum, category, confidence, message):
|
||||||
if not IsErrorSuppressedByNolint(category, linenum):
|
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]
|
err = [filename, key, category]
|
||||||
json.dump(err, _cpplint_state.record_errors_file)
|
json.dump(err, _cpplint_state.record_errors_file)
|
||||||
_cpplint_state.record_errors_file.write('\n')
|
_cpplint_state.record_errors_file.write('\n')
|
||||||
@@ -3089,7 +3286,7 @@ def ProcessFileData(filename, file_extension, lines, error,
|
|||||||
CheckForHeaderGuard(filename, lines, error)
|
CheckForHeaderGuard(filename, lines, error)
|
||||||
|
|
||||||
RemoveMultiLineComments(filename, lines, error)
|
RemoveMultiLineComments(filename, lines, error)
|
||||||
clean_lines = CleansedLines(lines)
|
clean_lines = CleansedLines(lines, init_lines)
|
||||||
for line in range(clean_lines.NumLines()):
|
for line in range(clean_lines.NumLines()):
|
||||||
ProcessLine(filename, file_extension, clean_lines, line,
|
ProcessLine(filename, file_extension, clean_lines, line,
|
||||||
include_state, function_state, nesting_state, error,
|
include_state, function_state, nesting_state, error,
|
||||||
@@ -3119,7 +3316,7 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]):
|
|||||||
_SetVerboseLevel(vlevel)
|
_SetVerboseLevel(vlevel)
|
||||||
|
|
||||||
try:
|
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
|
# we are not opening the file with universal newline support
|
||||||
# (which codecs doesn't support anyway), so the resulting lines do
|
# (which codecs doesn't support anyway), so the resulting lines do
|
||||||
# contain trailing '\r' characters if we are reading a file that
|
# contain trailing '\r' characters if we are reading a file that
|
||||||
|
@@ -59,11 +59,6 @@ if(HAVE_LIBDL)
|
|||||||
list(APPEND LIBUV_LIBRARIES dl)
|
list(APPEND LIBUV_LIBRARIES dl)
|
||||||
endif()
|
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)
|
check_library_exists(kstat kstat_lookup "kstat.h" HAVE_LIBKSTAT)
|
||||||
if(HAVE_LIBKSTAT)
|
if(HAVE_LIBKSTAT)
|
||||||
list(APPEND LIBUV_LIBRARIES kstat)
|
list(APPEND LIBUV_LIBRARIES kstat)
|
||||||
@@ -84,11 +79,6 @@ if(HAVE_LIBPERFSTAT)
|
|||||||
list(APPEND LIBUV_LIBRARIES perfstat)
|
list(APPEND LIBUV_LIBRARIES perfstat)
|
||||||
endif()
|
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)
|
check_library_exists(rt clock_gettime "time.h" HAVE_LIBRT)
|
||||||
if(HAVE_LIBRT)
|
if(HAVE_LIBRT)
|
||||||
list(APPEND LIBUV_LIBRARIES rt)
|
list(APPEND LIBUV_LIBRARIES rt)
|
||||||
@@ -99,13 +89,12 @@ if(HAVE_LIBSENDFILE)
|
|||||||
list(APPEND LIBUV_LIBRARIES sendfile)
|
list(APPEND LIBUV_LIBRARIES sendfile)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
check_library_exists(userenv GetUserProfileDirectoryW "userenv.h" HAVE_LIBUSERENV)
|
if(WIN32)
|
||||||
if(HAVE_LIBUSERENV)
|
# 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)
|
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)
|
list(APPEND LIBUV_LIBRARIES ws2_32)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
@@ -34,7 +34,7 @@ endif()
|
|||||||
if(MSVC)
|
if(MSVC)
|
||||||
list(APPEND LUAJIT_NAMES lua51)
|
list(APPEND LUAJIT_NAMES lua51)
|
||||||
elseif(MINGW)
|
elseif(MINGW)
|
||||||
list(APPEND LUAJIT_NAMES libluajit)
|
list(APPEND LUAJIT_NAMES libluajit libluajit-5.1)
|
||||||
else()
|
else()
|
||||||
list(APPEND LUAJIT_NAMES luajit-5.1)
|
list(APPEND LUAJIT_NAMES luajit-5.1)
|
||||||
endif()
|
endif()
|
||||||
|
@@ -7,7 +7,9 @@
|
|||||||
if(NOT MSGPACK_USE_BUNDLED)
|
if(NOT MSGPACK_USE_BUNDLED)
|
||||||
find_package(PkgConfig)
|
find_package(PkgConfig)
|
||||||
if (PKG_CONFIG_FOUND)
|
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()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(PC_MSGPACK_INCLUDEDIR)
|
set(PC_MSGPACK_INCLUDEDIR)
|
||||||
@@ -19,19 +21,33 @@ endif()
|
|||||||
|
|
||||||
set(MSGPACK_DEFINITIONS ${PC_MSGPACK_CFLAGS_OTHER})
|
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}
|
HINTS ${PC_MSGPACK_INCLUDEDIR} ${PC_MSGPACK_INCLUDE_DIRS}
|
||||||
${LIMIT_SEARCH})
|
${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)
|
if(MSGPACK_USE_STATIC)
|
||||||
list(APPEND MSGPACK_NAMES
|
list(APPEND MSGPACK_NAMES
|
||||||
|
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpackc${CMAKE_STATIC_LIBRARY_SUFFIX}"
|
||||||
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
"${CMAKE_STATIC_LIBRARY_PREFIX}msgpack${CMAKE_STATIC_LIBRARY_SUFFIX}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
list(APPEND MSGPACK_NAMES msgpack)
|
list(APPEND MSGPACK_NAMES msgpackc msgpack)
|
||||||
|
|
||||||
find_library(MSGPACK_LIBRARY NAMES ${MSGPACK_NAMES}
|
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}
|
HINTS ${PC_MSGPACK_LIBDIR} ${PC_MSGPACK_LIBRARY_DIRS}
|
||||||
${LIMIT_SEARCH})
|
${LIMIT_SEARCH})
|
||||||
|
|
||||||
@@ -43,6 +59,7 @@ set(MSGPACK_INCLUDE_DIRS ${MSGPACK_INCLUDE_DIR})
|
|||||||
include(FindPackageHandleStandardArgs)
|
include(FindPackageHandleStandardArgs)
|
||||||
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
|
# handle the QUIETLY and REQUIRED arguments and set MSGPACK_FOUND to TRUE
|
||||||
# if all listed variables are TRUE
|
# if all listed variables are TRUE
|
||||||
find_package_handle_standard_args(Msgpack DEFAULT_MSG
|
find_package_handle_standard_args(Msgpack
|
||||||
MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR)
|
REQUIRED_VARS MSGPACK_LIBRARY MSGPACK_INCLUDE_DIR
|
||||||
|
VERSION_VAR MSGPACK_VERSION_STRING)
|
||||||
|
|
||||||
|
@@ -25,7 +25,7 @@ file(WRITE ${EMPTY_FILE} "")
|
|||||||
execute_process(
|
execute_process(
|
||||||
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/nvim
|
COMMAND ${CMAKE_CURRENT_BINARY_DIR}/bin/nvim
|
||||||
-u NONE
|
-u NONE
|
||||||
-esX
|
-es
|
||||||
-c "helptags ++t ."
|
-c "helptags ++t ."
|
||||||
-c quit
|
-c quit
|
||||||
WORKING_DIRECTORY ${HELPTAGS_WORKING_DIRECTORY}
|
WORKING_DIRECTORY ${HELPTAGS_WORKING_DIRECTORY}
|
||||||
|
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("int" SIZEOF_INT)
|
||||||
check_type_size("long" SIZEOF_LONG)
|
check_type_size("long" SIZEOF_LONG)
|
||||||
check_type_size("intmax_t" SIZEOF_INTMAX_T)
|
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("size_t" SIZEOF_SIZE_T)
|
||||||
check_type_size("long long" SIZEOF_LONG_LONG)
|
check_type_size("long long" SIZEOF_LONG_LONG)
|
||||||
check_type_size("void *" SIZEOF_VOID_PTR)
|
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)
|
check_symbol_exists(_NSGetEnviron crt_externs.h HAVE__NSGETENVIRON)
|
||||||
|
|
||||||
# Headers
|
# 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(iconv.h HAVE_ICONV_H)
|
||||||
check_include_files(langinfo.h HAVE_LANGINFO_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(locale.h HAVE_LOCALE_H)
|
||||||
check_include_files(pwd.h HAVE_PWD_H)
|
check_include_files(pwd.h HAVE_PWD_H)
|
||||||
check_include_files(strings.h HAVE_STRINGS_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)
|
check_include_files(sys/wait.h HAVE_SYS_WAIT_H)
|
||||||
if(NOT HAVE_SYS_WAIT_H AND UNIX)
|
if(NOT HAVE_SYS_WAIT_H AND UNIX)
|
||||||
# See if_cscope.c
|
# 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()
|
endif()
|
||||||
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
check_include_files(sys/utsname.h HAVE_SYS_UTSNAME_H)
|
||||||
check_include_files(utime.h HAVE_UTIME_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
|
# Functions
|
||||||
check_function_exists(fseeko HAVE_FSEEKO)
|
check_function_exists(fseeko HAVE_FSEEKO)
|
||||||
check_function_exists(fsync HAVE_FSYNC)
|
|
||||||
check_function_exists(getpwent HAVE_GETPWENT)
|
check_function_exists(getpwent HAVE_GETPWENT)
|
||||||
check_function_exists(getpwnam HAVE_GETPWNAM)
|
check_function_exists(getpwnam HAVE_GETPWNAM)
|
||||||
check_function_exists(getpwuid HAVE_GETPWUID)
|
check_function_exists(getpwuid HAVE_GETPWUID)
|
||||||
@@ -51,7 +42,10 @@ if(JEMALLOC_FOUND)
|
|||||||
set(HAVE_JEMALLOC 1)
|
set(HAVE_JEMALLOC 1)
|
||||||
endif()
|
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(opendir HAVE_OPENDIR)
|
||||||
check_function_exists(readlink HAVE_READLINK)
|
check_function_exists(readlink HAVE_READLINK)
|
||||||
check_function_exists(setenv HAVE_SETENV)
|
check_function_exists(setenv HAVE_SETENV)
|
||||||
@@ -98,10 +92,10 @@ endif()
|
|||||||
if (NOT "${HAVE_BE64TOH}")
|
if (NOT "${HAVE_BE64TOH}")
|
||||||
if (NOT "${CMAKE_CROSSCOMPILING}")
|
if (NOT "${CMAKE_CROSSCOMPILING}")
|
||||||
# It is safe to make ORDER_BIG_ENDIAN not defined if
|
# It is safe to make ORDER_BIG_ENDIAN not defined if
|
||||||
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
|
# - HAVE_BE64TOH is true. In this case be64toh will be used unconditionally in
|
||||||
# any case and ORDER_BIG_ENDIAN will not be examined.
|
# any case and ORDER_BIG_ENDIAN will not be examined.
|
||||||
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
# - CMAKE_CROSSCOMPILING *and* HAVE_BE64TOH are both false. In this case
|
||||||
# be64toh function which uses cycle and arithmetic operations is used which
|
# be64toh function which uses cycle and arithmetic operations is used which
|
||||||
# will work regardless of endianess. Function is sub-optimal though.
|
# will work regardless of endianess. Function is sub-optimal though.
|
||||||
check_c_source_runs("
|
check_c_source_runs("
|
||||||
${SI}
|
${SI}
|
||||||
|
@@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#define SIZEOF_INT @SIZEOF_INT@
|
#define SIZEOF_INT @SIZEOF_INT@
|
||||||
#define SIZEOF_LONG @SIZEOF_LONG@
|
#define SIZEOF_LONG @SIZEOF_LONG@
|
||||||
#define SIZEOF_OFF_T @SIZEOF_OFF_T@
|
|
||||||
|
|
||||||
#if @SIZEOF_VOID_PTR@ == 8
|
#if @SIZEOF_VOID_PTR@ == 8
|
||||||
#define ARCH_64
|
#define ARCH_64
|
||||||
@@ -14,22 +13,18 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#cmakedefine HAVE__NSGETENVIRON
|
#cmakedefine HAVE__NSGETENVIRON
|
||||||
#cmakedefine HAVE_CRT_EXTERNS_H
|
|
||||||
#cmakedefine HAVE_FCNTL_H
|
|
||||||
#cmakedefine HAVE_FD_CLOEXEC
|
#cmakedefine HAVE_FD_CLOEXEC
|
||||||
#cmakedefine HAVE_FSEEKO
|
#cmakedefine HAVE_FSEEKO
|
||||||
#cmakedefine HAVE_FSYNC
|
|
||||||
#cmakedefine HAVE_GETPWENT
|
#cmakedefine HAVE_GETPWENT
|
||||||
#cmakedefine HAVE_GETPWNAM
|
#cmakedefine HAVE_GETPWNAM
|
||||||
#cmakedefine HAVE_GETPWUID
|
#cmakedefine HAVE_GETPWUID
|
||||||
#cmakedefine HAVE_ICONV
|
#cmakedefine HAVE_ICONV
|
||||||
#cmakedefine HAVE_ICONV_H
|
#cmakedefine HAVE_ICONV_H
|
||||||
#cmakedefine HAVE_LANGINFO_H
|
#cmakedefine HAVE_LANGINFO_H
|
||||||
#cmakedefine HAVE_LIBGEN_H
|
|
||||||
#cmakedefine HAVE_LOCALE_H
|
#cmakedefine HAVE_LOCALE_H
|
||||||
#cmakedefine HAVE_NL_LANGINFO_CODESET
|
#cmakedefine HAVE_NL_LANGINFO_CODESET
|
||||||
#cmakedefine HAVE_NL_MSG_CAT_CNTR
|
#cmakedefine HAVE_NL_MSG_CAT_CNTR
|
||||||
#cmakedefine HAVE_PUTENV
|
#cmakedefine HAVE_PUTENV_S
|
||||||
#cmakedefine HAVE_PWD_H
|
#cmakedefine HAVE_PWD_H
|
||||||
#cmakedefine HAVE_READLINK
|
#cmakedefine HAVE_READLINK
|
||||||
// TODO: add proper cmake check
|
// TODO: add proper cmake check
|
||||||
@@ -42,11 +37,8 @@
|
|||||||
#cmakedefine HAVE_STRCASECMP
|
#cmakedefine HAVE_STRCASECMP
|
||||||
#cmakedefine HAVE_STRINGS_H
|
#cmakedefine HAVE_STRINGS_H
|
||||||
#cmakedefine HAVE_STRNCASECMP
|
#cmakedefine HAVE_STRNCASECMP
|
||||||
#cmakedefine HAVE_STROPTS_H
|
|
||||||
#cmakedefine HAVE_SYS_PARAM_H
|
|
||||||
#cmakedefine HAVE_SYS_UTSNAME_H
|
#cmakedefine HAVE_SYS_UTSNAME_H
|
||||||
#cmakedefine HAVE_SYS_WAIT_H
|
#cmakedefine HAVE_SYS_WAIT_H
|
||||||
#cmakedefine HAVE_UNISTD_H
|
|
||||||
#cmakedefine HAVE_UTIME
|
#cmakedefine HAVE_UTIME
|
||||||
#cmakedefine HAVE_UTIME_H
|
#cmakedefine HAVE_UTIME_H
|
||||||
#cmakedefine HAVE_UTIMES
|
#cmakedefine HAVE_UTIMES
|
||||||
|
@@ -5,8 +5,8 @@
|
|||||||
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
#define NVIM_VERSION_MINOR @NVIM_VERSION_MINOR@
|
||||||
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
#define NVIM_VERSION_PATCH @NVIM_VERSION_PATCH@
|
||||||
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
#define NVIM_VERSION_PRERELEASE "@NVIM_VERSION_PRERELEASE@"
|
||||||
#define NVIM_VERSION_BUILD "@NVIM_VERSION_BUILD@"
|
#cmakedefine NVIM_VERSION_MEDIUM "@NVIM_VERSION_MEDIUM@"
|
||||||
#cmakedefine NVIM_VERSION_COMMIT "@NVIM_VERSION_COMMIT@"
|
|
||||||
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
#define NVIM_VERSION_CFLAGS "@NVIM_VERSION_CFLAGS@"
|
||||||
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
|
#define NVIM_VERSION_BUILD_TYPE "@NVIM_VERSION_BUILD_TYPE@"
|
||||||
|
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
## What is this?
|
## 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
|
## 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
|
echo .ycm_extra_conf.py >> .git/info/exclude
|
||||||
make
|
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>
|
autocmd FileType c nnoremap <buffer> <silent> <C-]> :YcmCompleter GoTo<cr>
|
||||||
```
|
```
|
||||||
|
@@ -9,7 +9,7 @@ def DirectoryOfThisScript():
|
|||||||
|
|
||||||
def GetDatabase():
|
def GetDatabase():
|
||||||
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
|
compilation_database_folder = os.path.join(DirectoryOfThisScript(),
|
||||||
'..', '..', 'build')
|
'..', 'build')
|
||||||
if os.path.exists(compilation_database_folder):
|
if os.path.exists(compilation_database_folder):
|
||||||
return ycm_core.CompilationDatabase(compilation_database_folder)
|
return ycm_core.CompilationDatabase(compilation_database_folder)
|
||||||
return None
|
return None
|
||||||
|
@@ -31,6 +31,11 @@
|
|||||||
#
|
#
|
||||||
# CMAKE_BUILD_TYPE := Debug
|
# 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
|
# By default, nvim uses bundled versions of its required third-party
|
||||||
# dependencies.
|
# dependencies.
|
||||||
# Uncomment these entries to instead use system-wide installations of
|
# 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
|
.Dt NVIM 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@@ -75,7 +75,7 @@ Can be used to edit files starting with a hyphen
|
|||||||
.Pq Sq - .
|
.Pq Sq - .
|
||||||
.It Fl -literal
|
.It Fl -literal
|
||||||
Interpret filenames literally, that is, do not expand wildcards.
|
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
|
.It Fl e
|
||||||
Ex mode.
|
Ex mode.
|
||||||
See
|
See
|
||||||
@@ -173,19 +173,19 @@ See
|
|||||||
.It Fl L Op Ar file
|
.It Fl L Op Ar file
|
||||||
Alias for
|
Alias for
|
||||||
.Fl r .
|
.Fl r .
|
||||||
.It Fl u Ar nvimrc
|
.It Fl u Ar vimrc
|
||||||
Use
|
Use
|
||||||
.Ar nvimrc
|
.Ar vimrc
|
||||||
instead of the default of
|
instead of the default of
|
||||||
.Pa ~/.config/nvim/init.vim .
|
.Pa ~/.config/nvim/init.vim .
|
||||||
If
|
If
|
||||||
.Ar nvimrc
|
.Ar vimrc
|
||||||
is
|
is
|
||||||
.Cm NORC ,
|
.Cm NORC ,
|
||||||
do not load any initialization files (excluding plugins),
|
do not load any initialization files (excluding plugins),
|
||||||
and do not attempt to parse environment variables.
|
and do not attempt to parse environment variables.
|
||||||
If
|
If
|
||||||
.Ar nvimrc
|
.Ar vimrc
|
||||||
is
|
is
|
||||||
.Cm NONE ,
|
.Cm NONE ,
|
||||||
loading plugins is also skipped.
|
loading plugins is also skipped.
|
||||||
@@ -278,7 +278,7 @@ Like
|
|||||||
.Fl c ,
|
.Fl c ,
|
||||||
but execute
|
but execute
|
||||||
.Ar command
|
.Ar command
|
||||||
before processing any nvimrc.
|
before processing any vimrc.
|
||||||
Up to 10 instances of these can be used independently from instances of
|
Up to 10 instances of these can be used independently from instances of
|
||||||
.Fl c .
|
.Fl c .
|
||||||
.It Fl S Op Ar session
|
.It Fl S Op Ar session
|
||||||
@@ -373,8 +373,24 @@ Used to set the 'shell' option, which determines the shell used by the
|
|||||||
command.
|
command.
|
||||||
.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE
|
.It Ev NVIM_TUI_ENABLE_CURSOR_SHAPE
|
||||||
If defined, change the cursor shape to a vertical bar while in insert mode.
|
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.
|
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
|
.It Ev NVIM_TUI_ENABLE_TRUE_COLOR
|
||||||
If defined, assume the host terminal supports 24 bit colors.
|
If defined, assume the host terminal supports 24 bit colors.
|
||||||
Has no effect in GUIs.
|
Has no effect in GUIs.
|
||||||
@@ -395,11 +411,11 @@ configuration directory.
|
|||||||
See
|
See
|
||||||
.Ev XDG_CONFIG_HOME
|
.Ev XDG_CONFIG_HOME
|
||||||
above.
|
above.
|
||||||
.It Pa /etc/nvim/nvimrc
|
.It Pa $VIM/sysinit.vim
|
||||||
The system-global
|
The system-global
|
||||||
.Nm
|
.Nm
|
||||||
configuration file.
|
configuration file.
|
||||||
.It Pa /usr/share/nvim
|
.It Pa /usr/local/share/nvim
|
||||||
The system-global
|
The system-global
|
||||||
.Nm
|
.Nm
|
||||||
runtime directory.
|
runtime directory.
|
||||||
|
@@ -26,24 +26,21 @@ foreach(DF ${DOCFILES})
|
|||||||
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
list(APPEND BUILDDOCFILES ${GENERATED_RUNTIME_DIR}/doc/${F})
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${BUILDDOCFILES}
|
add_custom_command(OUTPUT copy_docfiles
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||||
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
${PROJECT_SOURCE_DIR}/runtime/doc ${GENERATED_RUNTIME_DIR}/doc
|
||||||
DEPENDS
|
)
|
||||||
${DOCFILES})
|
|
||||||
|
|
||||||
add_custom_command(OUTPUT ${GENERATED_HELP_TAGS}
|
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"
|
COMMAND "${PROJECT_BINARY_DIR}/bin/nvim"
|
||||||
-u NONE
|
-u NONE
|
||||||
-i NONE
|
-i NONE
|
||||||
-esX
|
-es
|
||||||
--headless
|
--headless
|
||||||
-c "helptags ++t ."
|
-c "helptags ++t ."
|
||||||
-c quit
|
-c quit
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${BUILDDOCFILES}
|
copy_docfiles
|
||||||
nvim
|
nvim
|
||||||
WORKING_DIRECTORY "${GENERATED_RUNTIME_DIR}/doc"
|
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
|
|
@@ -75,7 +75,9 @@ function man#get_page(...) abort
|
|||||||
|
|
||||||
setlocal modifiable
|
setlocal modifiable
|
||||||
silent keepjumps norm! 1G"_dG
|
silent keepjumps norm! 1G"_dG
|
||||||
let $MANWIDTH = winwidth(0)
|
if empty($MANWIDTH)
|
||||||
|
let $MANWIDTH = winwidth(0)
|
||||||
|
endif
|
||||||
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
|
silent exec 'r!/usr/bin/man '.s:cmd(sect, page).' | col -b'
|
||||||
" Remove blank lines from top and bottom.
|
" Remove blank lines from top and bottom.
|
||||||
while getline(1) =~ '^\s*$'
|
while getline(1) =~ '^\s*$'
|
||||||
|
820
runtime/autoload/msgpack.vim
Normal file
820
runtime/autoload/msgpack.vim
Normal file
@@ -0,0 +1,820 @@
|
|||||||
|
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 string(type(a:v) == type({}) ? a:v._VAL : a:v)
|
||||||
|
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 )
|
" Maintainer: Dávid Szabó ( complex857 AT gmail DOT com )
|
||||||
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
" Previous Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||||
" URL: https://github.com/shawncplus/phpcomplete.vim
|
" URL: https://github.com/shawncplus/phpcomplete.vim
|
||||||
" Last Change: 2014 Dec 01
|
" Last Change: 2015 Apr 02
|
||||||
"
|
"
|
||||||
" OPTIONS:
|
" OPTIONS:
|
||||||
"
|
"
|
||||||
@@ -141,71 +141,80 @@ function! phpcomplete#CompletePHP(findstart, base) " {{{
|
|||||||
if a:base != ""
|
if a:base != ""
|
||||||
let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '')
|
let context = substitute(context, '\s*[$a-zA-Z_0-9\x7f-\xff]*$', '', '')
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
let context = ''
|
||||||
end
|
end
|
||||||
|
|
||||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
try
|
||||||
|
let winheight = winheight(0)
|
||||||
|
let winnr = winnr()
|
||||||
|
|
||||||
if context =~? '^use\s'
|
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(getline(0, line('.')))
|
||||||
return phpcomplete#CompleteUse(a:base)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if context =~ '\(->\|::\)$'
|
if context =~? '^use\s' || context ==? 'use'
|
||||||
" {{{
|
return phpcomplete#CompleteUse(a:base)
|
||||||
" Get name of the class
|
endif
|
||||||
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
|
|
||||||
|
|
||||||
" Get location of class definition, we have to iterate through all
|
if context =~ '\(->\|::\)$'
|
||||||
if classname != ''
|
" {{{
|
||||||
if classname =~ '\'
|
" Get name of the class
|
||||||
" split the last \ segment as a classname, everything else is the namespace
|
let classname = phpcomplete#GetClassName(line('.'), context, current_namespace, imports)
|
||||||
let classname_parts = split(classname, '\')
|
|
||||||
let namespace = join(classname_parts[0:-2], '\')
|
" Get location of class definition, we have to iterate through all
|
||||||
let classname = classname_parts[-1]
|
if classname != ''
|
||||||
|
if classname =~ '\'
|
||||||
|
" split the last \ segment as a classname, everything else is the namespace
|
||||||
|
let classname_parts = split(classname, '\')
|
||||||
|
let namespace = join(classname_parts[0:-2], '\')
|
||||||
|
let classname = classname_parts[-1]
|
||||||
|
else
|
||||||
|
let namespace = '\'
|
||||||
|
endif
|
||||||
|
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
|
||||||
else
|
else
|
||||||
let namespace = '\'
|
let classlocation = ''
|
||||||
endif
|
endif
|
||||||
let classlocation = phpcomplete#GetClassLocation(classname, namespace)
|
|
||||||
|
if classlocation != ''
|
||||||
|
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
|
||||||
|
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if filereadable(classlocation)
|
||||||
|
let classfile = readfile(classlocation)
|
||||||
|
let classcontent = ''
|
||||||
|
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
|
||||||
|
let sccontent = split(classcontent, "\n")
|
||||||
|
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
|
||||||
|
|
||||||
|
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
|
return phpcomplete#CompleteUnknownClass(a:base, context)
|
||||||
|
" }}}
|
||||||
|
elseif context =~? 'implements'
|
||||||
|
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
||||||
|
elseif context =~? 'extends\s\+.\+$' && a:base == ''
|
||||||
|
return ['implements']
|
||||||
|
elseif context =~? 'extends'
|
||||||
|
let kinds = context =~? 'class\s' ? ['c'] : ['i']
|
||||||
|
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
|
||||||
|
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
||||||
|
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
|
||||||
|
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
|
||||||
|
elseif context =~? 'new'
|
||||||
|
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
|
||||||
|
endif
|
||||||
|
|
||||||
|
if a:base =~ '^\$'
|
||||||
|
return phpcomplete#CompleteVariable(a:base)
|
||||||
else
|
else
|
||||||
let classlocation = ''
|
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
|
||||||
endif
|
endif
|
||||||
|
finally
|
||||||
if classlocation != ''
|
silent! exec winnr.'resize '.winheight
|
||||||
if classlocation == 'VIMPHP_BUILTINOBJECT' && has_key(g:php_builtin_classes, tolower(classname))
|
endtry
|
||||||
return phpcomplete#CompleteBuiltInClass(context, classname, a:base)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if filereadable(classlocation)
|
|
||||||
let classfile = readfile(classlocation)
|
|
||||||
let classcontent = ''
|
|
||||||
let classcontent .= "\n".phpcomplete#GetClassContents(classlocation, classname)
|
|
||||||
let sccontent = split(classcontent, "\n")
|
|
||||||
let visibility = expand('%:p') == fnamemodify(classlocation, ':p') ? 'private' : 'public'
|
|
||||||
|
|
||||||
return phpcomplete#CompleteUserClass(context, a:base, sccontent, visibility)
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return phpcomplete#CompleteUnknownClass(a:base, context)
|
|
||||||
" }}}
|
|
||||||
elseif context =~? 'implements'
|
|
||||||
return phpcomplete#CompleteClassName(a:base, ['i'], current_namespace, imports)
|
|
||||||
elseif context =~? 'extends\s\+.\+$'
|
|
||||||
return ['implements']
|
|
||||||
elseif context =~? 'extends'
|
|
||||||
let kinds = context =~? 'class\s' ? ['c'] : ['i']
|
|
||||||
return phpcomplete#CompleteClassName(a:base, kinds, current_namespace, imports)
|
|
||||||
elseif context =~? 'class [a-zA-Z_\x7f-\xff\\][a-zA-Z_0-9\x7f-\xff\\]*'
|
|
||||||
" special case when you've typed the class keyword and the name too, only extends and implements allowed there
|
|
||||||
return filter(['extends', 'implements'], 'stridx(v:val, a:base) == 0')
|
|
||||||
elseif context =~? 'new'
|
|
||||||
return phpcomplete#CompleteClassName(a:base, ['c'], current_namespace, imports)
|
|
||||||
endif
|
|
||||||
|
|
||||||
if a:base =~ '^\$'
|
|
||||||
return phpcomplete#CompleteVariable(a:base)
|
|
||||||
else
|
|
||||||
return phpcomplete#CompleteGeneral(a:base, current_namespace, imports)
|
|
||||||
endif
|
|
||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
@@ -244,12 +253,13 @@ function! phpcomplete#CompleteUse(base) " {{{
|
|||||||
if has_key(tag, 'namespace')
|
if has_key(tag, 'namespace')
|
||||||
let patched_ctags_detected = 1
|
let patched_ctags_detected = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
|
if tag.kind ==? 'n' && tag.name =~? '^'.namespace_match_pattern
|
||||||
let patched_ctags_detected = 1
|
let patched_ctags_detected = 1
|
||||||
call add(namespaced_matches, {'word': tag.name, 'kind': 'n', 'menu': tag.filename, 'info': tag.filename })
|
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 })
|
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 })
|
call add(no_namespace_matches, {'word': namespace_for_class.'\'.tag.name, 'kind': tag.kind, 'menu': tag.filename, 'info': tag.filename })
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
@@ -272,6 +282,10 @@ function! phpcomplete#CompleteUse(base) " {{{
|
|||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
for comp in res
|
||||||
|
let comp.word = substitute(comp.word, '^\\', '', '')
|
||||||
|
endfor
|
||||||
|
|
||||||
return res
|
return res
|
||||||
endfunction
|
endfunction
|
||||||
" }}}
|
" }}}
|
||||||
@@ -326,6 +340,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
let ext_functions = {}
|
let ext_functions = {}
|
||||||
let ext_constants = {}
|
let ext_constants = {}
|
||||||
let ext_classes = {}
|
let ext_classes = {}
|
||||||
|
let ext_traits = {}
|
||||||
let ext_interfaces = {}
|
let ext_interfaces = {}
|
||||||
let ext_namespaces = {}
|
let ext_namespaces = {}
|
||||||
|
|
||||||
@@ -420,7 +435,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
endif
|
endif
|
||||||
endif
|
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 info = ' - '.tag.filename
|
||||||
|
|
||||||
let key = ''
|
let key = ''
|
||||||
@@ -441,6 +456,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
let ext_classes[key] = info
|
let ext_classes[key] = info
|
||||||
elseif tag.kind ==? 'i'
|
elseif tag.kind ==? 'i'
|
||||||
let ext_interfaces[key] = info
|
let ext_interfaces[key] = info
|
||||||
|
elseif tag.kind ==? 't'
|
||||||
|
let ext_traits[key] = info
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -463,7 +480,7 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
endfor
|
endfor
|
||||||
for [interfacename, info] in items(g:php_builtin_interfacenames)
|
for [interfacename, info] in items(g:php_builtin_interfacenames)
|
||||||
if interfacename =~? '^'.base
|
if interfacename =~? '^'.base
|
||||||
let builtin_interfaces[leading_slash.interfacename] = info
|
let builtin_interfaces[leading_slash.g:php_builtin_interfaces[tolower(interfacename)].name] = info
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
endif
|
endif
|
||||||
@@ -511,6 +528,8 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
else
|
else
|
||||||
let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename
|
let ext_interfaces[imported_name] = ' '.import.name.' - '.import.filename
|
||||||
endif
|
endif
|
||||||
|
elseif import.kind ==? 't'
|
||||||
|
let ext_traits[imported_name] = ' '.import.name.' - '.import.filename
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" no builtin interfaces
|
" no builtin interfaces
|
||||||
@@ -540,6 +559,9 @@ function! phpcomplete#CompleteGeneral(base, current_namespace, imports) " {{{
|
|||||||
" Add external interfaces
|
" Add external interfaces
|
||||||
call extend(all_values, ext_interfaces)
|
call extend(all_values, ext_interfaces)
|
||||||
|
|
||||||
|
" Add external traits
|
||||||
|
call extend(all_values, ext_traits)
|
||||||
|
|
||||||
" Add built-in classes
|
" Add built-in classes
|
||||||
call extend(all_values, builtin_classnames)
|
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)
|
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 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}]
|
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)
|
elseif has_key(int_constants, i) || has_key(builtin_constants, i)
|
||||||
let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin'
|
let info = has_key(int_constants, i) ? int_constants[i] : ' - builtin'
|
||||||
let final_list += [{'word':i, 'kind': 'd', 'menu': info, 'info': i.info}]
|
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 = []
|
let tags = []
|
||||||
if len(tag_match_pattern) >= g:phpcomplete_min_num_of_chars_for_namespace_completion
|
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
|
endif
|
||||||
|
|
||||||
if len(tags)
|
if len(tags)
|
||||||
@@ -861,6 +885,39 @@ function! phpcomplete#CompareCompletionRow(i1, i2) " {{{
|
|||||||
endfunction
|
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) " {{{
|
function! phpcomplete#EvaluateModifiers(modifiers, required_modifiers, prohibited_modifiers) " {{{
|
||||||
" if theres no modifier, and no modifier is allowed and no modifier is required
|
" if theres no modifier, and no modifier is allowed and no modifier is required
|
||||||
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
|
if len(a:modifiers) == 0 && len(a:required_modifiers) == 0
|
||||||
@@ -1475,21 +1532,19 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
return ''
|
return ''
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class'
|
if line =~? '\v^\s*(abstract\s+|final\s+)*\s*class\s'
|
||||||
let class_name = matchstr(line, '\c\s*class\s*\zs'.class_name_pattern.'\ze')
|
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 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
|
let classname_candidate = a:context =~? 'parent::' ? extended_class : class_name
|
||||||
else
|
if classname_candidate != ''
|
||||||
let i += 1
|
let [classname_candidate, class_candidate_namespace] = phpcomplete#GetCallChainReturnType(classname_candidate, class_candidate_namespace, class_candidate_imports, methodstack)
|
||||||
continue
|
" return absolute classname, without leading \
|
||||||
|
return (class_candidate_namespace == '\' || class_candidate_namespace == '') ? classname_candidate : class_candidate_namespace.'\'.classname_candidate
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if classname_candidate != ''
|
let i += 1
|
||||||
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
|
|
||||||
endwhile
|
endwhile
|
||||||
elseif a:context =~? '(\s*new\s\+'.class_name_pattern.'\s*)->'
|
elseif a:context =~? '(\s*new\s\+'.class_name_pattern.'\s*)->'
|
||||||
let classname_candidate = matchstr(a:context, '\cnew\s\+\zs'.class_name_pattern.'\ze')
|
let classname_candidate = matchstr(a:context, '\cnew\s\+\zs'.class_name_pattern.'\ze')
|
||||||
@@ -1602,26 +1657,26 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
" in-file lookup for typehinted function arguments
|
" function declaration line
|
||||||
" - the function can have a name or be anonymous (e.g., function qux() { ... } vs. function () { ... })
|
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*('
|
||||||
" - the type-hinted argument can be anywhere in the arguments list.
|
let function_lines = join(reverse(lines), " ")
|
||||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
" search for type hinted arguments
|
||||||
let f_args = matchstr(line, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
if function_lines =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.class_name_pattern.'\s\+'.object && !object_is_array
|
||||||
let args = split(f_args, '\s*\zs,\ze\s*')
|
let f_args = matchstr(function_lines, '\cfunction\(\s\+'.function_name_pattern.'\)\?\s*(\zs.\{-}\ze)')
|
||||||
for arg in args
|
let args = split(f_args, '\s*\zs,\ze\s*')
|
||||||
if arg =~# object.'\(,\|$\)'
|
for arg in args
|
||||||
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
|
if arg =~# object.'\(,\|$\)'
|
||||||
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
|
let classname_candidate = matchstr(arg, '\s*\zs'.class_name_pattern.'\ze\s\+'.object)
|
||||||
|
let [classname_candidate, class_candidate_namespace] = phpcomplete#ExpandClassName(classname_candidate, a:current_namespace, a:imports)
|
||||||
|
break
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
if classname_candidate != ''
|
||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
endfor
|
|
||||||
if classname_candidate != ''
|
|
||||||
break
|
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
" if we see a function declaration, try loading the docblock for it and look for matching @params
|
" search for docblock for the function
|
||||||
if line =~? 'function\(\s\+'.function_name_pattern.'\)\?\s*(.\{-}'.object
|
|
||||||
let match_line = substitute(line, '\\', '\\\\', 'g')
|
let match_line = substitute(line, '\\', '\\\\', 'g')
|
||||||
let sccontent = getline(0, a:start_line - i)
|
let sccontent = getline(0, a:start_line - i)
|
||||||
let doc_str = phpcomplete#GetDocBlock(sccontent, match_line)
|
let doc_str = phpcomplete#GetDocBlock(sccontent, match_line)
|
||||||
@@ -1641,13 +1696,14 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
" assignment for the variable in question with a variable on the right hand side
|
" 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
|
" 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 filelines = reverse(lines)
|
||||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||||
let chars_read = 1
|
let chars_read = 1
|
||||||
|
let last_pos = pos
|
||||||
" read while end of the file
|
" read while end of the file
|
||||||
while char != 'EOF' && chars_read < 1000
|
while char != 'EOF' && chars_read < 1000
|
||||||
let last_pos = pos
|
let last_pos = pos
|
||||||
@@ -1689,6 +1745,7 @@ function! phpcomplete#GetClassName(start_line, context, current_namespace, impor
|
|||||||
let filelines = reverse(lines)
|
let filelines = reverse(lines)
|
||||||
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
let [pos, char] = s:getNextCharWithPos(filelines, [a:start_line - i - 1, start_col])
|
||||||
let chars_read = 1
|
let chars_read = 1
|
||||||
|
let last_pos = pos
|
||||||
" read while end of the file
|
" read while end of the file
|
||||||
while char != 'EOF' && chars_read < 1000
|
while char != 'EOF' && chars_read < 1000
|
||||||
let last_pos = pos
|
let last_pos = pos
|
||||||
@@ -1819,7 +1876,7 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
|||||||
let i = 1
|
let i = 1
|
||||||
while i < line('.')
|
while i < line('.')
|
||||||
let line = getline(line('.')-i)
|
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')
|
return expand('%:p')
|
||||||
else
|
else
|
||||||
let i += 1
|
let i += 1
|
||||||
@@ -1831,7 +1888,9 @@ function! phpcomplete#GetClassLocation(classname, namespace) " {{{
|
|||||||
let no_namespace_candidate = ''
|
let no_namespace_candidate = ''
|
||||||
let tags = phpcomplete#GetTaglist('^'.a:classname.'$')
|
let tags = phpcomplete#GetTaglist('^'.a:classname.'$')
|
||||||
for tag in tags
|
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')
|
if !has_key(tag, 'namespace')
|
||||||
let no_namespace_candidate = tag.filename
|
let no_namespace_candidate = tag.filename
|
||||||
else
|
else
|
||||||
@@ -1981,7 +2040,7 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
|||||||
|
|
||||||
silent! below 1new
|
silent! below 1new
|
||||||
silent! 0put =cfile
|
silent! 0put =cfile
|
||||||
call search('\(class\|interface\)\_s\+'.a:class_name.'\(\>\|$\)')
|
call search('\c\(class\|interface\|trait\)\_s\+'.a:class_name.'\(\>\|$\)')
|
||||||
let cfline = line('.')
|
let cfline = line('.')
|
||||||
call search('{')
|
call search('{')
|
||||||
let endline = line('.')
|
let endline = line('.')
|
||||||
@@ -1994,8 +2053,48 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
|||||||
let extends_class = ''
|
let extends_class = ''
|
||||||
endif
|
endif
|
||||||
call searchpair('{', '', '}', 'W')
|
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! %
|
silent! bw! %
|
||||||
|
|
||||||
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
|
let [current_namespace, imports] = phpcomplete#GetCurrentNameSpace(a:file_lines[0:cfline])
|
||||||
" go back to original window
|
" go back to original window
|
||||||
exe phpcomplete_original_window.'wincmd w'
|
exe phpcomplete_original_window.'wincmd w'
|
||||||
@@ -2008,21 +2107,27 @@ function! phpcomplete#GetClassContentsStructure(file_path, file_lines, class_nam
|
|||||||
\ 'mtime': getftime(full_file_path),
|
\ 'mtime': getftime(full_file_path),
|
||||||
\ })
|
\ })
|
||||||
|
|
||||||
|
let all_extends = used_traits
|
||||||
if extends_class != ''
|
if extends_class != ''
|
||||||
let [extends_class, namespace] = phpcomplete#ExpandClassName(extends_class, current_namespace, imports)
|
call add(all_extends, extends_class)
|
||||||
if namespace == ''
|
endif
|
||||||
let namespace = '\'
|
if len(all_extends) > 0
|
||||||
endif
|
for class in all_extends
|
||||||
let classlocation = phpcomplete#GetClassLocation(extends_class, namespace)
|
let [class, namespace] = phpcomplete#ExpandClassName(class, current_namespace, imports)
|
||||||
if classlocation == "VIMPHP_BUILTINOBJECT"
|
if namespace == ''
|
||||||
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(extends_class)])]
|
let namespace = '\'
|
||||||
elseif classlocation != '' && filereadable(classlocation)
|
endif
|
||||||
let full_file_path = fnamemodify(classlocation, ':p')
|
let classlocation = phpcomplete#GetClassLocation(class, namespace)
|
||||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, readfile(full_file_path), extends_class)
|
if classlocation == "VIMPHP_BUILTINOBJECT"
|
||||||
elseif tolower(current_namespace) == tolower(namespace)
|
let result += [phpcomplete#GenerateBuiltinClassStub(g:php_builtin_classes[tolower(class)])]
|
||||||
" try to find the declaration in the same file.
|
elseif classlocation != '' && filereadable(classlocation)
|
||||||
let result += phpcomplete#GetClassContentsStructure(full_file_path, a:file_lines, extends_class)
|
let full_file_path = fnamemodify(classlocation, ':p')
|
||||||
endif
|
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, class)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
endif
|
endif
|
||||||
|
|
||||||
return result
|
return result
|
||||||
@@ -2270,19 +2375,40 @@ endfunction!
|
|||||||
" }}}
|
" }}}
|
||||||
|
|
||||||
function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
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 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 i = 0
|
||||||
let file_length = len(file_lines)
|
let file_length = len(file_lines)
|
||||||
let imports = {}
|
let imports = {}
|
||||||
|
|
||||||
let current_namespace = '\'
|
let current_namespace = '\'
|
||||||
|
|
||||||
while i < file_length
|
while i < file_length
|
||||||
let line = file_lines[i]
|
let line = file_lines[i]
|
||||||
|
|
||||||
if line =~? '^\s*namespace\s*'.namespace_name_pattern
|
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
|
break
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -2303,11 +2429,11 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
|||||||
let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
|
let use_line .= ' '.substitute(search_line, '\(^\s\+\|\s\+$\)', '', 'g')
|
||||||
endwhile
|
endwhile
|
||||||
endif
|
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")')
|
let use_parts = map(split(use_expression, '\s*,\s*'), 'substitute(v:val, "\\s+", " ", "g")')
|
||||||
for part in use_parts
|
for part in use_parts
|
||||||
if part =~? '\s\+as\s\+'
|
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 object = substitute(object, '^\\', '', '')
|
||||||
let name = substitute(name, '^\\', '', '')
|
let name = substitute(name, '^\\', '', '')
|
||||||
else
|
else
|
||||||
@@ -2343,7 +2469,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
|||||||
break
|
break
|
||||||
endif
|
endif
|
||||||
" if the name matches with the extracted classname and namespace
|
" 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')
|
if has_key(tag, 'namespace')
|
||||||
let patched_ctags_detected = 1
|
let patched_ctags_detected = 1
|
||||||
if tag.namespace == namespace_for_classes
|
if tag.namespace == namespace_for_classes
|
||||||
@@ -2386,7 +2512,7 @@ function! phpcomplete#GetCurrentNameSpace(file_lines) " {{{
|
|||||||
let tags = phpcomplete#GetTaglist('^'.import['name'].'$')
|
let tags = phpcomplete#GetTaglist('^'.import['name'].'$')
|
||||||
for tag in tags
|
for tag in tags
|
||||||
" search for the first matchin namespace, class, interface with no namespace
|
" 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)
|
call extend(import, tag)
|
||||||
let import['builtin'] = 0
|
let import['builtin'] = 0
|
||||||
break
|
break
|
||||||
|
@@ -37,16 +37,16 @@ if executable('pbcopy')
|
|||||||
let s:copy['*'] = s:copy['+']
|
let s:copy['*'] = s:copy['+']
|
||||||
let s:paste['*'] = s:paste['+']
|
let s:paste['*'] = s:paste['+']
|
||||||
let s:cache_enabled = 0
|
let s:cache_enabled = 0
|
||||||
elseif executable('xclip')
|
elseif exists('$DISPLAY') && executable('xsel')
|
||||||
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')
|
|
||||||
let s:copy['+'] = 'xsel --nodetach -i -b'
|
let s:copy['+'] = 'xsel --nodetach -i -b'
|
||||||
let s:paste['+'] = 'xsel -o -b'
|
let s:paste['+'] = 'xsel -o -b'
|
||||||
let s:copy['*'] = 'xsel --nodetach -i -p'
|
let s:copy['*'] = 'xsel --nodetach -i -p'
|
||||||
let s:paste['*'] = 'xsel -o -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
|
else
|
||||||
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
echom 'clipboard: No clipboard tool available. See :help nvim-clipboard'
|
||||||
finish
|
finish
|
||||||
@@ -83,6 +83,7 @@ function! s:clipboard.set(lines, regtype, reg)
|
|||||||
end
|
end
|
||||||
let selection.data = [a:lines, a:regtype]
|
let selection.data = [a:lines, a:regtype]
|
||||||
let argv = split(s:copy[a:reg], " ")
|
let argv = split(s:copy[a:reg], " ")
|
||||||
|
let selection.detach = s:cache_enabled
|
||||||
let jobid = jobstart(argv, selection)
|
let jobid = jobstart(argv, selection)
|
||||||
if jobid <= 0
|
if jobid <= 0
|
||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
|
@@ -46,7 +46,7 @@ function! provider#python#Call(method, args)
|
|||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
echohl None
|
echohl None
|
||||||
finish
|
return
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||||
|
@@ -46,7 +46,7 @@ function! provider#python3#Call(method, args)
|
|||||||
echohl WarningMsg
|
echohl WarningMsg
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
echohl None
|
echohl None
|
||||||
finish
|
return
|
||||||
endtry
|
endtry
|
||||||
endif
|
endif
|
||||||
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
return call(s:rpcrequest, insert(insert(a:args, 'python_'.a:method), s:host))
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
"""Legacy python/python3-vim emulation."""
|
"""Legacy python/python3-vim emulation."""
|
||||||
import imp
|
import imp
|
||||||
|
import io
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
@@ -151,7 +152,7 @@ class ScriptHost(object):
|
|||||||
current.range = current.buffer.range(start, stop)
|
current.range = current.buffer.range(start, stop)
|
||||||
|
|
||||||
|
|
||||||
class RedirectStream(object):
|
class RedirectStream(io.IOBase):
|
||||||
def __init__(self, redirect_handler):
|
def __init__(self, redirect_handler):
|
||||||
self.redirect_handler = redirect_handler
|
self.redirect_handler = redirect_handler
|
||||||
|
|
||||||
@@ -161,9 +162,6 @@ class RedirectStream(object):
|
|||||||
def writelines(self, seq):
|
def writelines(self, seq):
|
||||||
self.redirect_handler('\n'.join(seq))
|
self.redirect_handler('\n'.join(seq))
|
||||||
|
|
||||||
def flush(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
class LegacyEvalHook(neovim.SessionHook):
|
class LegacyEvalHook(neovim.SessionHook):
|
||||||
|
|
||||||
|
@@ -168,10 +168,15 @@ function! s:UpdateRemotePlugins()
|
|||||||
let hosts = keys(s:hosts)
|
let hosts = keys(s:hosts)
|
||||||
for host in hosts
|
for host in hosts
|
||||||
if has_key(s:plugin_patterns, host)
|
if has_key(s:plugin_patterns, host)
|
||||||
let commands = commands
|
try
|
||||||
\ + ['" '.host.' plugins']
|
let commands +=
|
||||||
\ + s:RegistrationCommands(host)
|
\ ['" '.host.' plugins']
|
||||||
\ + ['', '']
|
\ + s:RegistrationCommands(host)
|
||||||
|
\ + ['', '']
|
||||||
|
catch
|
||||||
|
echomsg v:throwpoint
|
||||||
|
echomsg v:exception
|
||||||
|
endtry
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
call writefile(commands, s:remote_plugins_manifest)
|
call writefile(commands, s:remote_plugins_manifest)
|
||||||
@@ -212,9 +217,11 @@ function! s:RequirePythonHost(host)
|
|||||||
return channel_id
|
return channel_id
|
||||||
endif
|
endif
|
||||||
catch
|
catch
|
||||||
|
echomsg v:throwpoint
|
||||||
echomsg v:exception
|
echomsg v:exception
|
||||||
endtry
|
endtry
|
||||||
throw 'Failed to load Python host. You can try to see what happened '.
|
throw 'Failed to load '. a:host.orig_name . ' host. '.
|
||||||
|
\ 'You can try to see what happened '.
|
||||||
\ 'by starting Neovim with the environment variable '.
|
\ 'by starting Neovim with the environment variable '.
|
||||||
\ '$NVIM_PYTHON_LOG_FILE set to a file and opening '.
|
\ '$NVIM_PYTHON_LOG_FILE set to a file and opening '.
|
||||||
\ 'the generated log file. Also, the host stderr will be available '.
|
\ 'the generated log file. Also, the host stderr will be available '.
|
||||||
|
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
|
" Setup: {{{1
|
||||||
function! tutor#SetupVim()
|
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 has('syntax')
|
||||||
if !exists('g:syntax_on') || g:syntax_on == 0
|
if !exists('g:syntax_on') || g:syntax_on == 0
|
||||||
syntax on
|
syntax on
|
||||||
@@ -245,13 +251,14 @@ endfunction
|
|||||||
" Tutor Cmd: {{{1
|
" Tutor Cmd: {{{1
|
||||||
|
|
||||||
function! s:Locale()
|
function! s:Locale()
|
||||||
let l:lang = ""
|
|
||||||
if exists('v:lang') && v:lang =~ '\a\a'
|
if exists('v:lang') && v:lang =~ '\a\a'
|
||||||
let l:lang = v:lang
|
let l:lang = v:lang
|
||||||
elseif $LC_ALL =~ '\a\a'
|
elseif $LC_ALL =~ '\a\a'
|
||||||
let l:lang = $LC_ALL
|
let l:lang = $LC_ALL
|
||||||
elseif $LANG =~ '\a\a'
|
elseif $LANG =~ '\a\a'
|
||||||
let l:lang = $LANG
|
let l:lang = $LANG
|
||||||
|
else
|
||||||
|
let l:lang = 'en_US'
|
||||||
endif
|
endif
|
||||||
return split(l:lang, '_')
|
return split(l:lang, '_')
|
||||||
endfunction
|
endfunction
|
||||||
@@ -336,6 +343,7 @@ function! tutor#TutorCmd(tutor_name)
|
|||||||
let l:to_open = l:tutors[l:tutor_to_open-1]
|
let l:to_open = l:tutors[l:tutor_to_open-1]
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
call tutor#SetupVim()
|
||||||
exe "edit ".l:to_open
|
exe "edit ".l:to_open
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
@@ -20,7 +20,7 @@ all: tags html
|
|||||||
# Use Vim to generate the tags file. Can only be used when Vim has been
|
# Use Vim to generate the tags file. Can only be used when Vim has been
|
||||||
# compiled and installed. Supports multiple languages.
|
# compiled and installed. Supports multiple languages.
|
||||||
vimtags: $(DOCS)
|
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!
|
# Use "doctags" to generate the tags file. Only works for English!
|
||||||
tags: doctags $(DOCS)
|
tags: doctags $(DOCS)
|
||||||
|
@@ -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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -251,12 +251,14 @@ Name triggered by ~
|
|||||||
|
|
||||||
|SwapExists| detected an existing swap file
|
|SwapExists| detected an existing swap file
|
||||||
|TermOpen| when a terminal buffer is starting
|
|TermOpen| when a terminal buffer is starting
|
||||||
|
|TermClose| when a terminal buffer ends
|
||||||
|
|
||||||
Options
|
Options
|
||||||
|FileType| when the 'filetype' option has been set
|
|FileType| when the 'filetype' option has been set
|
||||||
|Syntax| when the 'syntax' option has been set
|
|Syntax| when the 'syntax' option has been set
|
||||||
|EncodingChanged| after the 'encoding' option has been changed
|
|EncodingChanged| after the 'encoding' option has been changed
|
||||||
|TermChanged| after the value of 'term' has changed
|
|TermChanged| after the value of 'term' has changed
|
||||||
|
|OptionSet| after setting any option
|
||||||
|
|
||||||
Startup and exit
|
Startup and exit
|
||||||
|VimEnter| after doing all the startup stuff
|
|VimEnter| after doing all the startup stuff
|
||||||
@@ -744,6 +746,24 @@ MenuPopup Just before showing the popup menu (under the
|
|||||||
o Operator-pending
|
o Operator-pending
|
||||||
i Insert
|
i Insert
|
||||||
c Command line
|
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*
|
||||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||||
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
||||||
@@ -871,6 +891,8 @@ TermChanged After the value of 'term' has changed. Useful
|
|||||||
for re-loading the syntax file to update the
|
for re-loading the syntax file to update the
|
||||||
colors, fonts and other terminal-dependent
|
colors, fonts and other terminal-dependent
|
||||||
settings. Executed for all loaded buffers.
|
settings. Executed for all loaded buffers.
|
||||||
|
{Nvim} *TermClose*
|
||||||
|
TermClose When a terminal buffer ends.
|
||||||
{Nvim} *TermOpen*
|
{Nvim} *TermOpen*
|
||||||
TermOpen When a terminal buffer is starting. This can
|
TermOpen When a terminal buffer is starting. This can
|
||||||
be used to configure the terminal emulator by
|
be used to configure the terminal emulator by
|
||||||
@@ -951,6 +973,13 @@ WinLeave Before leaving a window. If the window to be
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
6. Patterns *autocmd-patterns* *{pat}*
|
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
|
The file pattern {pat} is tested for a match against the file name in one of
|
||||||
two ways:
|
two ways:
|
||||||
1. When there is no '/' in the pattern, Vim checks for a match against only
|
1. When there is no '/' in the pattern, Vim checks for a match against only
|
||||||
@@ -1019,7 +1048,7 @@ The pattern is interpreted like mostly used in file names:
|
|||||||
[^ch] match any character but 'c' and 'h'
|
[^ch] match any character but 'c' and 'h'
|
||||||
|
|
||||||
Note that for all systems the '/' character is used for path separator (even
|
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.
|
and to make the autocommands portable across different systems.
|
||||||
|
|
||||||
*autocmd-changes*
|
*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 Feb 10
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -370,9 +370,14 @@ CTRL-A Add [count] to the number or alphabetic character at
|
|||||||
CTRL-X Subtract [count] from the number or alphabetic
|
CTRL-X Subtract [count] from the number or alphabetic
|
||||||
character at or after the cursor.
|
character at or after the cursor.
|
||||||
|
|
||||||
The CTRL-A and CTRL-X commands work for (signed) decimal numbers, unsigned
|
The CTRL-A and CTRL-X commands can work for:
|
||||||
octal and hexadecimal numbers and alphabetic characters. This depends on the
|
- signed and unsigned decimal numbers
|
||||||
'nrformats' option.
|
- unsigned binary, octal and hexadecimal numbers
|
||||||
|
- 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'
|
- 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
|
to be octal, unless the number includes a '8' or '9'. Other numbers are
|
||||||
decimal and may have a preceding minus sign.
|
decimal and may have a preceding minus sign.
|
||||||
@@ -386,6 +391,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
|
under or after the cursor. This is useful to make lists with an alphabetic
|
||||||
index.
|
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),
|
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
|
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".
|
"0077" results in "0100", CTRL-X on "0x100" results in "0x0ff".
|
||||||
@@ -397,6 +406,10 @@ octal number.
|
|||||||
Note that when 'nrformats' includes "octal", decimal numbers with leading
|
Note that when 'nrformats' includes "octal", decimal numbers with leading
|
||||||
zeros cause mistakes, because they can be confused with octal numbers.
|
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
|
The CTRL-A command is very useful in a macro. Example: Use the following
|
||||||
steps to make a numbered list.
|
steps to make a numbered list.
|
||||||
|
|
||||||
@@ -832,13 +845,13 @@ This replaces each 'E' character with a euro sign. Read more in |<Char->|.
|
|||||||
:promptf[ind] [string]
|
:promptf[ind] [string]
|
||||||
Put up a Search dialog. When [string] is given, it is
|
Put up a Search dialog. When [string] is given, it is
|
||||||
used as the initial search string.
|
used as the initial search string.
|
||||||
{only for Win32, Motif and GTK GUI}
|
{only for Win32 GUI}
|
||||||
|
|
||||||
*:promptr* *:promptrepl*
|
*:promptr* *:promptrepl*
|
||||||
:promptr[epl] [string]
|
:promptr[epl] [string]
|
||||||
Put up a Search/Replace dialog. When [string] is
|
Put up a Search/Replace dialog. When [string] is
|
||||||
given, it is used as the initial search string.
|
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*
|
4.4 Changing tabs *change-tabs*
|
||||||
@@ -1063,11 +1076,12 @@ There are nine types of registers: *registers* *E354*
|
|||||||
2. 10 numbered registers "0 to "9
|
2. 10 numbered registers "0 to "9
|
||||||
3. The small delete register "-
|
3. The small delete register "-
|
||||||
4. 26 named registers "a to "z or "A to "Z
|
4. 26 named registers "a to "z or "A to "Z
|
||||||
5. four read-only registers ":, "., "% and "#
|
5. three read-only registers ":, "., "%
|
||||||
6. the expression register "=
|
6. alternate buffer register "#
|
||||||
7. The selection and drop registers "*, "+ and "~
|
7. the expression register "=
|
||||||
8. The black hole register "_
|
8. The selection and drop registers "*, "+ and "~
|
||||||
9. Last search pattern register "/
|
9. The black hole register "_
|
||||||
|
10. Last search pattern register "/
|
||||||
|
|
||||||
1. Unnamed register "" *quote_quote* *quotequote*
|
1. Unnamed register "" *quote_quote* *quotequote*
|
||||||
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
|
Vim fills this register with text deleted with the "d", "c", "s", "x" commands
|
||||||
@@ -1109,7 +1123,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
|
to their previous contents. When the '>' flag is present in 'cpoptions' then
|
||||||
a line break is inserted before the appended text.
|
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",
|
These are '%', '#', ':' and '.'. You can use them only with the "p", "P",
|
||||||
and ":put" commands and with CTRL-R.
|
and ":put" commands and with CTRL-R.
|
||||||
*quote_.* *quote.* *E29*
|
*quote_.* *quote.* *E29*
|
||||||
@@ -1120,8 +1134,6 @@ and ":put" commands and with CTRL-R.
|
|||||||
('textwidth' and other options affect what is inserted).
|
('textwidth' and other options affect what is inserted).
|
||||||
*quote_%* *quote%*
|
*quote_%* *quote%*
|
||||||
"% Contains the name of the current file.
|
"% Contains the name of the current file.
|
||||||
*quote_#* *quote#*
|
|
||||||
"# Contains the name of the alternate file.
|
|
||||||
*quote_:* *quote:* *E30*
|
*quote_:* *quote:* *E30*
|
||||||
": Contains the most recent executed command-line. Example: Use
|
": Contains the most recent executed command-line. Example: Use
|
||||||
"@:" to repeat the previous command-line command.
|
"@:" to repeat the previous command-line command.
|
||||||
@@ -1129,15 +1141,33 @@ and ":put" commands and with CTRL-R.
|
|||||||
one character of it was typed. Thus it remains unchanged if
|
one character of it was typed. Thus it remains unchanged if
|
||||||
the command was completely from a mapping.
|
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
|
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
|
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
|
read-write.
|
||||||
the command-line, where you can enter any expression (see |expression|). All
|
|
||||||
normal command-line editing commands are available, including a special
|
When typing the '=' after " or CTRL-R the cursor moves to the command-line,
|
||||||
history for expressions. When you end the command-line by typing <CR>, Vim
|
where you can enter any expression (see |expression|). All normal
|
||||||
computes the result of the expression. If you end it with <Esc>, Vim abandons
|
command-line editing commands are available, including a special history for
|
||||||
the expression. If you do not enter an expression, Vim uses the previous
|
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).
|
expression (like with the "/" command).
|
||||||
|
|
||||||
The expression must evaluate to a String. A Number is always automatically
|
The expression must evaluate to a String. A Number is always automatically
|
||||||
@@ -1150,35 +1180,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
|
characters. If the String ends in a <NL>, it is regarded as a linewise
|
||||||
register.
|
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.
|
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
|
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,
|
working, the unnamed register is used instead. For Unix systems and Mac OS X,
|
||||||
see |nvim-clipboard|.
|
see |nvim-clipboard|.
|
||||||
|
|
||||||
*quote_~* *quote~* *<Drop>*
|
9. Black hole register "_ *quote_*
|
||||||
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_*
|
|
||||||
When writing to this register, nothing happens. This can be used to delete
|
When writing to this register, nothing happens. This can be used to delete
|
||||||
text without affecting the normal registers. When reading from this register,
|
text without affecting the normal registers. When reading from this register,
|
||||||
nothing is returned.
|
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'.
|
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
|
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
|
other matches without actually searching. You can't yank or delete into this
|
||||||
register. The search direction is available in |v:searchforward|.
|
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|.
|
|function-search-undo|.
|
||||||
|
|
||||||
*@/*
|
*@/*
|
||||||
@@ -1390,10 +1408,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 "/"
|
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
|
before typing anything else on the new line. This will replace the
|
||||||
middle-comment leader with the end-comment leader and apply any specified
|
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
|
When there is a match with a middle part, but there also is a matching end
|
||||||
which is longer, the end part is used. This makes a C style comment work
|
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.
|
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
|
Here is an example of alignment flags at work to make a comment stand out
|
||||||
@@ -1597,7 +1615,7 @@ Vim has a sorting function and a sorting command. The sorting function can be
|
|||||||
found here: |sort()|, |uniq()|.
|
found here: |sort()|, |uniq()|.
|
||||||
|
|
||||||
*:sor* *:sort*
|
*: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
|
Sort lines in [range]. When no range is given all
|
||||||
lines are sorted.
|
lines are sorted.
|
||||||
|
|
||||||
@@ -1617,6 +1635,9 @@ found here: |sort()|, |uniq()|.
|
|||||||
With [o] sorting is done on the first octal number in
|
With [o] sorting is done on the first octal number in
|
||||||
the line (after or inside a {pattern} match).
|
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
|
With [u] only keep the first of a sequence of
|
||||||
identical lines (ignoring case when [i] is used).
|
identical lines (ignoring case when [i] is used).
|
||||||
Without this flag, a sequence of identical lines
|
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>*
|
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
|
||||||
CTRL-P After using 'wildchar' which got multiple matches, go to
|
CTRL-P After using 'wildchar' which got multiple matches, go to
|
||||||
previous match. Otherwise recall older command-line from
|
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*
|
*c_CTRL-A*
|
||||||
CTRL-A All names that match the pattern in front of the cursor are
|
CTRL-A All names that match the pattern in front of the cursor are
|
||||||
inserted.
|
inserted.
|
||||||
@@ -482,6 +482,8 @@ followed by another Vim command:
|
|||||||
:argdo
|
:argdo
|
||||||
:autocmd
|
:autocmd
|
||||||
:bufdo
|
:bufdo
|
||||||
|
:cdo
|
||||||
|
:cfdo
|
||||||
:command
|
:command
|
||||||
:cscope
|
:cscope
|
||||||
:debug
|
:debug
|
||||||
@@ -490,8 +492,9 @@ followed by another Vim command:
|
|||||||
:function
|
:function
|
||||||
:global
|
:global
|
||||||
:help
|
:help
|
||||||
:helpfind
|
|
||||||
:lcscope
|
:lcscope
|
||||||
|
:ldo
|
||||||
|
:lfdo
|
||||||
:make
|
:make
|
||||||
:normal
|
:normal
|
||||||
:promptfind
|
:promptfind
|
||||||
@@ -816,7 +819,7 @@ These modifiers can be given, in this order:
|
|||||||
separator is removed. Thus ":p:h" on a directory name results
|
separator is removed. Thus ":p:h" on a directory name results
|
||||||
on the directory name itself (without trailing slash).
|
on the directory name itself (without trailing slash).
|
||||||
When the file name is an absolute path (starts with "/" for
|
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)
|
When there is no head (path is relative to current directory)
|
||||||
the result is empty.
|
the result is empty.
|
||||||
:t Tail of the file name (last component of the name). Must
|
: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 "!".
|
the "!".
|
||||||
|
|
||||||
*filename-backslash*
|
*filename-backslash*
|
||||||
For filesystems that use a backslash as directory separator (MS-DOS and
|
For filesystems that use a backslash as directory separator (Windows
|
||||||
Windows), it's a bit difficult to recognize a backslash that is used
|
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
|
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
|
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
|
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.
|
Vim.
|
||||||
|
|
||||||
1. Design goals |design-goals|
|
1. Design goals |design-goals|
|
||||||
2. Coding style |coding-style|
|
2. Design decisions |design-decisions|
|
||||||
3. Design decisions |design-decisions|
|
|
||||||
4. Assumptions |design-assumptions|
|
|
||||||
|
|
||||||
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.
|
code.
|
||||||
|
|
||||||
Vim is open source software. Everybody is encouraged to contribute to help
|
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.
|
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*
|
VIM IS... IMPROVED *design-improved*
|
||||||
|
|
||||||
The IMproved bits of Vim should make it a better Vi, without becoming a
|
The IMproved bits of Vim should make it a better Vi, without becoming a
|
||||||
@@ -122,7 +98,6 @@ fast.
|
|||||||
VIM IS... MAINTAINABLE *design-maintain*
|
VIM IS... MAINTAINABLE *design-maintain*
|
||||||
|
|
||||||
- The source code should not become a mess. It should be reliable code.
|
- 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
|
- Use comments in a useful way! Quoting the function name and argument names
|
||||||
is NOT useful. Do explain what they are for.
|
is NOT useful. Do explain what they are for.
|
||||||
- Porting to another platform should be made easy, without having to change
|
- 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.
|
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*
|
2. Design decisions *design-decisions*
|
||||||
|
|
||||||
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*
|
|
||||||
|
|
||||||
Folding
|
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
|
become. But in practice it is a noticeable improvement over not using the word
|
||||||
count.
|
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:
|
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
|
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'|.
|
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*
|
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
|
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
|
as the original file with 'backupext' appended. The default "~" is a bit
|
||||||
strange to avoid accidentally overwriting existing files. If you prefer ".bak"
|
strange to avoid accidentally overwriting existing files. If you prefer ".bak"
|
||||||
change the 'backupext' option. Extra dots are replaced with '_' on MS-DOS
|
change the 'backupext' option. The backup file can be placed in another
|
||||||
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
|
|
||||||
directory by setting 'backupdir'.
|
directory by setting 'backupdir'.
|
||||||
|
|
||||||
When you started editing without giving a file name, "No File" is displayed in
|
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".
|
Mnemonic: "goto file".
|
||||||
Uses the 'isfname' option to find out which characters
|
Uses the 'isfname' option to find out which characters
|
||||||
are supposed to be in a file name. Trailing
|
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
|
Uses the 'path' option as a list of directory names to
|
||||||
look for the file. See the 'path' option for details
|
look for the file. See the 'path' option for details
|
||||||
about relative directories and wildcards.
|
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*
|
"mac" <CR> Mac format *Mac-format*
|
||||||
|
|
||||||
When reading a file, the mentioned characters are interpreted as the <EOL>.
|
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
|
In DOS format (default for Windows), <CR><NL> and <NL> are both interpreted as
|
||||||
interpreted as the <EOL>. Note that when writing the file in DOS format,
|
the <EOL>. Note that when writing the file in DOS format, <CR> characters will
|
||||||
<CR> characters will be added for each single <NL>. Also see |file-read|.
|
be added for each single <NL>. Also see |file-read|.
|
||||||
|
|
||||||
When writing a file, the mentioned characters are used for <EOL>. For DOS
|
When writing a file, the mentioned characters are used for <EOL>. For DOS
|
||||||
format <CR><NL> is used. Also see |DOS-format-write|.
|
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
|
(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
|
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
|
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>
|
otherwise it is set to "unix". When 'fileformats' includes "mac", and no <NL>
|
||||||
characters are found in the file, 'fileformat' is set to "mac".
|
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
|
"[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]"
|
"unix". On all systems but the Macintosh you get the message "[mac format]"
|
||||||
if 'fileformat' is set to "mac".
|
if 'fileformat' is set to "mac".
|
||||||
|
|
||||||
@@ -795,7 +794,8 @@ USING THE ARGUMENT LIST
|
|||||||
autocommand event is disabled by adding it to
|
autocommand event is disabled by adding it to
|
||||||
'eventignore'. This considerably speeds up editing
|
'eventignore'. This considerably speeds up editing
|
||||||
each file.
|
each file.
|
||||||
Also see |:windo|, |:tabdo| and |:bufdo|.
|
Also see |:windo|, |:tabdo|, |:bufdo|, |:cdo|, |:ldo|,
|
||||||
|
|:cfdo| and |:lfdo|.
|
||||||
|
|
||||||
Example: >
|
Example: >
|
||||||
:args *.c
|
:args *.c
|
||||||
@@ -964,10 +964,10 @@ lost the original file.
|
|||||||
|
|
||||||
*DOS-format-write*
|
*DOS-format-write*
|
||||||
If the 'fileformat' is "dos", <CR> <NL> is used for <EOL>. This is default
|
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.
|
remind you that an unusual <EOL> was used.
|
||||||
*Unix-format-write*
|
*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.
|
the message "[unix format]" is shown.
|
||||||
*Mac-format-write*
|
*Mac-format-write*
|
||||||
If the 'fileformat' is "mac", <CR> is used for <EOL>. On non-Mac systems the
|
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.
|
would be impossible). You need to use "!", since the device already exists.
|
||||||
Example for Unix: >
|
Example for Unix: >
|
||||||
:w! /dev/lpt0
|
:w! /dev/lpt0
|
||||||
and for MS-DOS or MS-Windows: >
|
and Windows: >
|
||||||
:w! lpt0
|
:w! lpt0
|
||||||
For Unix a device is detected when the name doesn't refer to a normal file or
|
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.
|
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
|
CON
|
||||||
CLOCK$
|
CLOCK$
|
||||||
NUL
|
NUL
|
||||||
@@ -1141,10 +1141,10 @@ If you want to always use ":confirm", set the 'confirm' option.
|
|||||||
|:mkvimrc|, |:mksession|, |:mkview|, |:split|,
|
|:mkvimrc|, |:mksession|, |:mkview|, |:split|,
|
||||||
|:vsplit|, |:tabe|, |:tabnew|, |:cfile|, |:cgetfile|,
|
|:vsplit|, |:tabe|, |:tabnew|, |:cfile|, |:cgetfile|,
|
||||||
|:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|,
|
|:caddfile|, |:lfile|, |:lgetfile|, |:laddfile|,
|
||||||
|:diffsplit|, |:diffpatch|, |:open|, |:pedit|,
|
|:diffsplit|, |:diffpatch|, |:pedit|, |:redir|,
|
||||||
|:redir|, |:source|, |:update|, |:visual|, |:vsplit|,
|
|:source|, |:update|, |:visual|, |:vsplit|,
|
||||||
and |:qall| if 'confirm' is set.
|
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
|
When ":browse" is not possible you get an error
|
||||||
message. If the |+browse| feature is missing or the
|
message. If the |+browse| feature is missing or the
|
||||||
{command} doesn't support browsing, the {command} is
|
{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.
|
unmodified.
|
||||||
|
|
||||||
*browsefilter*
|
*browsefilter*
|
||||||
For MS Windows and GTK, you can modify the filters that are used in the browse
|
For Windows you can modify the filters that are used in the browse dialog. By
|
||||||
dialog. By setting the g:browsefilter or b:browsefilter variables, you can
|
setting the g:browsefilter or b:browsefilter variables, you can change the
|
||||||
change the filters globally or locally to the buffer. The variable is set to
|
filters globally or locally to the buffer. The variable is set to a string in
|
||||||
a string in the format "{filter label}\t{pattern};{pattern}\n" where {filter
|
the format "{filter label}\t{pattern};{pattern}\n" where {filter label} is the
|
||||||
label} is the text that appears in the "Files of Type" comboBox, and {pattern}
|
text that appears in the "Files of Type" comboBox, and {pattern} is the
|
||||||
is the pattern which filters the filenames. Several patterns can be given,
|
pattern which filters the filenames. Several patterns can be given, separated
|
||||||
separated by ';'.
|
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 example, to have only Vim files in the dialog, you could use the following
|
For example, to have only Vim files in the dialog, you could use the following
|
||||||
command: >
|
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,
|
Does not change the meaning of an already opened file,
|
||||||
because its full path name is remembered. Files from
|
because its full path name is remembered. Files from
|
||||||
the |arglist| may change though!
|
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: >
|
To change to the directory of the current file: >
|
||||||
:cd %:h
|
: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 Nov 30
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -65,14 +65,16 @@ the Number. Examples:
|
|||||||
Number 0 --> String "0" ~
|
Number 0 --> String "0" ~
|
||||||
Number -1 --> String "-1" ~
|
Number -1 --> String "-1" ~
|
||||||
*octal*
|
*octal*
|
||||||
Conversion from a String to a Number is done by converting the first digits
|
Conversion from a String to a Number is done by converting the first digits to
|
||||||
to a number. Hexadecimal "0xf9" and Octal "017" numbers are recognized. If
|
a number. Hexadecimal "0xf9", Octal "017", and Binary "0b10" numbers are
|
||||||
the String doesn't start with digits, the result is zero. Examples:
|
recognized. If the String doesn't start with digits, the result is zero.
|
||||||
|
Examples:
|
||||||
String "456" --> Number 456 ~
|
String "456" --> Number 456 ~
|
||||||
String "6bar" --> Number 6 ~
|
String "6bar" --> Number 6 ~
|
||||||
String "foo" --> Number 0 ~
|
String "foo" --> Number 0 ~
|
||||||
String "0xf1" --> Number 241 ~
|
String "0xf1" --> Number 241 ~
|
||||||
String "0100" --> Number 64 ~
|
String "0100" --> Number 64 ~
|
||||||
|
String "0b101" --> Number 5 ~
|
||||||
String "-8" --> Number -8 ~
|
String "-8" --> Number -8 ~
|
||||||
String "+8" --> Number 0 ~
|
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
|
To avoid the extra name for the function it can be defined and directly
|
||||||
assigned to a Dictionary in this way: >
|
assigned to a Dictionary in this way: >
|
||||||
:let mydict = {'data': [0, 1, 2, 3]}
|
:let mydict = {'data': [0, 1, 2, 3]}
|
||||||
:function mydict.len() dict
|
:function mydict.len()
|
||||||
: return len(self.data)
|
: return len(self.data)
|
||||||
:endfunction
|
:endfunction
|
||||||
:echo mydict.len()
|
: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:
|
Floating point numbers can be written in two forms:
|
||||||
|
|
||||||
[-+]{N}.{M}
|
[-+]{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
|
{N} and {M} are numbers. Both {N} and {M} must be present and can only
|
||||||
contain digits.
|
contain digits.
|
||||||
@@ -1017,7 +1019,7 @@ A string constant accepts these special characters:
|
|||||||
\X. same as \x.
|
\X. same as \x.
|
||||||
\u.... character specified with up to 4 hex numbers, stored according to the
|
\u.... character specified with up to 4 hex numbers, stored according to the
|
||||||
current value of 'encoding' (e.g., "\u02a4")
|
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>
|
\b backspace <BS>
|
||||||
\e escape <Esc>
|
\e escape <Esc>
|
||||||
\f formfeed <FF>
|
\f formfeed <FF>
|
||||||
@@ -1375,6 +1377,15 @@ v:errmsg Last given error message. It's allowed to set this variable.
|
|||||||
: ... handle error
|
: ... handle error
|
||||||
< "errmsg" also works, for backwards compatibility.
|
< "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:exception* *exception-variable*
|
*v:exception* *exception-variable*
|
||||||
v:exception The value of the exception most recently caught and not
|
v:exception The value of the exception most recently caught and not
|
||||||
finished. See also |v:throwpoint| and |throw-variables|.
|
finished. See also |v:throwpoint| and |throw-variables|.
|
||||||
@@ -1535,6 +1546,15 @@ v:oldfiles List of file names that is loaded from the |shada| file on
|
|||||||
than String this will cause trouble.
|
than String this will cause trouble.
|
||||||
{only when compiled with the |+shada| feature}
|
{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* *operator-variable*
|
||||||
v:operator The last operator given in Normal mode. This is a single
|
v:operator The last operator given in Normal mode. This is a single
|
||||||
character except for commands starting with <g> or <z>,
|
character except for commands starting with <g> or <z>,
|
||||||
@@ -1719,10 +1739,13 @@ append( {lnum}, {string}) Number append {string} below line {lnum}
|
|||||||
append( {lnum}, {list}) Number append lines {list} below line {lnum}
|
append( {lnum}, {list}) Number append lines {list} below line {lnum}
|
||||||
argc() Number number of files in the argument list
|
argc() Number number of files in the argument list
|
||||||
argidx() Number current index in the argument list
|
argidx() Number current index in the argument list
|
||||||
arglistid( [{winnr}, [ {tabnr}]])
|
arglistid( [{winnr} [, {tabnr}]])
|
||||||
Number argument list id
|
Number argument list id
|
||||||
argv( {nr}) String {nr} entry of the argument list
|
argv( {nr}) String {nr} entry of the argument list
|
||||||
argv( ) List 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}
|
asin( {expr}) Float arc sine of {expr}
|
||||||
atan( {expr}) Float arc tangent of {expr}
|
atan( {expr}) Float arc tangent of {expr}
|
||||||
atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2}
|
atan2( {expr}, {expr}) Float arc tangent of {expr1} / {expr2}
|
||||||
@@ -1763,6 +1786,8 @@ cursor( {lnum}, {col} [, {off}])
|
|||||||
cursor( {list}) Number move cursor to position in {list}
|
cursor( {list}) Number move cursor to position in {list}
|
||||||
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
|
deepcopy( {expr} [, {noref}]) any make a full copy of {expr}
|
||||||
delete( {fname}) Number delete file {fname}
|
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
|
did_filetype() Number TRUE if FileType autocommand event used
|
||||||
diff_filler( {lnum}) Number diff filler lines about {lnum}
|
diff_filler( {lnum}) Number diff filler lines about {lnum}
|
||||||
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
diff_hlID( {lnum}, {col}) Number diff highlighting at {lnum}/{col}
|
||||||
@@ -1837,10 +1862,10 @@ getwinposx() Number X coord in pixels of GUI Vim window
|
|||||||
getwinposy() Number Y coord in pixels of GUI Vim window
|
getwinposy() Number Y coord in pixels of GUI Vim window
|
||||||
getwinvar( {nr}, {varname} [, {def}])
|
getwinvar( {nr}, {varname} [, {def}])
|
||||||
any variable {varname} in window {nr}
|
any variable {varname} in window {nr}
|
||||||
glob( {expr} [, {nosuf} [, {list}]])
|
glob( {expr} [, {nosuf} [, {list} [, {alllinks}]]])
|
||||||
any expand file wildcards in {expr}
|
any expand file wildcards in {expr}
|
||||||
glob2regpat( {expr}) String convert a glob pat into a search pat
|
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}
|
String do glob({expr}) for all dirs in {path}
|
||||||
has( {feature}) Number TRUE if feature {feature} supported
|
has( {feature}) Number TRUE if feature {feature} supported
|
||||||
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
has_key( {dict}, {key}) Number TRUE if {dict} has entry {key}
|
||||||
@@ -1870,10 +1895,14 @@ invert( {expr}) Number bitwise invert
|
|||||||
isdirectory( {directory}) Number TRUE if {directory} is a directory
|
isdirectory( {directory}) Number TRUE if {directory} is a directory
|
||||||
islocked( {expr}) Number TRUE if {expr} is locked
|
islocked( {expr}) Number TRUE if {expr} is locked
|
||||||
items( {dict}) List key-value pairs in {dict}
|
items( {dict}) List key-value pairs in {dict}
|
||||||
job_close({job}) Closes a job with id {job}
|
jobclose({job}[, {stream}]) Number Closes a job stream(s)
|
||||||
job_send({job}, {data}) Writes {data} to {job}'s stdin
|
jobpid({job}) Number Returns pid of a job.
|
||||||
job_spawn({name}, {prog}[, {argv}])
|
jobresize({job}, {width}, {height})
|
||||||
Spawns {prog} as a job associated with {name}
|
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
|
join( {list} [, {sep}]) String join {list} items into one String
|
||||||
keys( {dict}) List keys in {dict}
|
keys( {dict}) List keys in {dict}
|
||||||
len( {expr}) Number the length of {expr}
|
len( {expr}) Number the length of {expr}
|
||||||
@@ -2147,6 +2176,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
|
< Without the {nr} argument a |List| with the whole |arglist| is
|
||||||
returned.
|
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()*
|
asin({expr}) *asin()*
|
||||||
Return the arc sine of {expr} measured in radians, as a |Float|
|
Return the arc sine of {expr} measured in radians, as a |Float|
|
||||||
in the range of [-pi/2, pi/2].
|
in the range of [-pi/2, pi/2].
|
||||||
@@ -2401,6 +2461,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)
|
number of bytes in the cursor line plus one)
|
||||||
'x position of mark x (if the mark is not set, 0 is
|
'x position of mark x (if the mark is not set, 0 is
|
||||||
returned)
|
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
|
Additionally {expr} can be [lnum, col]: a |List| with the line
|
||||||
and column number. Most useful when the column is "$", to get
|
and column number. Most useful when the column is "$", to get
|
||||||
the last column of a specific line. When "lnum" or "col" is
|
the last column of a specific line. When "lnum" or "col" is
|
||||||
@@ -2502,10 +2566,10 @@ confirm({msg} [, {choices} [, {default} [, {type}]]])
|
|||||||
{default} is omitted, 1 is used.
|
{default} is omitted, 1 is used.
|
||||||
|
|
||||||
The optional {type} argument gives the type of dialog. This
|
The optional {type} argument gives the type of dialog. This
|
||||||
is only used for the icon of the GTK, Mac, Motif and Win32
|
is only used for the icon of the Win32 GUI. It can be one of
|
||||||
GUI. It can be one of these values: "Error", "Question",
|
these values: "Error", "Question", "Info", "Warning" or
|
||||||
"Info", "Warning" or "Generic". Only the first character is
|
"Generic". Only the first character is relevant.
|
||||||
relevant. When {type} is omitted, "Generic" is used.
|
When {type} is omitted, "Generic" is used.
|
||||||
|
|
||||||
If the user aborts the dialog by pressing <Esc>, CTRL-C,
|
If the user aborts the dialog by pressing <Esc>, CTRL-C,
|
||||||
or another valid interrupt key, confirm() returns 0.
|
or another valid interrupt key, confirm() returns 0.
|
||||||
@@ -2661,6 +2725,44 @@ delete({fname}) *delete()*
|
|||||||
To delete a line from the buffer use |:delete|. Use |:exe|
|
To delete a line from the buffer use |:delete|. Use |:exe|
|
||||||
when the line number is in a variable.
|
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()*
|
||||||
did_filetype() Returns non-zero when autocommands are being executed and the
|
did_filetype() Returns non-zero when autocommands are being executed and the
|
||||||
FileType event has been triggered at least once. Can be used
|
FileType event has been triggered at least once. Can be used
|
||||||
@@ -2726,7 +2828,7 @@ executable({expr}) *executable()*
|
|||||||
arguments.
|
arguments.
|
||||||
executable() uses the value of $PATH and/or the normal
|
executable() uses the value of $PATH and/or the normal
|
||||||
searchpath for programs. *PATHEXT*
|
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
|
optionally be included. Then the extensions in $PATHEXT are
|
||||||
tried. Thus if "foo.exe" does not exist, "foo.exe.bat" can be
|
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
|
found. If $PATHEXT is not set then ".exe;.com;.bat;.cmd" is
|
||||||
@@ -2734,9 +2836,9 @@ executable({expr}) *executable()*
|
|||||||
the name without an extension. When 'shell' looks like a
|
the name without an extension. When 'shell' looks like a
|
||||||
Unix shell, then the name is also tried without adding an
|
Unix shell, then the name is also tried without adding an
|
||||||
extension.
|
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.
|
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
|
always found. Since this directory is added to $PATH it
|
||||||
should also work to execute it |win32-PATH|.
|
should also work to execute it |win32-PATH|.
|
||||||
The result is a Number:
|
The result is a Number:
|
||||||
@@ -2959,6 +3061,8 @@ extend({expr1}, {expr2} [, {expr3}]) *extend()*
|
|||||||
{expr1} is changed when {expr2} is not empty. If necessary
|
{expr1} is changed when {expr2} is not empty. If necessary
|
||||||
make a copy of {expr1} first.
|
make a copy of {expr1} first.
|
||||||
{expr2} remains unchanged.
|
{expr2} remains unchanged.
|
||||||
|
When {expr1} is locked and {expr2} is not empty the operation
|
||||||
|
fails.
|
||||||
Returns {expr1}.
|
Returns {expr1}.
|
||||||
|
|
||||||
|
|
||||||
@@ -3178,8 +3282,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
|
On Win32 systems this might not work, the OS does not always
|
||||||
allow a window to bring itself to the foreground. Use
|
allow a window to bring itself to the foreground. Use
|
||||||
|remote_foreground()| instead.
|
|remote_foreground()| instead.
|
||||||
{only in the Win32, Athena, Motif and GTK GUI versions and the
|
{only in the Win32 GUI and console version}
|
||||||
Win32 console version}
|
|
||||||
|
|
||||||
|
|
||||||
function({name}) *function()* *E700*
|
function({name}) *function()* *E700*
|
||||||
@@ -3310,7 +3413,7 @@ getchar([expr]) *getchar()*
|
|||||||
: endwhile
|
: endwhile
|
||||||
:endfunction
|
: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
|
|<CursorHold>|. Often you will want to ignore this and get
|
||||||
another character: >
|
another character: >
|
||||||
:function GetKey()
|
:function GetKey()
|
||||||
@@ -3427,8 +3530,6 @@ getfontname([{name}]) *getfontname()*
|
|||||||
Only works when the GUI is running, thus not in your vimrc or
|
Only works when the GUI is running, thus not in your vimrc or
|
||||||
gvimrc file. Use the |GUIEnter| autocommand to use this
|
gvimrc file. Use the |GUIEnter| autocommand to use this
|
||||||
function just after the GUI has started.
|
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()*
|
getfperm({fname}) *getfperm()*
|
||||||
The result is a String, which is the read, write, and execute
|
The result is a String, which is the read, write, and execute
|
||||||
@@ -3527,8 +3628,7 @@ getmatches() *getmatches()*
|
|||||||
<
|
<
|
||||||
*getpid()*
|
*getpid()*
|
||||||
getpid() Return a Number which is the process ID of the Vim process.
|
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
|
This is a unique number, until Vim exits.
|
||||||
exits. On MS-DOS it's always zero.
|
|
||||||
|
|
||||||
*getpos()*
|
*getpos()*
|
||||||
getpos({expr}) Get the position for {expr}. For possible values of {expr}
|
getpos({expr}) Get the position for {expr}. For possible values of {expr}
|
||||||
@@ -3654,7 +3754,7 @@ getwinvar({winnr}, {varname} [, {def}]) *getwinvar()*
|
|||||||
:let list_is_on = getwinvar(2, '&list')
|
:let list_is_on = getwinvar(2, '&list')
|
||||||
:echo "myvar = " . getwinvar(1, 'myvar')
|
: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
|
Expand the file wildcards in {expr}. See |wildcards| for the
|
||||||
use of special characters.
|
use of special characters.
|
||||||
|
|
||||||
@@ -3671,8 +3771,11 @@ glob({expr} [, {nosuf} [, {list}]]) *glob()*
|
|||||||
matches, they are separated by <NL> characters.
|
matches, they are separated by <NL> characters.
|
||||||
|
|
||||||
If the expansion fails, the result is an empty String or List.
|
If the expansion fails, the result is an empty String or List.
|
||||||
|
|
||||||
A name for a non-existing file is not included. A symbolic
|
A name for a non-existing file is not included. A symbolic
|
||||||
link is only included if it points to an existing file.
|
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
|
For most systems backticks can be used to get files names from
|
||||||
any external command. Example: >
|
any external command. Example: >
|
||||||
@@ -3691,8 +3794,11 @@ glob2regpat({expr}) *glob2regpat()*
|
|||||||
if filename =~ glob2regpat('Make*.mak')
|
if filename =~ glob2regpat('Make*.mak')
|
||||||
< This is equivalent to: >
|
< This is equivalent to: >
|
||||||
if filename =~ '^Make.*\.mak$'
|
if filename =~ '^Make.*\.mak$'
|
||||||
<
|
< When {expr} is an empty string the result is "^$", match an
|
||||||
globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
empty string.
|
||||||
|
|
||||||
|
*globpath()*
|
||||||
|
globpath({path}, {expr} [, {nosuf} [, {list} [, {allinks}]]])
|
||||||
Perform glob() on all directories in {path} and concatenate
|
Perform glob() on all directories in {path} and concatenate
|
||||||
the results. Example: >
|
the results. Example: >
|
||||||
:echo globpath(&rtp, "syntax/c.vim")
|
:echo globpath(&rtp, "syntax/c.vim")
|
||||||
@@ -3718,6 +3824,8 @@ globpath({path}, {expr} [, {nosuf} [, {list}]]) *globpath()*
|
|||||||
they are separated by <NL> characters. Example: >
|
they are separated by <NL> characters. Example: >
|
||||||
:echo globpath(&rtp, "syntax/c.vim", 0, 1)
|
: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.
|
The "**" item can be used to search in a directory tree.
|
||||||
For example, to find all "README.txt" files in the directories
|
For example, to find all "README.txt" files in the directories
|
||||||
in 'runtimepath' and below: >
|
in 'runtimepath' and below: >
|
||||||
@@ -4060,6 +4168,9 @@ jobclose({job}[, {stream}]) {Nvim} *jobclose()*
|
|||||||
Close {job}'s {stream}, which can be one "stdin", "stdout" or
|
Close {job}'s {stream}, which can be one "stdin", "stdout" or
|
||||||
"stderr". If {stream} is omitted, all streams are closed.
|
"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()*
|
jobresize({job}, {width}, {height}) {Nvim} *jobresize()*
|
||||||
Resize {job}'s pseudo terminal window to {width} and {height}.
|
Resize {job}'s pseudo terminal window to {width} and {height}.
|
||||||
This function will fail if used on jobs started without the
|
This function will fail if used on jobs started without the
|
||||||
@@ -4079,9 +4190,14 @@ jobsend({job}, {data}) {Nvim} *jobsend()*
|
|||||||
|
|
||||||
jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
||||||
Spawns {cmd} as a job. If {cmd} is a |List|, it will be run
|
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 >
|
directly. If {cmd} is a |string|, it will be roughly
|
||||||
:call jobstart([&shell, &shellcmdflag, '{cmd}'])
|
equivalent to >
|
||||||
< If passed, {opts} must be a dictionary with any of the
|
: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:
|
following keys:
|
||||||
- on_stdout: stdout event handler
|
- on_stdout: stdout event handler
|
||||||
- on_stderr: stderr event handler
|
- on_stderr: stderr event handler
|
||||||
@@ -4092,6 +4208,10 @@ jobstart({cmd}[, {opts}]) {Nvim} *jobstart()*
|
|||||||
- width: Width of the terminal screen(only if pty is set)
|
- width: Width of the terminal screen(only if pty is set)
|
||||||
- height: Height 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)
|
- 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
|
Either funcrefs or function names can be passed as event
|
||||||
handlers. The {opts} object is also used as the "self"
|
handlers. The {opts} object is also used as the "self"
|
||||||
argument for the callback, so the caller may pass arbitrary
|
argument for the callback, so the caller may pass arbitrary
|
||||||
@@ -4658,7 +4778,7 @@ msgpackdump({list}) {Nvim} *msgpackdump()*
|
|||||||
(dictionary with zero items is represented by 0x80 byte in
|
(dictionary with zero items is represented by 0x80 byte in
|
||||||
messagepack).
|
messagepack).
|
||||||
|
|
||||||
Limitations:
|
Limitations: *E951* *E952*
|
||||||
1. |Funcref|s cannot be dumped.
|
1. |Funcref|s cannot be dumped.
|
||||||
2. Containers that reference themselves cannot be dumped.
|
2. Containers that reference themselves cannot be dumped.
|
||||||
3. Dictionary keys are always dumped as STR strings.
|
3. Dictionary keys are always dumped as STR strings.
|
||||||
@@ -4809,6 +4929,9 @@ printf({fmt}, {expr1} ...) *printf()*
|
|||||||
%c single byte
|
%c single byte
|
||||||
%d decimal number
|
%d decimal number
|
||||||
%5d decimal number padded with spaces to 5 characters
|
%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
|
%x hex number
|
||||||
%04x hex number padded with zeros to at least 4 characters
|
%04x hex number padded with zeros to at least 4 characters
|
||||||
%X hex number using upper case letters
|
%X hex number using upper case letters
|
||||||
@@ -4895,20 +5018,19 @@ printf({fmt}, {expr1} ...) *printf()*
|
|||||||
|
|
||||||
The conversion specifiers and their meanings are:
|
The conversion specifiers and their meanings are:
|
||||||
|
|
||||||
*printf-d* *printf-o* *printf-x* *printf-X*
|
*printf-d* *printf-b* *printf-B* *printf-o* *printf-x* *printf-X*
|
||||||
doxX The Number argument is converted to signed decimal
|
dbBoxX The Number argument is converted to signed decimal (d),
|
||||||
(d), unsigned octal (o), or unsigned hexadecimal (x
|
unsigned binary (b and B), unsigned octal (o), or
|
||||||
and X) notation. The letters "abcdef" are used for
|
unsigned hexadecimal (x and X) notation. The letters
|
||||||
x conversions; the letters "ABCDEF" are used for X
|
"abcdef" are used for x conversions; the letters
|
||||||
conversions.
|
"ABCDEF" are used for X conversions. The precision, if
|
||||||
The precision, if any, gives the minimum number of
|
any, gives the minimum number of digits that must
|
||||||
digits that must appear; if the converted value
|
appear; if the converted value requires fewer digits, it
|
||||||
requires fewer digits, it is padded on the left with
|
is padded on the left with zeros. In no case does a
|
||||||
zeros.
|
non-existent or small field width cause truncation of a
|
||||||
In no case does a non-existent or small field width
|
numeric field; if the result of a conversion is wider
|
||||||
cause truncation of a numeric field; if the result of
|
than the field width, the field is expanded to contain
|
||||||
a conversion is wider than the field width, the field
|
the conversion result.
|
||||||
is expanded to contain the conversion result.
|
|
||||||
|
|
||||||
*printf-c*
|
*printf-c*
|
||||||
c The Number argument is converted to a byte, and the
|
c The Number argument is converted to a byte, and the
|
||||||
@@ -4918,6 +5040,7 @@ printf({fmt}, {expr1} ...) *printf()*
|
|||||||
s The text of the String argument is used. If a
|
s The text of the String argument is used. If a
|
||||||
precision is specified, no more bytes than the number
|
precision is specified, no more bytes than the number
|
||||||
specified are used.
|
specified are used.
|
||||||
|
*printf-S*
|
||||||
S The text of the String argument is used. If a
|
S The text of the String argument is used. If a
|
||||||
precision is specified, no more display cells than the
|
precision is specified, no more display cells than the
|
||||||
number specified are used. Without the |+multi_byte|
|
number specified are used. Without the |+multi_byte|
|
||||||
@@ -4979,7 +5102,7 @@ py3eval({expr}) *py3eval()*
|
|||||||
Evaluate Python expression {expr} and return its result
|
Evaluate Python expression {expr} and return its result
|
||||||
converted to Vim data structures.
|
converted to Vim data structures.
|
||||||
Numbers and strings are returned as they are (strings are
|
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').
|
'encoding').
|
||||||
Lists are represented as Vim |List| type.
|
Lists are represented as Vim |List| type.
|
||||||
Dictionaries are represented as Vim |Dictionary| type with
|
Dictionaries are represented as Vim |Dictionary| type with
|
||||||
@@ -5106,8 +5229,7 @@ remote_foreground({server}) *remote_foreground()*
|
|||||||
Note: This does not restore the window if it was minimized,
|
Note: This does not restore the window if it was minimized,
|
||||||
like foreground() does.
|
like foreground() does.
|
||||||
This function is not available in the |sandbox|.
|
This function is not available in the |sandbox|.
|
||||||
{only in the Win32, Athena, Motif and GTK GUI versions and the
|
{only in the Win32 GUI and the Win32 console version}
|
||||||
Win32 console version}
|
|
||||||
|
|
||||||
|
|
||||||
remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
remote_peek({serverid} [, {retvar}]) *remote_peek()*
|
||||||
@@ -5783,12 +5905,12 @@ setwinvar({nr}, {varname}, {val}) *setwinvar()*
|
|||||||
:call setwinvar(2, "myvar", "foobar")
|
:call setwinvar(2, "myvar", "foobar")
|
||||||
|
|
||||||
sha256({string}) *sha256()*
|
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}.
|
checksum of {string}.
|
||||||
|
|
||||||
shellescape({string} [, {special}]) *shellescape()*
|
shellescape({string} [, {special}]) *shellescape()*
|
||||||
Escape {string} for use as a shell command argument.
|
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
|
will enclose {string} in double quotes and double all double
|
||||||
quotes within {string}.
|
quotes within {string}.
|
||||||
For other systems, it will enclose {string} in single quotes
|
For other systems, it will enclose {string} in single quotes
|
||||||
@@ -6024,12 +6146,14 @@ str2float( {expr}) *str2float()*
|
|||||||
|
|
||||||
str2nr( {expr} [, {base}]) *str2nr()*
|
str2nr( {expr} [, {base}]) *str2nr()*
|
||||||
Convert string {expr} to a number.
|
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
|
When {base} is omitted base 10 is used. This also means that
|
||||||
a leading zero doesn't cause octal conversion to be used, as
|
a leading zero doesn't cause octal conversion to be used, as
|
||||||
with the default String to Number conversion.
|
with the default String to Number conversion.
|
||||||
When {base} is 16 a leading "0x" or "0X" is ignored. With a
|
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.
|
Text after the number is silently ignored.
|
||||||
|
|
||||||
|
|
||||||
@@ -6640,6 +6764,10 @@ virtcol({expr}) *virtcol()*
|
|||||||
plus one)
|
plus one)
|
||||||
'x position of mark x (if the mark is not set, 0 is
|
'x position of mark x (if the mark is not set, 0 is
|
||||||
returned)
|
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.
|
Note that only marks in the current file can be used.
|
||||||
Examples: >
|
Examples: >
|
||||||
virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
|
virtcol(".") with text "foo^Lbar", with cursor on the "^L", returns 5
|
||||||
@@ -6852,8 +6980,6 @@ There are four types of features:
|
|||||||
acl Compiled with |ACL| support.
|
acl Compiled with |ACL| support.
|
||||||
arabic Compiled with Arabic support |Arabic|.
|
arabic Compiled with Arabic support |Arabic|.
|
||||||
autocmd Compiled with autocommand support. |autocommand|
|
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
|
browse Compiled with |:browse| support, and browse() will
|
||||||
work.
|
work.
|
||||||
browsefilter Compiled with support for |browsefilter|.
|
browsefilter Compiled with support for |browsefilter|.
|
||||||
@@ -6871,7 +6997,6 @@ debug Compiled with "DEBUG" defined.
|
|||||||
dialog_con Compiled with console dialog support.
|
dialog_con Compiled with console dialog support.
|
||||||
dialog_gui Compiled with GUI dialog support.
|
dialog_gui Compiled with GUI dialog support.
|
||||||
digraphs Compiled with support for digraphs.
|
digraphs Compiled with support for digraphs.
|
||||||
dnd Compiled with support for the "~ register |quote_~|.
|
|
||||||
eval Compiled with expression evaluation support. Always
|
eval Compiled with expression evaluation support. Always
|
||||||
true, of course!
|
true, of course!
|
||||||
ex_extra Compiled with extra Ex commands |+ex_extra|.
|
ex_extra Compiled with extra Ex commands |+ex_extra|.
|
||||||
@@ -6884,21 +7009,13 @@ filterpipe When 'shelltemp' is off pipes are used for shell
|
|||||||
find_in_path Compiled with support for include file searches
|
find_in_path Compiled with support for include file searches
|
||||||
|+find_in_path|.
|
|+find_in_path|.
|
||||||
float Compiled with support for |Float|.
|
float Compiled with support for |Float|.
|
||||||
fname_case Case in file names matters (for MS-DOS and Windows
|
fname_case Case in file names matters (for Windows this is not
|
||||||
this is not present).
|
present).
|
||||||
folding Compiled with |folding| support.
|
folding Compiled with |folding| support.
|
||||||
footer Compiled with GUI footer support. |gui-footer|
|
|
||||||
gettext Compiled with message translation |multi-lang|
|
gettext Compiled with message translation |multi-lang|
|
||||||
gui Compiled with GUI enabled.
|
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_running Vim is running in the GUI, or it will start soon.
|
||||||
gui_win32 Compiled with MS Windows Win32 GUI.
|
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.
|
iconv Can use iconv() for conversion.
|
||||||
insert_expand Compiled with support for CTRL-X expansion commands in
|
insert_expand Compiled with support for CTRL-X expansion commands in
|
||||||
Insert mode.
|
Insert mode.
|
||||||
@@ -6946,6 +7063,7 @@ statusline Compiled with support for 'statusline', 'rulerformat'
|
|||||||
syntax Compiled with syntax highlighting support |syntax|.
|
syntax Compiled with syntax highlighting support |syntax|.
|
||||||
syntax_items There are active syntax highlighting items for the
|
syntax_items There are active syntax highlighting items for the
|
||||||
current buffer.
|
current buffer.
|
||||||
|
tablineat 'tabline' option accepts %@Func@ items.
|
||||||
tag_binary Compiled with binary searching in tags files
|
tag_binary Compiled with binary searching in tags files
|
||||||
|tag-binary-search|.
|
|tag-binary-search|.
|
||||||
tag_old_static Compiled with support for old static tags
|
tag_old_static Compiled with support for old static tags
|
||||||
@@ -6970,10 +7088,9 @@ visualextra Compiled with extra Visual mode commands.
|
|||||||
vreplace Compiled with |gR| and |gr| commands.
|
vreplace Compiled with |gR| and |gr| commands.
|
||||||
wildignore Compiled with 'wildignore' option.
|
wildignore Compiled with 'wildignore' option.
|
||||||
wildmenu Compiled with 'wildmenu' option.
|
wildmenu Compiled with 'wildmenu' option.
|
||||||
win32 Win32 version of Vim (MS-Windows 95 and later, 32 or
|
win32 Windows version of Vim (32 or 64 bit).
|
||||||
64 bits)
|
win32unix Windows version of Vim, using Unix files (Cygwin).
|
||||||
win32unix Win32 version of Vim, using Unix files (Cygwin)
|
win64 Windows version of Vim (64 bit).
|
||||||
win64 Win64 version of Vim (MS-Windows 64 bit).
|
|
||||||
winaltkeys Compiled with 'winaltkeys' option.
|
winaltkeys Compiled with 'winaltkeys' option.
|
||||||
windows Compiled with support for more than one window.
|
windows Compiled with support for more than one window.
|
||||||
writebackup Compiled with 'writebackup' default on.
|
writebackup Compiled with 'writebackup' default on.
|
||||||
@@ -7542,7 +7659,7 @@ This does NOT work: >
|
|||||||
:unlet v
|
:unlet v
|
||||||
< *E741*
|
< *E741*
|
||||||
If you try to change a locked variable you get an
|
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
|
[depth] is relevant when locking a |List| or
|
||||||
|Dictionary|. It specifies how deep the locking goes:
|
|Dictionary|. It specifies how deep the locking goes:
|
||||||
@@ -8459,7 +8576,7 @@ You can catch all Vim errors by the pattern >
|
|||||||
*catch-text*
|
*catch-text*
|
||||||
NOTE: You should never catch the error message text itself: >
|
NOTE: You should never catch the error message text itself: >
|
||||||
:catch /No such variable/
|
: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
|
a different language by the |:language| command. It is however helpful to
|
||||||
cite the message text in a comment: >
|
cite the message text in a comment: >
|
||||||
:catch /^Vim(\a\+):E108:/ " No such variable
|
: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
|
right-to-left mode, this function is also supported only in right-to-left
|
||||||
mode.
|
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
|
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.
|
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
|
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
|
o Keyboard
|
||||||
@@ -215,7 +161,7 @@ o Keyboard
|
|||||||
Note:
|
Note:
|
||||||
<09> stands for Farsi PSP (break without space)
|
<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
|
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|.
|
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*
|
SQL *ft-sql*
|
||||||
|
|
||||||
Since the text for this plugin is rather long it has been put in a separate
|
Since the text for this plugin is rather long it has been put in a separate
|
||||||
|
@@ -362,7 +362,7 @@ zX Undo manually opened and closed folds: re-apply 'foldlevel'.
|
|||||||
Also forces recomputing folds, like |zx|.
|
Also forces recomputing folds, like |zx|.
|
||||||
|
|
||||||
*zm*
|
*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.
|
already zero nothing happens.
|
||||||
'foldenable' will be set.
|
'foldenable' will be set.
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ zM Close all folds: set 'foldlevel' to 0.
|
|||||||
'foldenable' will be set.
|
'foldenable' will be set.
|
||||||
|
|
||||||
*zr*
|
*zr*
|
||||||
zr Reduce folding: Add one to 'foldlevel'.
|
zr Reduce folding: Add |v:count1| to 'foldlevel'.
|
||||||
|
|
||||||
*zR*
|
*zR*
|
||||||
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
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).
|
~/.config).
|
||||||
The name of the first file found is stored in $MYGVIMRC, unless it was
|
The name of the first file found is stored in $MYGVIMRC, unless it was
|
||||||
already set.
|
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
|
NOTE: All but the first one are not carried out if Vim was started with
|
||||||
"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
|
"-u NONE" 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
|
include the 'h' flag in 'guioptions'. Then the scrolling is limited by the
|
||||||
text of the current cursor line.
|
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*
|
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.
|
When no or zero priority is given, 500 is used.
|
||||||
The priority for the PopUp menu is not 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,
|
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
|
but that is non-standard and is discouraged. The highest possible priority is
|
||||||
about 32000. The lowest is 1.
|
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
|
toolbar button image. Note that the exact filename is OS-specific: For
|
||||||
example, under Win32 the command >
|
example, under Win32 the command >
|
||||||
:amenu ToolBar.Hello :echo "hello"<CR>
|
:amenu ToolBar.Hello :echo "hello"<CR>
|
||||||
< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With
|
< would find the file 'hello.bmp'. Under X11 it is 'Hello.xpm'.
|
||||||
GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for
|
For MS-Windows and the bitmap is scaled to fit the button. 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
|
|
||||||
MS-Windows a size of 18 by 18 pixels works best.
|
MS-Windows a size of 18 by 18 pixels works best.
|
||||||
For MS-Windows the bitmap should have 16 colors with the standard palette.
|
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
|
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
|
30 WinMinWidth make current window use few columns
|
||||||
|
|
||||||
*hidden-menus* *win32-hidden-menus*
|
*hidden-menus* *win32-hidden-menus*
|
||||||
In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
|
In the Win32 GUI, starting a menu name with ']' excludes that menu from the
|
||||||
from the main menu bar. You must then use the |:popup| command to display it.
|
main menu bar. You must then use the |:popup| command to display it.
|
||||||
|
|
||||||
*popup-menu*
|
*popup-menu*
|
||||||
You can define the special menu "PopUp". This is the menu that is displayed
|
You can define the special menu "PopUp". This is the menu that is displayed
|
||||||
@@ -887,9 +865,8 @@ a menu item - you don't need to do a :tunmenu as well.
|
|||||||
|
|
||||||
5.9 Popup Menus
|
5.9 Popup Menus
|
||||||
|
|
||||||
In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor.
|
In the Win32 GUI, you can cause a menu to popup at the cursor. This behaves
|
||||||
This behaves similarly to the PopUp menus except that any menu tree can
|
similarly to the PopUp menus except that any menu tree can be popped up.
|
||||||
be popped up.
|
|
||||||
|
|
||||||
This command is for backwards compatibility, using it is discouraged, because
|
This command is for backwards compatibility, using it is discouraged, because
|
||||||
it behaves in a strange way.
|
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
|
:popu[p] {name} Popup the menu {name}. The menu named must
|
||||||
have at least one subentry, but need not
|
have at least one subentry, but need not
|
||||||
appear on the menu-bar (see |hidden-menus|).
|
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
|
:popu[p]! {name} Like above, but use the position of the mouse
|
||||||
pointer instead of the cursor.
|
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: >
|
vimrc or gvimrc file: >
|
||||||
au GUIEnter * simalt ~x
|
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*
|
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:
|
You can also install Vim in the "Send To" menu:
|
||||||
1. Start a Windows Explorer
|
1. Start a Windows Explorer
|
||||||
2. Navigate to your sendto directory:
|
2. Navigate to your sendto directory:
|
||||||
Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
|
|
||||||
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
||||||
"c:\winnt\profiles\mattha\sendto").
|
"c:\winnt\profiles\mattha\sendto").
|
||||||
3. Right-click in the file pane and select New->Shortcut
|
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
|
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.
|
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*
|
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!
|
question if you really want to kill the application, Vim may be killed too!
|
||||||
(This does not apply to commands run asynchronously with ":!start".)
|
(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*
|
*win32-!start*
|
||||||
Normally, Vim waits for a command to complete before continuing (this makes
|
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
|
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}
|
:!start [/min] {command}
|
||||||
The optional "/min" causes the window to be minimized.
|
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*
|
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
|
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
|
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
|
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_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
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
|
VIM - main help file
|
||||||
k
|
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>
|
Command-line editing c_ :help c_<Del>
|
||||||
Vim command argument - :help -r
|
Vim command argument - :help -r
|
||||||
Option ' :help 'textwidth'
|
Option ' :help 'textwidth'
|
||||||
|
Regular expression / :help /[
|
||||||
Search for help: Type ":help word", then hit CTRL-D to see matching
|
Search for help: Type ":help word", then hit CTRL-D to see matching
|
||||||
help entries for "word".
|
help entries for "word".
|
||||||
Or use ":helpgrep word". |:helpgrep|
|
Or use ":helpgrep word". |:helpgrep|
|
||||||
@@ -94,7 +95,6 @@ General subjects ~
|
|||||||
|tips.txt| various tips on using Vim
|
|tips.txt| various tips on using Vim
|
||||||
|message.txt| (error) messages and explanations
|
|message.txt| (error) messages and explanations
|
||||||
|quotes.txt| remarks from users of Vim
|
|quotes.txt| remarks from users of Vim
|
||||||
|todo.txt| known problems and desired extensions
|
|
||||||
|develop.txt| development of Vim
|
|develop.txt| development of Vim
|
||||||
|debug.txt| debugging Vim itself
|
|debug.txt| debugging Vim itself
|
||||||
|uganda.txt| Vim distribution conditions and what to do with your money
|
|uganda.txt| Vim distribution conditions and what to do with your money
|
||||||
@@ -160,11 +160,9 @@ Versions ~
|
|||||||
|vi_diff.txt| Main differences between Vim and Vi
|
|vi_diff.txt| Main differences between Vim and Vi
|
||||||
*sys-file-list*
|
*sys-file-list*
|
||||||
Remarks about specific systems ~
|
Remarks about specific systems ~
|
||||||
|os_mac.txt| Macintosh
|
|
||||||
|os_win32.txt| MS-Windows
|
|os_win32.txt| MS-Windows
|
||||||
*standard-plugin-list*
|
*standard-plugin-list*
|
||||||
Standard plugins ~
|
Standard plugins ~
|
||||||
|pi_getscript.txt| Downloading latest version of Vim scripts
|
|
||||||
|pi_gzip.txt| Reading and writing compressed files
|
|pi_gzip.txt| Reading and writing compressed files
|
||||||
|pi_netrw.txt| Reading and writing files over a network
|
|pi_netrw.txt| Reading and writing files over a network
|
||||||
|pi_paren.txt| Highlight matching parens
|
|pi_paren.txt| Highlight matching parens
|
||||||
|
@@ -184,12 +184,6 @@ command: >
|
|||||||
:!xterm -e vim +help &
|
:!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*
|
*:helpt* *:helptags*
|
||||||
*E154* *E150* *E151* *E152* *E153* *E670*
|
*E154* *E150* *E151* *E152* *E153* *E670*
|
||||||
:helpt[ags] [++t] {dir}
|
: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
|
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
|
||||||
|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 "\>"
|
|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
|
|g0| g0 1 when 'wrap' off go to leftmost character of
|
||||||
the current line that is on the screen;
|
the current line that is on the screen;
|
||||||
when 'wrap' on go to the leftmost character
|
when 'wrap' on go to the leftmost character
|
||||||
of the current screen line
|
of the current screen line
|
||||||
|g8| g8 print hex value of bytes used in UTF-8
|
|g8| g8 print hex value of bytes used in UTF-8
|
||||||
character under the cursor
|
character under the cursor
|
||||||
|
|g;| g; 1 go to N older position in change list
|
||||||
|g<| g< display previous command output
|
|g<| g< display previous command output
|
||||||
|g?| g? 2 Rot13 encoding operator
|
|g?| g? 2 Rot13 encoding operator
|
||||||
|g?g?| g?? 2 Rot13 encode current line
|
|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
|
the screen; when 'wrap' on go to the
|
||||||
leftmost non-white character of the current
|
leftmost non-white character of the current
|
||||||
screen line
|
screen line
|
||||||
|
|g_| g_ 1 cursor to the last CHAR N - 1 lines lower
|
||||||
|ga| ga print ascii value of character under the
|
|ga| ga print ascii value of character under the
|
||||||
cursor
|
cursor
|
||||||
|gd| gd 1 go to definition of word 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
|
|:cc| :cc go to specific error
|
||||||
|:cclose| :ccl[ose] close quickfix window
|
|:cclose| :ccl[ose] close quickfix window
|
||||||
|:cd| :cd change directory
|
|: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
|
|:center| :ce[nter] format lines at the center
|
||||||
|:cexpr| :cex[pr] read errors from expr and jump to first
|
|:cexpr| :cex[pr] read errors from expr and jump to first
|
||||||
|:cfile| :cf[ile] read file with error messages 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
|
|:hardcopy| :ha[rdcopy] send text to the printer
|
||||||
|:help| :h[elp] open a help window
|
|:help| :h[elp] open a help window
|
||||||
|:helpclose| :helpc[lose] close one 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
|
|:helpgrep| :helpg[rep] like ":grep" but searches help files
|
||||||
|:helptags| :helpt[ags] generate help tags for a directory
|
|:helptags| :helpt[ags] generate help tags for a directory
|
||||||
|:highlight| :hi[ghlight] specify highlighting methods
|
|:highlight| :hi[ghlight] specify highlighting methods
|
||||||
@@ -1285,6 +1291,8 @@ tag command action ~
|
|||||||
|:lchdir| :lch[dir] change directory locally
|
|:lchdir| :lch[dir] change directory locally
|
||||||
|:lclose| :lcl[ose] close location window
|
|:lclose| :lcl[ose] close location window
|
||||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||||
|
|:ldo| :ld[o] execute command in valid location list entries
|
||||||
|
|:lfdo| :lfd[o] execute command in each file in location list
|
||||||
|:left| :le[ft] left align lines
|
|:left| :le[ft] left align lines
|
||||||
|:leftabove| :lefta[bove] make split window appear left or above
|
|:leftabove| :lefta[bove] make split window appear left or above
|
||||||
|:let| :let assign a value to a variable or option
|
|: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
|
|:number| :nu[mber] print lines with line number
|
||||||
|:nunmap| :nun[map] like ":unmap" but for Normal mode
|
|:nunmap| :nun[map] like ":unmap" but for Normal mode
|
||||||
|:nunmenu| :nunme[nu] remove menu for Normal mode
|
|:nunmenu| :nunme[nu] remove menu for Normal mode
|
||||||
|:oldfiles| :ol[dfiles] list files that have marks in the ShaDa file
|
|:oldfiles| :o[ldfiles] list files that have marks in the ShaDa file
|
||||||
|:open| :o[pen] start open mode (not implemented)
|
|
||||||
|:omap| :om[ap] like ":map" but for Operator-pending mode
|
|:omap| :om[ap] like ":map" but for Operator-pending mode
|
||||||
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|
||||||
|:omenu| :ome[nu] add menu 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 May 22
|
||||||
|
|
||||||
|
|
||||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
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",
|
joining lines). See the section "word motions",
|
||||||
|word-motions|, for the definition of a word.
|
|word-motions|, for the definition of a word.
|
||||||
*i_CTRL-U*
|
*i_CTRL-U*
|
||||||
CTRL-U Delete all entered characters in the current line (see
|
CTRL-U Delete all entered characters before the cursor in the current
|
||||||
|i_backspacing| about joining lines).
|
line. If there are no newly entereed 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*
|
*i_CTRL-I* *i_<Tab>* *i_Tab*
|
||||||
<Tab> or CTRL-I Insert a tab. If the 'expandtab' option is on, the
|
<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
|
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.
|
changed, the detected format is only used while reading the file.
|
||||||
A similar thing happens with 'fileencodings'.
|
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.
|
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.
|
a file is read in Unix format.
|
||||||
On non-Macintosh systems, the message "[Mac format]" is shown if a file is
|
On non-Macintosh systems, the message "[Mac format]" is shown if a file is
|
||||||
read in Mac format.
|
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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -131,7 +131,7 @@ http://www.vim.org/maillist.php
|
|||||||
|
|
||||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
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
|
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,
|
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).
|
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
|
lots of patches
|
||||||
Ingo Wilken Tcl interface
|
Ingo Wilken Tcl interface
|
||||||
Mike Williams PostScript printing
|
Mike Williams PostScript printing
|
||||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
Juergen Weigert Lattice version, AUX improvements, Unix and
|
||||||
MS-DOS ports, autoconf
|
MS-DOS ports, autoconf
|
||||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||||
|
|
||||||
|
@@ -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
|
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.
|
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
|
LOCALE
|
||||||
|
|
||||||
First of all, you must make sure your current locale is set correctly. If
|
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
|
a few other things. See the chapters on fonts: |mbyte-fonts-X11| for
|
||||||
X-Windows and |mbyte-fonts-MSwin| for MS-Windows.
|
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
|
For X11 you can set the 'guifontset' option to a list of fonts that together
|
||||||
cover the characters that are used. Example for Korean: >
|
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
|
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...
|
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
|
First of all, Vim only accepts fixed-width fonts for displaying text. You
|
||||||
cannot use proportionally spaced fonts. This excludes many of the available
|
cannot use proportionally spaced fonts. This excludes many of the available
|
||||||
(and nicer looking) fonts. However, for menus and tooltips any font can be
|
(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
|
Also make sure that you set 'guifontset' before setting fonts for highlight
|
||||||
groups.
|
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*
|
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"
|
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*
|
8. Input on MS-Windows *mbyte-IME*
|
||||||
|
|
||||||
@@ -893,14 +810,11 @@ WHAT IS IME
|
|||||||
URL.
|
URL.
|
||||||
|
|
||||||
WHAT IS GLOBAL IME *global-ime*
|
WHAT IS GLOBAL IME *global-ime*
|
||||||
Global IME makes capability to input Chinese, Japanese, and Korean text
|
Global IME enables input of Chinese, Japanese, and Korean text into Vim
|
||||||
into Vim buffer on any language version of Windows 98, Windows 95, and
|
buffer on any language version of Windows. Global IME is built in, and
|
||||||
Windows NT 4.0.
|
the Input Locales can be added through Control Panel/Regional
|
||||||
On Windows 2000 and XP it should work as well (without downloading). On
|
Options/Input Locales. Please see below URL for detail of Global IME.
|
||||||
Windows 2000 Professional, Global IME is built in, and the Input Locales
|
You can also find various language version of Global IME at same place.
|
||||||
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.
|
- Global IME detailed information.
|
||||||
http://search.microsoft.com/results.aspx?q=global+ime
|
http://search.microsoft.com/results.aspx?q=global+ime
|
||||||
@@ -1201,14 +1115,12 @@ internally.
|
|||||||
|
|
||||||
Vim has comprehensive UTF-8 support. It works well in:
|
Vim has comprehensive UTF-8 support. It works well in:
|
||||||
- xterm with utf-8 support enabled
|
- xterm with utf-8 support enabled
|
||||||
- Athena, Motif and GTK GUI
|
|
||||||
- MS-Windows GUI
|
- MS-Windows GUI
|
||||||
- several other platforms
|
- several other platforms
|
||||||
|
|
||||||
Double-width characters are supported. This works best with 'guifontwide' or
|
Double-width characters are supported. This works best with 'guifontwide' or
|
||||||
'guifontset'. When using only 'guifont' the wide characters are drawn in the
|
'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
|
normal width and a space to fill the gap.
|
||||||
is no longer relevant in the GTK+ 2 GUI.
|
|
||||||
|
|
||||||
*bom-bytes*
|
*bom-bytes*
|
||||||
When reading a file a BOM (Byte Order Mark) can be used to recognize the
|
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*
|
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
|
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
|
font is required, which is exactly twice as wide. There are three ways to do
|
||||||
this:
|
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:
|
existing abbreviation. All variations of this command give the same message:
|
||||||
":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
|
":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* >
|
*E31* >
|
||||||
No such mapping
|
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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -171,6 +171,8 @@ CTRL-H or *CTRL-H* *<BS>*
|
|||||||
l or *l*
|
l or *l*
|
||||||
<Right> or *<Right>* *<Space>*
|
<Right> or *<Right>* *<Space>*
|
||||||
<Space> [count] characters to the right. |exclusive| motion.
|
<Space> [count] characters to the right. |exclusive| motion.
|
||||||
|
See the 'whichwrap' option for adjusting the behavior
|
||||||
|
at end of line
|
||||||
|
|
||||||
*0*
|
*0*
|
||||||
0 To the first character of the line. |exclusive|
|
0 To the first character of the line. |exclusive|
|
||||||
|
@@ -26,7 +26,7 @@ are now decoupled from Nvim core as providers:
|
|||||||
|
|
||||||
The first example is clipboard integration: in the original Vim source code,
|
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
|
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.
|
simple shell commands such as xclip or pbcopy/pbpaste.
|
||||||
|
|
||||||
The other example is Python scripting support: Vim has three files dedicated to
|
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
|
$ 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*
|
*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
|
is why it needs to be done with the |TermOpen| autocmd or setting global
|
||||||
variables before the terminal is started.
|
variables before the terminal is started.
|
||||||
|
|
||||||
|
There is also a corresponding |TermClose| event.
|
||||||
|
|
||||||
The terminal cursor can be highlighted via |hl-TermCursor| and
|
The terminal cursor can be highlighted via |hl-TermCursor| and
|
||||||
|hl-TermCursorNC|.
|
|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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -183,7 +183,7 @@ the option value, use '\"' instead. This example sets the 'titlestring'
|
|||||||
option to 'hi "there"': >
|
option to 'hi "there"': >
|
||||||
:set titlestring=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
|
precise: For options that expect a file name (those where environment
|
||||||
variables are expanded) a backslash before a normal file name character is not
|
variables are expanded) a backslash before a normal file name character is not
|
||||||
removed. But a backslash before a special character (space, backslash, comma,
|
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 before {vers}
|
||||||
vim={vers}: version {vers}
|
vim={vers}: version {vers}
|
||||||
vim>{vers}: version after {vers}
|
vim>{vers}: version after {vers}
|
||||||
{vers} is 600 for Vim 6.0 (hundred times the major version plus minor).
|
{vers} is 700 for Vim 7.0 (hundred times the major version plus minor).
|
||||||
For example, to use a modeline only for Vim 6.0 and later:
|
For example, to use a modeline only for Vim 7.0:
|
||||||
/* vim600: set foldmethod=marker: */ ~
|
/* vim700: set foldmethod=marker */ ~
|
||||||
To use a modeline for Vim before version 5.7:
|
To use a modeline for Vim after version 7.2:
|
||||||
/* vim<570: set sw=4: */ ~
|
/* vim>702: set cole=2: */ ~
|
||||||
There can be no blanks between "vim" and the ":".
|
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.),
|
(or Vim is run inside an xterm invoked with "-cjkwidth" option.),
|
||||||
this option should be set to "double" to match the width perceived
|
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
|
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
|
to be set to "double" under CJK Windows XP when the system locale is
|
||||||
when the system locale is set to one of CJK locales. See Unicode
|
set to one of CJK locales.
|
||||||
Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
See Unicode Standard Annex #11 (http://www.unicode.org/reports/tr11).
|
||||||
|
|
||||||
Vim may set this option automatically at startup time when Vim is
|
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
|
compiled with the |+termresponse| feature and if |t_u7| is set to the
|
||||||
escape sequence to request cursor position report.
|
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'* *'noautochdir'* *'noacd'*
|
||||||
'autochdir' 'acd' boolean (default off)
|
'autochdir' 'acd' boolean (default off)
|
||||||
global
|
global
|
||||||
@@ -783,14 +772,14 @@ 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
|
putting a ":gui" command in the gvimrc file, before where the value
|
||||||
of 'background' is used (e.g., before ":syntax on").
|
of 'background' is used (e.g., before ":syntax on").
|
||||||
|
|
||||||
For MS-DOS and Windows the default is "dark".
|
For Windows the default is "dark".
|
||||||
For other systems "dark" is used when 'term' is "linux",
|
For other systems "dark" is used when 'term' is "linux",
|
||||||
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
|
"screen.linux", "cygwin" or "putty", or $COLORFGBG suggests a dark
|
||||||
background. Otherwise the default is "light".
|
background. Otherwise the default is "light".
|
||||||
|
|
||||||
Normally this option would be set in the vimrc file. Possibly
|
Normally this option would be set in the vimrc file. Possibly
|
||||||
depending on the terminal name. Example: >
|
depending on the terminal name. Example: >
|
||||||
:if &term == "pcterm"
|
:if &term == "xterm"
|
||||||
: set background=dark
|
: set background=dark
|
||||||
:endif
|
:endif
|
||||||
< When this option is set, the default settings for the highlight groups
|
< When this option is set, the default settings for the highlight groups
|
||||||
@@ -911,7 +900,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
impossible!). Writing may fail because of this.
|
impossible!). Writing may fail because of this.
|
||||||
- A directory "." means to put the backup file in the same directory
|
- A directory "." means to put the backup file in the same directory
|
||||||
as the edited file.
|
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
|
put the backup file relative to where the edited file is. The
|
||||||
leading "." is replaced with the path name of the edited file.
|
leading "." is replaced with the path name of the edited file.
|
||||||
("." inside a directory name has no special meaning).
|
("." inside a directory name has no special meaning).
|
||||||
@@ -980,65 +969,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|.
|
the newly created file). Also see 'backupcopy' and |crontab|.
|
||||||
|
|
||||||
*'balloondelay'* *'bdlay'*
|
*'balloondelay'* *'bdlay'*
|
||||||
'balloondelay' 'bdlay' number (default: 600)
|
'balloondelay' 'bdlay' Removed. {Nvim}
|
||||||
global
|
|
||||||
{only available when compiled with the |+balloon_eval|
|
|
||||||
feature}
|
|
||||||
Delay in milliseconds before a balloon may pop up. See |balloon-eval|.
|
|
||||||
|
|
||||||
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
|
*'ballooneval'* *'beval'* *'noballooneval'* *'nobeval'*
|
||||||
'ballooneval' 'beval' boolean (default off)
|
'ballooneval' 'beval' Removed. {Nvim}
|
||||||
global
|
|
||||||
{only available when compiled with the |+balloon_eval|
|
|
||||||
feature}
|
|
||||||
Switch on the |balloon-eval| functionality.
|
|
||||||
|
|
||||||
*'balloonexpr'* *'bexpr'*
|
*'balloonexpr'* *'bexpr'*
|
||||||
'balloonexpr' 'bexpr' string (default "")
|
'balloonexpr' 'bexpr' Removed. {Nvim}
|
||||||
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.
|
|
||||||
|
|
||||||
*'belloff'* *'bo'*
|
*'belloff'* *'bo'*
|
||||||
'belloff' 'bo' string (default "")
|
'belloff' 'bo' string (default "")
|
||||||
global
|
global
|
||||||
{not in Vi}
|
|
||||||
Specifies for which events the bell will not be rung. It is a comma
|
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
|
separated list of items. For each item that is present, the bell
|
||||||
will be silenced. This is most useful to specify specific events in
|
will be silenced. This is most useful to specify specific events in
|
||||||
@@ -1169,8 +1110,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'browsedir'* *'bsdir'*
|
*'browsedir'* *'bsdir'*
|
||||||
'browsedir' 'bsdir' string (default: "last")
|
'browsedir' 'bsdir' string (default: "last")
|
||||||
global
|
global
|
||||||
{only for Motif, Athena, GTK, Mac and
|
{only for Mac and Win32 GUI}
|
||||||
Win32 GUI}
|
|
||||||
Which directory to use for the file browser:
|
Which directory to use for the file browser:
|
||||||
last Use same directory as with last file browser, where a
|
last Use same directory as with last file browser, where a
|
||||||
file was opened or saved.
|
file was opened or saved.
|
||||||
@@ -1253,6 +1193,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
|
nofile only: The buffer name is fixed, it is not handled like a
|
||||||
file name. It is not modified in response to a |:cd|
|
file name. It is not modified in response to a |:cd|
|
||||||
command.
|
command.
|
||||||
|
both: When using ":e bufname" and already editing "bufname"
|
||||||
|
the buffer is made empty and autocommands are
|
||||||
|
triggered as usual for |:edit|.
|
||||||
*E676*
|
*E676*
|
||||||
"acwrite" implies that the buffer name is not related to a file, like
|
"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
|
"nofile", but it will be written. Thus, in contrast to "nofile" and
|
||||||
@@ -1538,14 +1481,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
|
(gzipped files for example). Unloaded buffers are not scanned for
|
||||||
whole-line completion.
|
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'-
|
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
|
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).
|
|i_CTRL-X_CTRL-I|, tags |i_CTRL-X_CTRL-]| and normal expansions).
|
||||||
@@ -1628,8 +1563,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
|
1 Each block of concealed text is replaced with one
|
||||||
character. If the syntax item does not have a custom
|
character. If the syntax item does not have a custom
|
||||||
replacement character defined (see |:syn-cchar|) the
|
replacement character defined (see |:syn-cchar|) the
|
||||||
character defined in 'listchars' is used (default is a
|
character defined in 'listchars' is used.
|
||||||
space).
|
|
||||||
It is highlighted with the "Conceal" highlight group.
|
It is highlighted with the "Conceal" highlight group.
|
||||||
2 Concealed text is completely hidden unless it has a
|
2 Concealed text is completely hidden unless it has a
|
||||||
custom replacement character defined (see
|
custom replacement character defined (see
|
||||||
@@ -2141,7 +2075,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
|
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"
|
it doesn't show in a directory listing. On MS-Windows the "hidden"
|
||||||
attribute is set and a dot prepended if possible.
|
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
|
put the swap file relative to where the edited file is. The leading
|
||||||
"." is replaced with the path name of the edited file.
|
"." is replaced with the path name of the edited file.
|
||||||
- For Unix and Win32, if a directory ends in two path separators "//"
|
- For Unix and Win32, if a directory ends in two path separators "//"
|
||||||
@@ -2197,7 +2131,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'edcompatible' 'ed' Removed. |vim-differences| {Nvim}
|
'edcompatible' 'ed' Removed. |vim-differences| {Nvim}
|
||||||
|
|
||||||
*'encoding'* *'enc'* *E543*
|
*'encoding'* *'enc'* *E543*
|
||||||
'encoding' 'enc' string (default: "utf-8" or value from $LANG)
|
'encoding' 'enc' string (default: "utf-8")
|
||||||
global
|
global
|
||||||
{only available when compiled with the |+multi_byte|
|
{only available when compiled with the |+multi_byte|
|
||||||
feature}
|
feature}
|
||||||
@@ -2219,10 +2153,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
can use: >
|
can use: >
|
||||||
if has("multi_byte_encoding")
|
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
|
When you set this option, it fires the |EncodingChanged| autocommand
|
||||||
event so that you can set up fonts if necessary.
|
event so that you can set up fonts if necessary.
|
||||||
|
|
||||||
@@ -2239,22 +2169,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
|
setting 'encoding' to one of these values instead of utf-8 only has
|
||||||
effect for encoding used for files when 'fileencoding' is empty.
|
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'* *'noendofline'* *'noeol'*
|
||||||
'endofline' 'eol' boolean (default on)
|
'endofline' 'eol' boolean (default on)
|
||||||
local to buffer
|
local to buffer
|
||||||
When writing a file and this option is off and the 'binary' option
|
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
|
is on, or 'fixeol' option is off, no <EOL> will be written for the
|
||||||
option is automatically set when starting to edit a new file, unless
|
last line in the file. This option is automatically set or reset when
|
||||||
the file does not have an <EOL> for the last line in the file, in
|
starting to edit a new file, depending on whether file has an <EOL>
|
||||||
which case it is reset. Normally you don't have to set or reset this
|
for the last line in the file. Normally you don't have to set or
|
||||||
option. When 'binary' is off the value is not used when writing the
|
reset this option.
|
||||||
file. When 'binary' is on it is used to remember the presence of a
|
When 'binary' is off and 'fixeol' is on the value is not used when
|
||||||
<EOL> for the last line in the file, so that when you write the file
|
writing the file. When 'binary' is on or 'fixeol' is off it is used
|
||||||
the situation from the original file can be kept. But you can change
|
to remember the presence of a <EOL> for the last line in the file, so
|
||||||
it if you want to.
|
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'* *'noequalalways'* *'noea'*
|
||||||
'equalalways' 'ea' boolean (default on)
|
'equalalways' 'ea' boolean (default on)
|
||||||
@@ -2350,13 +2278,13 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
*'exrc'* *'ex'* *'noexrc'* *'noex'*
|
||||||
'exrc' 'ex' boolean (default off)
|
'exrc' 'ex' boolean (default off)
|
||||||
global
|
global
|
||||||
Enables the reading of .nvimrc, .exrc and .ngvimrc in the current
|
Enables the reading of .nvimrc and .exrc in the current directory.
|
||||||
directory. If you switch this option on you should also consider
|
If you switch this option on you should also consider setting the
|
||||||
setting the 'secure' option (see |initialization|). Using a local
|
'secure' option (see |initialization|). Using this option comes
|
||||||
.exrc, .nvimrc or .ngvimrc is a potential security leak, use with care!
|
with a potential security risk, use with care!
|
||||||
also see |init.vim| and |gui-init|.
|
|
||||||
This option cannot be set from a |modeline| or in the |sandbox|, for
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
|
Also see |init.vim| and |gui-init|.
|
||||||
|
|
||||||
*'fileencoding'* *'fenc'* *E213*
|
*'fileencoding'* *'fenc'* *E213*
|
||||||
'fileencoding' 'fenc' string (default: "")
|
'fileencoding' 'fenc' string (default: "")
|
||||||
@@ -2411,9 +2339,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.
|
old short name was 'fe', which is no longer used.
|
||||||
|
|
||||||
*'fileencodings'* *'fencs'*
|
*'fileencodings'* *'fencs'*
|
||||||
'fileencodings' 'fencs' string (default: "ucs-bom",
|
'fileencodings' 'fencs' string (default: "ucs-bom,utf-8,default,latin1")
|
||||||
"ucs-bom,utf-8,default,latin1" when
|
|
||||||
'encoding' is set to a Unicode value)
|
|
||||||
global
|
global
|
||||||
{only available when compiled with the |+multi_byte|
|
{only available when compiled with the |+multi_byte|
|
||||||
feature}
|
feature}
|
||||||
@@ -2453,9 +2379,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
|
because Vim cannot detect an error, thus the encoding is always
|
||||||
accepted.
|
accepted.
|
||||||
The special value "default" can be used for the encoding from the
|
The special value "default" can be used for the encoding from the
|
||||||
environment. This is the default value for 'encoding'. It is useful
|
environment. It is useful when 'encoding' is set to "utf-8" and
|
||||||
when 'encoding' is set to "utf-8" and your environment uses a
|
your environment uses a non-latin1 encoding, such as Russian.
|
||||||
non-latin1 encoding, such as Russian.
|
|
||||||
When 'encoding' is "utf-8" and a file contains an illegal byte
|
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|
|
sequence it won't be recognized as UTF-8. You can use the |8g8|
|
||||||
command to find the illegal byte sequence.
|
command to find the illegal byte sequence.
|
||||||
@@ -2470,7 +2395,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
is read.
|
is read.
|
||||||
|
|
||||||
*'fileformat'* *'ff'*
|
*'fileformat'* *'ff'*
|
||||||
'fileformat' 'ff' string (MS-DOS and MS-Windows default: "dos",
|
'fileformat' 'ff' string (Windows default: "dos",
|
||||||
Unix default: "unix",
|
Unix default: "unix",
|
||||||
Macintosh default: "mac")
|
Macintosh default: "mac")
|
||||||
local to buffer
|
local to buffer
|
||||||
@@ -2514,8 +2439,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'
|
2. If a <NL> is found and 'fileformats' includes "unix", 'fileformat'
|
||||||
is set to "unix". Note that when a <NL> is found without a
|
is set to "unix". Note that when a <NL> is found without a
|
||||||
preceding <CR>, "unix" is preferred over "dos".
|
preceding <CR>, "unix" is preferred over "dos".
|
||||||
3. If 'fileformat' has not yet been set, and if 'fileformats'
|
3. If 'fileformat' has not yet been set, and if a <CR> is found, and
|
||||||
includes "mac", 'fileformat' is set to "mac".
|
if 'fileformats' includes "mac", 'fileformat' is set to "mac".
|
||||||
This means that "mac" is only chosen when:
|
This means that "mac" is only chosen when:
|
||||||
"unix" is not present or no <NL> is found in the file, and
|
"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.
|
"dos" is not present or no <CR><NL> is found in the file.
|
||||||
@@ -2609,6 +2534,17 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
fold:c Folded |hl-Folded|
|
fold:c Folded |hl-Folded|
|
||||||
diff:c DiffDelete |hl-DiffDelete|
|
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'* *'nofkmap'* *'nofk'*
|
||||||
'fkmap' 'fk' boolean (default off) *E198*
|
'fkmap' 'fk' boolean (default off) *E198*
|
||||||
global
|
global
|
||||||
@@ -2876,10 +2812,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
|
written even on filesystems which do metadata-only journaling. This
|
||||||
will force the harddrive to spin up on Linux systems running in laptop
|
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
|
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
|
turning this off increases the chances of data loss after a crash.
|
||||||
systems without an fsync() implementation, this variable is always
|
|
||||||
off.
|
|
||||||
Also see 'swapsync' for controlling fsync() on swap files.
|
|
||||||
|
|
||||||
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
|
*'gdefault'* *'gd'* *'nogdefault'* *'nogd'*
|
||||||
'gdefault' 'gd' boolean (default off)
|
'gdefault' 'gd' boolean (default off)
|
||||||
@@ -2932,14 +2865,14 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
r-cr:hor20-Cursor/lCursor,
|
r-cr:hor20-Cursor/lCursor,
|
||||||
sm:block-Cursor
|
sm:block-Cursor
|
||||||
-blinkwait175-blinkoff150-blinkon175",
|
-blinkwait175-blinkoff150-blinkon175",
|
||||||
for MS-DOS and Win32 console:
|
for Windows console:
|
||||||
"n-v-c:block,o:hor50,i-ci:hor15,
|
"n-v-c:block,o:hor50,i-ci:hor15,
|
||||||
r-cr:hor30,sm:block")
|
r-cr:hor30,sm:block")
|
||||||
global
|
global
|
||||||
{only available when compiled with GUI enabled, and
|
{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
|
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
|
the height of the cursor can be changed. This can be done by
|
||||||
specifying a block cursor, or a percentage for a vertical or
|
specifying a block cursor, or a percentage for a vertical or
|
||||||
horizontal cursor.
|
horizontal cursor.
|
||||||
@@ -3038,28 +2971,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
|
the case of X). The font names given should be "normal" fonts. Vim
|
||||||
will try to find the related bold and italic fonts.
|
will try to find the related bold and italic fonts.
|
||||||
|
|
||||||
For Win32, GTK, Motif, and Mac OS: >
|
For Win32 and Mac OS: >
|
||||||
:set guifont=*
|
:set guifont=*
|
||||||
< will bring up a font requester, where you can pick the font you want.
|
< 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
|
The font name depends on the GUI used. See |setting-guifont| for a
|
||||||
way to set 'guifont' for various systems.
|
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: >
|
For Mac OSX you can use something like this: >
|
||||||
:set guifont=Monaco:h10
|
:set guifont=Monaco:h10
|
||||||
< *E236*
|
< *E236*
|
||||||
Note that the fonts must be mono-spaced (all characters have the same
|
Note that the fonts must be mono-spaced (all characters have the same
|
||||||
width). An exception is GTK 2: all fonts are accepted, but
|
width).
|
||||||
mono-spaced fonts look best.
|
|
||||||
|
|
||||||
To preview a font on X11, you might be able to use the "xfontsel"
|
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.
|
program. The "xlsfonts" program gives a list of all available fonts.
|
||||||
@@ -3092,7 +3015,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
global
|
global
|
||||||
{only available when compiled with GUI enabled and
|
{only available when compiled with GUI enabled and
|
||||||
with the |+xfontset| feature}
|
with the |+xfontset| feature}
|
||||||
{not available in the GTK+ 2 GUI}
|
|
||||||
When not empty, specifies two (or more) fonts to be used. The first
|
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
|
one for normal English, the second one for your special language. See
|
||||||
|xfontset|.
|
|xfontset|.
|
||||||
@@ -3120,24 +3042,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
|
Note: The size of these fonts must be exactly twice as wide as the one
|
||||||
specified with 'guifont' and the same height.
|
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
|
'guifontwide' is only used when 'encoding' is set to "utf-8" and
|
||||||
'guifontset' is empty or invalid.
|
'guifontset' is empty or invalid.
|
||||||
When 'guifont' is set and a valid font is found in it and
|
When 'guifont' is set and a valid font is found in it and
|
||||||
'guifontwide' is empty Vim will attempt to find a matching
|
'guifontwide' is empty Vim will attempt to find a matching
|
||||||
double-width font and set 'guifontwide' to it.
|
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*
|
Windows +multibyte only: *guifontwide_win_mbyte*
|
||||||
|
|
||||||
If set and valid, 'guifontwide' is used for IME instead of 'guifont'.
|
If set and valid, 'guifontwide' is used for IME instead of 'guifont'.
|
||||||
@@ -3145,7 +3055,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'guiheadroom'* *'ghr'*
|
*'guiheadroom'* *'ghr'*
|
||||||
'guiheadroom' 'ghr' number (default 50)
|
'guiheadroom' 'ghr' number (default 50)
|
||||||
global
|
global
|
||||||
{only for GTK and X11 GUI}
|
{only for X11 GUI}
|
||||||
The number of pixels subtracted from the screen height when fitting
|
The number of pixels subtracted from the screen height when fitting
|
||||||
the GUI window on the screen. Set this before the GUI is started,
|
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
|
e.g., in your |gvimrc| file. When zero, the whole screen height will
|
||||||
@@ -3155,8 +3065,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
screen.
|
screen.
|
||||||
|
|
||||||
*'guioptions'* *'go'*
|
*'guioptions'* *'go'*
|
||||||
'guioptions' 'go' string (default "egmrLT" (MS-Windows),
|
'guioptions' 'go' string (default "egmrLT" (MS-Windows))
|
||||||
"aegimrLT" (GTK, Motif and Athena))
|
|
||||||
global
|
global
|
||||||
{only available when compiled with GUI enabled}
|
{only available when compiled with GUI enabled}
|
||||||
This option only has an effect in the GUI version of Vim. It is a
|
This option only has an effect in the GUI version of Vim. It is a
|
||||||
@@ -3202,10 +3111,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.
|
'guitablabel' can be used to change the text in the labels.
|
||||||
When 'e' is missing a non-GUI tab pages line may be used.
|
When 'e' is missing a non-GUI tab pages line may be used.
|
||||||
The GUI tabs are only supported on some systems, currently
|
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'*
|
*'go-i'*
|
||||||
'i' Use a Vim icon. For GTK with KDE it is used in the left-upper
|
'i' Use a Vim icon.
|
||||||
corner of the window.
|
|
||||||
*'go-m'*
|
*'go-m'*
|
||||||
'm' Menu bar is present.
|
'm' Menu bar is present.
|
||||||
*'go-M'*
|
*'go-M'*
|
||||||
@@ -3217,10 +3125,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'go-g'*
|
*'go-g'*
|
||||||
'g' Grey menu items: Make menu items that are not active grey. If
|
'g' Grey menu items: Make menu items that are not active grey. If
|
||||||
'g' is not included inactive menu items are not shown at all.
|
'g' is not included inactive menu items are not shown at all.
|
||||||
Exception: Athena will always use grey menu items.
|
|
||||||
*'go-T'*
|
*'go-T'*
|
||||||
'T' Include Toolbar. Currently only in Win32, GTK+, Motif,
|
'T' Include Toolbar. Currently only in Win32 GUI.
|
||||||
and Athena GUIs.
|
|
||||||
*'go-r'*
|
*'go-r'*
|
||||||
'r' Right-hand scrollbar is always present.
|
'r' Right-hand scrollbar is always present.
|
||||||
*'go-R'*
|
*'go-R'*
|
||||||
@@ -3252,8 +3158,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
|
the right moment, try adding this flag. This must be done
|
||||||
before starting the GUI. Set it in your |gvimrc|. Adding or
|
before starting the GUI. Set it in your |gvimrc|. Adding or
|
||||||
removing it after the GUI has started has no effect.
|
removing it after the GUI has started has no effect.
|
||||||
*'go-F'*
|
|
||||||
'F' Add a footer. Only for Motif. See |gui-footer|.
|
|
||||||
|
|
||||||
|
|
||||||
*'guipty'* *'noguipty'*
|
*'guipty'* *'noguipty'*
|
||||||
@@ -3506,54 +3410,10 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|/ignorecase|.
|
|/ignorecase|.
|
||||||
|
|
||||||
*'imactivatefunc'* *'imaf'*
|
*'imactivatefunc'* *'imaf'*
|
||||||
'imactivatefunc' 'imaf' string (default "")
|
'imactivatefunc' 'imaf' Removed. |vim-differences| {Nvim}
|
||||||
global
|
|
||||||
{only available when compiled with |+xim| and
|
|
||||||
|+GUI_GTK|}
|
|
||||||
This option specifies a function that will be called to
|
|
||||||
activate/inactivate Input Method.
|
|
||||||
|
|
||||||
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'*
|
||||||
'imactivatekey' 'imak' string (default "")
|
'imactivatekey' 'imak' Removed. |vim-differences| {Nvim}
|
||||||
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).
|
|
||||||
|
|
||||||
*'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
|
*'imcmdline'* *'imc'* *'noimcmdline'* *'noimc'*
|
||||||
'imcmdline' 'imc' boolean (default off)
|
'imcmdline' 'imc' boolean (default off)
|
||||||
@@ -3595,8 +3455,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|i_CTRL-^|.
|
|i_CTRL-^|.
|
||||||
The value is set to 1 when setting 'keymap' to a valid keymap name.
|
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".
|
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'*
|
||||||
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
|
'imsearch' 'ims' number (default 0, 2 when an input method is supported)
|
||||||
@@ -3612,25 +3470,9 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|c_CTRL-^|.
|
|c_CTRL-^|.
|
||||||
The value is set to 1 when it is not -1 and setting the 'keymap'
|
The value is set to 1 when it is not -1 and setting the 'keymap'
|
||||||
option to a valid keymap name.
|
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'*
|
||||||
'imstatusfunc' 'imsf' string (default "")
|
'imstatusfunc' 'imsf' Removed. |vim-differences| {Nvim}
|
||||||
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.
|
|
||||||
|
|
||||||
*'include'* *'inc'*
|
*'include'* *'inc'*
|
||||||
'include' 'inc' string (default "^\s*#\s*include")
|
'include' 'inc' string (default "^\s*#\s*include")
|
||||||
@@ -3772,7 +3614,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.
|
When executing commands with |:normal| 'insertmode' is not used.
|
||||||
|
|
||||||
*'isfname'* *'isf'*
|
*'isfname'* *'isf'*
|
||||||
'isfname' 'isf' string (default for MS-DOS and Win32:
|
'isfname' 'isf' string (default for Windows:
|
||||||
"@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
|
"@,48-57,/,\,.,-,_,+,,,#,$,%,{,},[,],:,@-@,!,~,="
|
||||||
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=")
|
otherwise: "@,48-57,/,.,-,_,+,,,#,$,%,~,=")
|
||||||
global
|
global
|
||||||
@@ -3823,7 +3665,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.
|
See |option-backslash| about including spaces and backslashes.
|
||||||
|
|
||||||
*'isident'* *'isi'*
|
*'isident'* *'isi'*
|
||||||
'isident' 'isi' string (default for MS-DOS and Win32:
|
'isident' 'isi' string (default for Windows:
|
||||||
"@,48-57,_,128-167,224-235"
|
"@,48-57,_,128-167,224-235"
|
||||||
otherwise: "@,48-57,_,192-255")
|
otherwise: "@,48-57,_,192-255")
|
||||||
global
|
global
|
||||||
@@ -3838,10 +3680,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
change 'iskeyword' instead.
|
change 'iskeyword' instead.
|
||||||
|
|
||||||
*'iskeyword'* *'isk'*
|
*'iskeyword'* *'isk'*
|
||||||
'iskeyword' 'isk' string (Vim default for
|
'iskeyword' 'isk' string (default: @,48-57,_,192-255
|
||||||
Win32: @,48-57,_,128-167,224-235
|
Vi default: @,48-57,_)
|
||||||
otherwise: @,48-57,_,192-255
|
|
||||||
Vi default: @,48-57,_)
|
|
||||||
local to buffer
|
local to buffer
|
||||||
Keywords are used in searching and recognizing with many commands:
|
Keywords are used in searching and recognizing with many commands:
|
||||||
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
|
"w", "*", "[i", etc. It is also used for "\k" in a |pattern|. See
|
||||||
@@ -3853,8 +3693,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.
|
When the 'lisp' option is on the '-' character is always included.
|
||||||
|
|
||||||
*'isprint'* *'isp'*
|
*'isprint'* *'isp'*
|
||||||
'isprint' 'isp' string (default for MS-DOS, Win32, and Macintosh:
|
'isprint' 'isp' string (default: "@,161-255")
|
||||||
"@,~-255"; otherwise: "@,161-255")
|
|
||||||
global
|
global
|
||||||
The characters given by this option are displayed directly on the
|
The characters given by this option are displayed directly on the
|
||||||
screen. It is also used for "\p" in a |pattern|. The characters from
|
screen. It is also used for "\p" in a |pattern|. The characters from
|
||||||
@@ -4143,10 +3982,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
visible in the first column.
|
visible in the first column.
|
||||||
*lcs-conceal*
|
*lcs-conceal*
|
||||||
conceal:c Character to show in place of concealed text, when
|
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*
|
*lcs-nbsp*
|
||||||
nbsp:c Character to show for a non-breakable space (character
|
nbsp:c Character to show for a non-breakable space character
|
||||||
0xA0, 160). Left blank when omitted.
|
(0xA0 (160 decimal) and U+202F). Left blank when
|
||||||
|
omitted.
|
||||||
|
|
||||||
The characters ':' and ',' should not be used. UTF-8 characters can
|
The characters ':' and ',' should not be used. UTF-8 characters can
|
||||||
be used when 'encoding' is "utf-8", otherwise only printable
|
be used when 'encoding' is "utf-8", otherwise only printable
|
||||||
@@ -4449,7 +4289,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.
|
The mouse pointer is restored when the mouse is moved.
|
||||||
|
|
||||||
*'mousemodel'* *'mousem'*
|
*'mousemodel'* *'mousem'*
|
||||||
'mousemodel' 'mousem' string (default "extend", "popup" for MS-DOS and Win32)
|
'mousemodel' 'mousem' string (default "extend", "popup" for Windows)
|
||||||
global
|
global
|
||||||
Sets the model to use for the mouse. The name mostly specifies what
|
Sets the model to use for the mouse. The name mostly specifies what
|
||||||
the right mouse button is used for:
|
the right mouse button is used for:
|
||||||
@@ -4551,12 +4391,12 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'mousetime'* *'mouset'*
|
*'mousetime'* *'mouset'*
|
||||||
'mousetime' 'mouset' number (default 500)
|
'mousetime' 'mouset' number (default 500)
|
||||||
global
|
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
|
time in msec between two mouse clicks for the second click to be
|
||||||
recognized as a multi click.
|
recognized as a multi click.
|
||||||
|
|
||||||
*'nrformats'* *'nf'*
|
*'nrformats'* *'nf'*
|
||||||
'nrformats' 'nf' string (default "hex")
|
'nrformats' 'nf' string (default "bin,hex")
|
||||||
local to buffer
|
local to buffer
|
||||||
This defines what bases Vim will consider for numbers when using the
|
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
|
CTRL-A and CTRL-X commands for adding to and subtracting from a number
|
||||||
@@ -4569,6 +4409,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
|
hex If included, numbers starting with "0x" or "0X" will be
|
||||||
considered to be hexadecimal. Example: Using CTRL-X on
|
considered to be hexadecimal. Example: Using CTRL-X on
|
||||||
"0x100" results in "0x0ff".
|
"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
|
Numbers which simply begin with a digit in the range 1-9 are always
|
||||||
considered decimal. This also happens for numbers that are not
|
considered decimal. This also happens for numbers that are not
|
||||||
recognized as octal or hex.
|
recognized as octal or hex.
|
||||||
@@ -4632,11 +4475,11 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'opendevice'* *'odev'* *'noopendevice'* *'noodev'*
|
*'opendevice'* *'odev'* *'noopendevice'* *'noodev'*
|
||||||
'opendevice' 'odev' boolean (default off)
|
'opendevice' 'odev' boolean (default off)
|
||||||
global
|
global
|
||||||
{only for MS-DOS and MS-Windows}
|
{only for Windows}
|
||||||
Enable reading and writing from devices. This may get Vim stuck on a
|
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
|
device that can be opened but doesn't actually do the I/O. Therefore
|
||||||
it is off by default.
|
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.
|
result in editing a device.
|
||||||
|
|
||||||
|
|
||||||
@@ -5002,18 +4845,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
instead of the number of lines.
|
instead of the number of lines.
|
||||||
|
|
||||||
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
*'restorescreen'* *'rs'* *'norestorescreen'* *'nors'*
|
||||||
'restorescreen' 'rs' boolean (default on)
|
'restorescreen' 'rs' Removed. |vim-differences| {Nvim}
|
||||||
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)
|
|
||||||
|
|
||||||
*'revins'* *'ri'* *'norevins'* *'nori'*
|
*'revins'* *'ri'* *'norevins'* *'nori'*
|
||||||
'revins' 'ri' boolean (default off)
|
'revins' 'ri' boolean (default off)
|
||||||
@@ -5342,8 +5174,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|
|
||||||
*'shada'* *'sd'* *E526* *E527* *E528*
|
*'shada'* *'sd'* *E526* *E527* *E528*
|
||||||
'shada' 'sd' string (Vim default for
|
'shada' 'sd' string (Vim default for
|
||||||
Win32: '!,100,<50,s10,h,rA:,rB:
|
Win32: !,'100,<50,s10,h,rA:,rB:
|
||||||
others: '!,100,<50,s10,h
|
others: !,'100,<50,s10,h
|
||||||
Vi default: "")
|
Vi default: "")
|
||||||
global
|
global
|
||||||
When non-empty, the shada file is read upon startup and written
|
When non-empty, the shada file is read upon startup and written
|
||||||
@@ -5370,9 +5202,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
|
% When included, save and restore the buffer list. If Vim is
|
||||||
started with a file name argument, the buffer list is not
|
started with a file name argument, the buffer list is not
|
||||||
restored. If Vim is started without a file name argument, the
|
restored. If Vim is started without a file name argument, the
|
||||||
buffer list is restored from the shada file. Buffers
|
buffer list is restored from the shada file. Quickfix
|
||||||
without a file name and buffers for help files are not written
|
('buftype'), unlisted ('buflisted'), unnamed and buffers on
|
||||||
to the shada file.
|
removable media (|shada-r|) are not saved.
|
||||||
When followed by a number, the number specifies the maximum
|
When followed by a number, the number specifies the maximum
|
||||||
number of buffers that are stored. Without a number all
|
number of buffers that are stored. Without a number all
|
||||||
buffers are stored.
|
buffers are stored.
|
||||||
@@ -5421,7 +5253,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
|
r Removable media. The argument is a string (up to the next
|
||||||
','). This parameter can be given several times. Each
|
','). This parameter can be given several times. Each
|
||||||
specifies the start of a path for which no marks will be
|
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,
|
could use "ra:,rb:". You can also use it for temp files,
|
||||||
e.g., for Unix: "r/tmp". Case is ignored.
|
e.g., for Unix: "r/tmp". Case is ignored.
|
||||||
*shada-s*
|
*shada-s*
|
||||||
@@ -5459,8 +5291,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|
|
||||||
*'shell'* *'sh'* *E91*
|
*'shell'* *'sh'* *E91*
|
||||||
'shell' 'sh' string (default $SHELL or "sh",
|
'shell' 'sh' string (default $SHELL or "sh",
|
||||||
MS-DOS and Win32: "command.com" or
|
Windows: "cmd.exe")
|
||||||
"cmd.exe")
|
|
||||||
global
|
global
|
||||||
Name of the shell to use for ! and :! commands. When changing the
|
Name of the shell to use for ! and :! commands. When changing the
|
||||||
value also check these options: 'shellpipe', 'shellslash'
|
value also check these options: 'shellpipe', 'shellslash'
|
||||||
@@ -5471,27 +5302,50 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
If the name of the shell contains a space, you might need to enclose
|
If the name of the shell contains a space, you might need to enclose
|
||||||
it in quotes. Example: >
|
it in quotes. Example: >
|
||||||
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
|
:set shell=\"c:\program\ files\unix\sh.exe\"\ -f
|
||||||
< Note the backslash before each quote (to avoid starting a comment) and
|
< Note the backslash before each quote (to avoid starting a comment) and
|
||||||
each space (to avoid ending the option value). Also note that the
|
each space (to avoid ending the option value), so better use |:let-&|
|
||||||
"-f" is not inside the quotes, because it is not part of the command
|
like this: >
|
||||||
name. And Vim automagically recognizes the backslashes that are path
|
:let &shell='"C:\Program Files\unix\sh.exe" -f'
|
||||||
separators.
|
< 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
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
|
|
||||||
*'shellcmdflag'* *'shcf'*
|
*'shellcmdflag'* *'shcf'*
|
||||||
'shellcmdflag' 'shcf' string (default: "-c";
|
'shellcmdflag' 'shcf' string (default: "-c";
|
||||||
MS-DOS and Win32, when 'shell' does not
|
Windows, when 'shell' does not
|
||||||
contain "sh" somewhere: "/c")
|
contain "sh" somewhere: "/c")
|
||||||
global
|
global
|
||||||
Flag passed to the shell to execute "!" and ":!" commands; e.g.,
|
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
|
systems, the default is set according to the value of 'shell', to
|
||||||
reduce the need to set this option by the user.
|
reduce the need to set this option by the user.
|
||||||
On Unix it can have more than one flag. Each white space separated
|
On Unix it can have more than one flag. Each white space separated
|
||||||
part is passed as an argument to the shell command.
|
part is passed as an argument to the shell command.
|
||||||
See |option-backslash| about including spaces and backslashes.
|
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
|
This option cannot be set from a |modeline| or in the |sandbox|, for
|
||||||
security reasons.
|
security reasons.
|
||||||
|
|
||||||
@@ -5506,7 +5360,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 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
|
(the file name is appended automatically if no %s appears in the value
|
||||||
of this option).
|
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.
|
and not echoed to the screen.
|
||||||
For Unix the default it "| tee". The stdout of the compiler is saved
|
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
|
in a file and echoed to the screen. If the 'shell' option is "csh" or
|
||||||
@@ -5530,7 +5384,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
security reasons.
|
security reasons.
|
||||||
|
|
||||||
*'shellquote'* *'shq'*
|
*'shellquote'* *'shq'*
|
||||||
'shellquote' 'shq' string (default: ""; MS-DOS and Win32, when 'shell'
|
'shellquote' 'shq' string (default: ""; Windows, when 'shell'
|
||||||
contains "sh" somewhere: "\"")
|
contains "sh" somewhere: "\"")
|
||||||
global
|
global
|
||||||
Quoting character(s), put around the command passed to the shell, for
|
Quoting character(s), put around the command passed to the shell, for
|
||||||
@@ -5538,7 +5392,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
|
quoting. See 'shellxquote' to include the redirection. It's
|
||||||
probably not useful to set both options.
|
probably not useful to set both options.
|
||||||
This is an empty string by default. Only known to be useful for
|
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
|
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
|
the value of 'shell', to reduce the need to set this option by the
|
||||||
user. See |dos-shell|.
|
user. See |dos-shell|.
|
||||||
@@ -5603,7 +5457,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
|
|
||||||
*'shellxescape'* *'sxe'*
|
*'shellxescape'* *'sxe'*
|
||||||
'shellxescape' 'sxe' string (default: "";
|
'shellxescape' 'sxe' string (default: "";
|
||||||
for MS-DOS and MS-Windows: "\"&|<>()@^")
|
for Windows: "\"&|<>()@^")
|
||||||
global
|
global
|
||||||
When 'shellxquote' is set to "(" then the characters listed in this
|
When 'shellxquote' is set to "(" then the characters listed in this
|
||||||
option will be escaped with a '^' character. This makes it possible
|
option will be escaped with a '^' character. This makes it possible
|
||||||
@@ -5772,8 +5626,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
|
Use the 'M' flag in 'highlight' to set the type of highlighting for
|
||||||
this message.
|
this message.
|
||||||
When |XIM| may be used the message will include "XIM". But this
|
When |XIM| may be used the message will include "XIM". But this
|
||||||
doesn't mean XIM is really active, especially when 'imactivatekey' is
|
doesn't mean XIM is really active.
|
||||||
not set.
|
|
||||||
|
|
||||||
*'showtabline'* *'stal'*
|
*'showtabline'* *'stal'*
|
||||||
'showtabline' 'stal' number (default 1)
|
'showtabline' 'stal' number (default 1)
|
||||||
@@ -6158,11 +6011,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
|
( - Start of item group. Can be used for setting the width and
|
||||||
alignment of a section. Must be followed by %) somewhere.
|
alignment of a section. Must be followed by %) somewhere.
|
||||||
) - End of item group. No width fields allowed.
|
) - End of item group. No width fields allowed.
|
||||||
T N For 'tabline': start of tab page N label. Use %T after the last
|
T N For 'tabline': start of tab page N label. Use %T or %X to end
|
||||||
label. This information is used for mouse clicks.
|
the label. Clicking this label with left mouse button switches
|
||||||
X N For 'tabline': start of close tab N label. Use %X after the
|
to the specified tab page.
|
||||||
label, e.g.: %3Xclose%X. Use %999X for a "close current tab"
|
X N For 'tabline': start of close tab N label. Use %X or %T to end
|
||||||
mark. This information is used for mouse clicks.
|
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.
|
< - Where to truncate line if too long. Default is at the start.
|
||||||
No width fields allowed.
|
No width fields allowed.
|
||||||
= - Separation point between left and right aligned items.
|
= - Separation point between left and right aligned items.
|
||||||
@@ -6269,7 +6150,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
|
When 'swapfile' is reset, the swap file for the current buffer is
|
||||||
immediately deleted. When 'swapfile' is set, and 'updatecount' is
|
immediately deleted. When 'swapfile' is set, and 'updatecount' is
|
||||||
non-zero, a swap file is immediately created.
|
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,
|
If you want to open a new buffer without creating a swap file for it,
|
||||||
use the |:noswapfile| modifier.
|
use the |:noswapfile| modifier.
|
||||||
|
|
||||||
@@ -6277,18 +6158,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|.
|
specify special kinds of buffers. See |special-buffers|.
|
||||||
|
|
||||||
*'swapsync'* *'sws'*
|
*'swapsync'* *'sws'*
|
||||||
'swapsync' 'sws' string (default "fsync")
|
'swapsync' 'sws' Removed. |vim-differences| {Nvim}
|
||||||
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.
|
|
||||||
|
|
||||||
*'switchbuf'* *'swb'*
|
*'switchbuf'* *'swb'*
|
||||||
'switchbuf' 'swb' string (default "")
|
'switchbuf' 'swb' string (default "")
|
||||||
@@ -6503,9 +6373,8 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
'term' string (default is $TERM, if that fails:
|
'term' string (default is $TERM, if that fails:
|
||||||
in the GUI: "builtin_gui"
|
in the GUI: "builtin_gui"
|
||||||
on Mac: "mac-ansi"
|
on Mac: "mac-ansi"
|
||||||
on MS-DOS: "pcterm"
|
|
||||||
on Unix: "ansi"
|
on Unix: "ansi"
|
||||||
on Win 32: "win32")
|
on Windows: "win32")
|
||||||
global
|
global
|
||||||
Name of the terminal. Used for choosing the terminal control
|
Name of the terminal. Used for choosing the terminal control
|
||||||
characters. Environment variables are expanded |:set_env|.
|
characters. Environment variables are expanded |:set_env|.
|
||||||
@@ -6775,7 +6644,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
|
When 'updatecount' is set from zero to non-zero, swap files are
|
||||||
created for all buffers that have 'swapfile' set. When 'updatecount'
|
created for all buffers that have 'swapfile' set. When 'updatecount'
|
||||||
is set to zero, existing swap files are not deleted.
|
is set to zero, existing swap files are not deleted.
|
||||||
Also see |'swapsync'|.
|
|
||||||
This option has no meaning in buffers where |'buftype'| is "nofile"
|
This option has no meaning in buffers where |'buftype'| is "nofile"
|
||||||
or "nowrite".
|
or "nowrite".
|
||||||
|
|
||||||
@@ -7079,7 +6947,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
*'winaltkeys'* *'wak'*
|
*'winaltkeys'* *'wak'*
|
||||||
'winaltkeys' 'wak' string (default "menu")
|
'winaltkeys' 'wak' string (default "menu")
|
||||||
global
|
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
|
Some GUI versions allow the access to menu entries by using the ALT
|
||||||
key in combination with a character that appears underlined in the
|
key in combination with a character that appears underlined in the
|
||||||
menu. This conflicts with the use of the ALT key for mappings and
|
menu. This conflicts with the use of the ALT key for mappings and
|
||||||
@@ -7094,8 +6962,7 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
keys can be mapped.
|
keys can be mapped.
|
||||||
If the menu is disabled by excluding 'm' from 'guioptions', the ALT
|
If the menu is disabled by excluding 'm' from 'guioptions', the ALT
|
||||||
key is never used for the menu.
|
key is never used for the menu.
|
||||||
This option is not used for <F10>; on Win32 and with GTK <F10> will
|
This option is not used for <F10>; on Win32.
|
||||||
select the menu, unless it has been mapped.
|
|
||||||
|
|
||||||
*'window'* *'wi'*
|
*'window'* *'wi'*
|
||||||
'window' 'wi' number (default screen height - 1)
|
'window' 'wi' number (default screen height - 1)
|
||||||
@@ -7263,6 +7130,6 @@ A jump table for the options with a short description can be found at |Q_op|.
|
|||||||
global
|
global
|
||||||
The number of microseconds to wait for each character sent to the
|
The number of microseconds to wait for each character sent to the
|
||||||
screen. When non-zero, characters are sent to the terminal one by
|
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:
|
vim:tw=78:ts=8:ft=help:noet:norl:
|
||||||
|
@@ -52,12 +52,9 @@ Will find "c:\user\piet\_vimrc" and the runtime files in "e:\vim\vim54".
|
|||||||
|
|
||||||
See |$VIM| and |$VIMRUNTIME| for more information.
|
See |$VIM| and |$VIMRUNTIME| for more information.
|
||||||
|
|
||||||
Under Windows 95, you can set $VIM in your C:\autoexec.bat file. For
|
You can set environment variables for each user separately under
|
||||||
example: >
|
"Start/Settings/Control Panel->System", or through the properties in the menu
|
||||||
set VIM=D:\vim
|
of "My Computer", under the Environment Tab.
|
||||||
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*
|
2. Using backslashes *dos-backslash*
|
||||||
@@ -246,16 +243,6 @@ the CTRL-C until it tries to read a key.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
8. Temp files *dos-temp-files*
|
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
|
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
|
filtering). The first of these directories that exists and in which Vim can
|
||||||
create a file is used:
|
create a file is used:
|
||||||
@@ -266,10 +253,10 @@ create a file is used:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
9. Shell option default *dos-shell*
|
9. Shell option default *dos-shell*
|
||||||
|
|
||||||
The default for the 'sh' ('shell') option is "command.com" on Windows 95 and
|
The default for the 'sh' ('shell') option is "cmd.exe" on Windows.
|
||||||
"cmd.exe" on Windows NT. If SHELL is defined, Vim uses SHELL instead, and if
|
If SHELL is defined, Vim uses SHELL instead, and if SHELL is not defined
|
||||||
SHELL is not defined but COMSPEC is, Vim uses COMSPEC. Vim starts external
|
but COMSPEC is, Vim uses COMSPEC. Vim starts external commands with
|
||||||
commands with "<shell> /c <command_name>". Typing CTRL-Z starts a new command
|
"<shell> /c <command_name>". Typing CTRL-Z starts a new command
|
||||||
subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
|
subshell. Return to Vim with "exit". |'shell'| |CTRL-Z|
|
||||||
|
|
||||||
If you are running a third-party shell, you may need to set the
|
If you are running a third-party shell, you may need to set the
|
||||||
|
@@ -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*
|
*win32* *Win32* *MS-Windows*
|
||||||
This file documents the idiosyncrasies of the Win32 version of Vim.
|
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.
|
There are both console and GUI versions.
|
||||||
|
|
||||||
The 32 bit version also runs on 64 bit MS-Windows systems.
|
The 32 bit version also runs on 64 bit MS-Windows systems.
|
||||||
|
|
||||||
1. Known problems |win32-problems|
|
1. Known problems |win32-problems|
|
||||||
2. Startup |win32-startup|
|
2. Startup |win32-startup|
|
||||||
3. Restore screen contents |win32-restore|
|
3. Using the mouse |win32-mouse|
|
||||||
4. Using the mouse |win32-mouse|
|
4. Win32 mini FAQ |win32-faq|
|
||||||
5. Running under Windows 3.1 |win32-win3.1|
|
|
||||||
6. Win32 mini FAQ |win32-faq|
|
|
||||||
|
|
||||||
Additionally, there are a number of common Win32 and DOS items:
|
Additionally, there are a number of common Win32 and DOS items:
|
||||||
File locations |dos-locations|
|
File locations |dos-locations|
|
||||||
@@ -34,7 +32,6 @@ Win32 GUI |gui-w32|
|
|||||||
|
|
||||||
Credits:
|
Credits:
|
||||||
The Win32 version was written by George V. Reilly <george@reilly.org>.
|
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.
|
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.
|
executable() returns 1 the executable can actually be executed.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
3. Restore screen contents *win32-restore*
|
3. Using the mouse *win32-mouse*
|
||||||
|
|
||||||
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*
|
|
||||||
|
|
||||||
The Win32 version of Vim supports using the mouse. If you have a two-button
|
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
|
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.
|
the console.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
5. Running under Windows 3.1 *win32-win3.1*
|
4. Win32 mini FAQ *win32-faq*
|
||||||
|
|
||||||
*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*
|
|
||||||
|
|
||||||
Q. How do I change the font?
|
Q. How do I change the font?
|
||||||
A. In the GUI version, you can use the 'guifont' option. Example: >
|
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.
|
< In the console version, you need to set the font of the console itself.
|
||||||
You cannot do this from within Vim.
|
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.
|
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,
|
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?
|
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
|
:set shellpipe=\|\ tee
|
||||||
< to your _vimrc.
|
< 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*
|
*:!start*
|
||||||
Q. How can I run an external command or program asynchronously?
|
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": >
|
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
|
< The first command runs notepad minimized and the second one runs it
|
||||||
normally.
|
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*
|
*windows-icon*
|
||||||
Q. I don't like the Vim icon, can I change it?
|
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
|
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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -59,6 +59,8 @@ explanations are in chapter 27 |usr_27.txt|.
|
|||||||
|
|
||||||
*n*
|
*n*
|
||||||
n Repeat the latest "/" or "?" [count] times.
|
n Repeat the latest "/" or "?" [count] times.
|
||||||
|
If the cursor doesn't move the search is repeated with
|
||||||
|
count + 1.
|
||||||
|last-pattern|
|
|last-pattern|
|
||||||
|
|
||||||
*N*
|
*N*
|
||||||
@@ -129,7 +131,7 @@ gD Goto global Declaration. When the cursor is on a
|
|||||||
|
|
||||||
*CTRL-C*
|
*CTRL-C*
|
||||||
CTRL-C Interrupt current (search) command. Use CTRL-Break on
|
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.
|
In Normal mode, any pending command is aborted.
|
||||||
|
|
||||||
*:noh* *:nohlsearch*
|
*:noh* *:nohlsearch*
|
||||||
@@ -1050,7 +1052,10 @@ x A single character, with no special meaning, matches itself
|
|||||||
*E769*
|
*E769*
|
||||||
When the ']' is not there Vim will not give an error message but
|
When the ']' is not there Vim will not give an error message but
|
||||||
assume no collection is used. Useful to search for '['. However, you
|
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
|
If the sequence begins with "^", it matches any single character NOT
|
||||||
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
in the collection: "[^xyz]" matches anything but 'x', 'y' and 'z'.
|
||||||
@@ -1082,7 +1087,7 @@ x A single character, with no special meaning, matches itself
|
|||||||
*[:backspace:]* [:backspace:] the <BS> character
|
*[:backspace:]* [:backspace:] the <BS> character
|
||||||
The brackets in character class expressions are additional to the
|
The brackets in character class expressions are additional to the
|
||||||
brackets delimiting a collection. For example, the following is a
|
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 '-', '.',
|
a list of at least one character, each of which is either '-', '.',
|
||||||
'/', alphabetic, numeric, '_' or '~'.
|
'/', alphabetic, numeric, '_' or '~'.
|
||||||
These items only work for 8-bit characters.
|
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
|
utility psselect. This utility has options -e and -o for printing just the
|
||||||
even or odd pages of a PS file respectively.
|
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: >
|
files with all the odd and even numbered pages with: >
|
||||||
|
|
||||||
psselect -o test.ps odd.ps
|
psselect -o test.ps odd.ps
|
||||||
|
@@ -291,6 +291,100 @@ use this code: >
|
|||||||
|
|
||||||
au QuickfixCmdPost make call QfMakeConv()
|
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*
|
2. The error window *quickfix-window*
|
||||||
@@ -493,11 +587,11 @@ or simpler >
|
|||||||
"$*" can be given multiple times, for example: >
|
"$*" can be given multiple times, for example: >
|
||||||
:set makeprg=gcc\ -o\ $*\ $*
|
:set makeprg=gcc\ -o\ $*\ $*
|
||||||
|
|
||||||
The 'shellpipe' option defaults to ">" for MS-DOS and Win32. This means that
|
The 'shellpipe' option defaults to ">" on Windows. This means that the output
|
||||||
the output of the compiler is saved in a file and not shown on the screen
|
of the compiler is saved in a file and not shown on the screen directly. For
|
||||||
directly. For Unix "| tee" is used. The compiler output is shown on the
|
Unix "| tee" is used. The compiler output is shown on the screen and saved in
|
||||||
screen and saved in a file the same time. Depending on the shell used "|&
|
a file the same time. Depending on the shell used "|& tee" or "2>&1| tee" is
|
||||||
tee" or "2>&1| tee" is the default, so stderr output will be included.
|
the default, so stderr output will be included.
|
||||||
|
|
||||||
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
|
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
|
||||||
for compilers that write to an errorfile themselves.
|
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
|
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.
|
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
|
On Windows a leading "C:" will be included in "%f", even when using "%f:".
|
||||||
using "%f:". This means that a file name which is a single alphabetical
|
This means that a file name which is a single alphabetical letter will not be
|
||||||
letter will not be detected.
|
detected.
|
||||||
|
|
||||||
The "%p" conversion is normally followed by a "^". It's used for compilers
|
The "%p" conversion is normally followed by a "^". It's used for compilers
|
||||||
that output a line like: >
|
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
|
'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
|
||||||
'altkeymap' 'akm' for default second language (Farsi/Hebrew)
|
'altkeymap' 'akm' for default second language (Farsi/Hebrew)
|
||||||
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
|
'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
|
'autochdir' 'acd' change directory to the file in the current window
|
||||||
'arabic' 'arab' for Arabic as a default second language
|
'arabic' 'arab' for Arabic as a default second language
|
||||||
'arabicshape' 'arshape' do shaping for Arabic characters
|
'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
|
'icon' let Vim set the text of the window icon
|
||||||
'iconstring' string to use for the Vim icon text
|
'iconstring' string to use for the Vim icon text
|
||||||
'ignorecase' 'ic' ignore case in search patterns
|
'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
|
'imcmdline' 'imc' use IM when starting to edit a command line
|
||||||
'imdisable' 'imd' do not use the IM in any mode
|
'imdisable' 'imd' do not use the IM in any mode
|
||||||
'iminsert' 'imi' use :lmap or IM in Insert mode
|
'iminsert' 'imi' use :lmap or IM in Insert mode
|
||||||
'imsearch' 'ims' use :lmap or IM when typing a search pattern
|
'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
|
'include' 'inc' pattern to be used to find an include file
|
||||||
'includeexpr' 'inex' expression used to process an include line
|
'includeexpr' 'inex' expression used to process an include line
|
||||||
'incsearch' 'is' highlight match while typing search pattern
|
'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
|
'relativenumber' 'rnu' show relative line number in front of each line
|
||||||
'remap' allow mappings to work recursively
|
'remap' allow mappings to work recursively
|
||||||
'report' threshold for reporting nr. of lines changed
|
'report' threshold for reporting nr. of lines changed
|
||||||
'restorescreen' 'rs' Win32: restore screen when exiting
|
|
||||||
'revins' 'ri' inserting characters will work backwards
|
'revins' 'ri' inserting characters will work backwards
|
||||||
'rightleft' 'rl' window is right-to-left oriented
|
'rightleft' 'rl' window is right-to-left oriented
|
||||||
'rightleftcmd' 'rlc' commands for which editing works right-to-left
|
'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
|
'suffixes' 'su' suffixes that are ignored with multiple match
|
||||||
'suffixesadd' 'sua' suffixes added when searching for a file
|
'suffixesadd' 'sua' suffixes added when searching for a file
|
||||||
'swapfile' 'swf' whether to use a swapfile for a buffer
|
'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
|
'switchbuf' 'swb' sets behavior when switching to another buffer
|
||||||
'synmaxcol' 'smc' maximum column to find syntax items
|
'synmaxcol' 'smc' maximum column to find syntax items
|
||||||
'syntax' 'syn' syntax to be loaded for current buffer
|
'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
|
|g_CTRL-G| g CTRL-G show cursor column, line, and character
|
||||||
position
|
position
|
||||||
|CTRL-C| CTRL-C during searches: Interrupt the search
|
|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
|
|<Del>| <Del> while entering a count: delete last character
|
||||||
|:version| :ve[rsion] show version information
|
|:version| :ve[rsion] show version information
|
||||||
|:mode| :mode N MS-DOS: set screen mode to N (number, C80,
|
|
||||||
C4350, etc.)
|
|
||||||
|:normal| :norm[al][!] {commands}
|
|:normal| :norm[al][!] {commands}
|
||||||
execute Normal mode commands
|
execute Normal mode commands
|
||||||
|Q| Q switch to "Ex" mode
|
|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
|
that vi sorely needs: highlighting for executing commands on blocks, an easily
|
||||||
navigable and digestible help screen, and more. (Paul Pax)
|
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)
|
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,
|
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)
|
C++, HTML what ever. (Tim Allwine)
|
||||||
|
|
||||||
I discovered VIM after years of struggling with the original vi, and I just
|
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,
|
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
|
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
|
If you want to put swap files in a fixed place, put a command resembling the
|
||||||
following ones in your vimrc:
|
following ones in your vimrc:
|
||||||
:set dir=~/tmp (for Unix)
|
: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
|
This is also very handy when editing files on floppy. Of course you will have
|
||||||
to create that "tmp" directory for this to work!
|
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
|
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
|
change the 200 character count with the 'updatecount' option. You can set
|
||||||
the time with the 'updatetime' option. The time is given in milliseconds.
|
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
|
After writing to the swap file Vim syncs the file to disk.
|
||||||
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.
|
|
||||||
|
|
||||||
If the writing to the swap file is not wanted, it can be switched off by
|
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
|
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
|
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
|
The remote Vim is raised. If you don't want
|
||||||
this use >
|
this use >
|
||||||
vim --remote-send "<C-\><C-N>:n filename<CR>"
|
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
|
As above, but don't complain if there is no
|
||||||
server and the file is edited locally.
|
server and the file is edited locally.
|
||||||
--remote-wait [+{cmd}] {file} ... *--remote-wait*
|
--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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -287,13 +287,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.
|
the <t_xx> termcap codes, these can only be used in mappings.
|
||||||
|
|
||||||
*:source_crnl* *W15*
|
*:source_crnl* *W15*
|
||||||
MS-DOS and Win32: Files that are read with ":source" normally have
|
Windows: Files that are read with ":source" normally have <CR><NL> <EOL>s.
|
||||||
<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s
|
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||||
(for example, a file made on Unix), this will be recognized if 'fileformats'
|
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||||
is not empty and the first line does not end in a <CR>. This fails if the
|
the first line does not end in a <CR>. This fails if the first line has
|
||||||
first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
|
something like ":map <F1> :help^M", where "^M" is a <CR>. If the first line
|
||||||
the first line ends in a <CR>, but following ones don't, you will get an error
|
ends in a <CR>, but following ones don't, you will get an error message,
|
||||||
message, because the <CR> from the first lines will be lost.
|
because the <CR> from the first lines will be lost.
|
||||||
|
|
||||||
Mac Classic: Files that are read with ":source" normally have <CR> <EOL>s.
|
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
|
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||||
@@ -303,7 +303,7 @@ linebreaks which has a <CR> in first line.
|
|||||||
|
|
||||||
On other systems, Vim expects ":source"ed files to end in a <NL>. These
|
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
|
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>
|
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
|
detection, because it's common to start with a line that defines a mapping
|
||||||
that ends in a <CR>, which will confuse the automaton.
|
that ends in a <CR>, which will confuse the automaton.
|
||||||
@@ -390,7 +390,7 @@ To enter debugging mode use one of these methods:
|
|||||||
useful to find out what is happening when Vim is starting up. A side
|
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
|
effect is that Vim will switch the terminal mode before initialisations
|
||||||
have finished, with unpredictable results.
|
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
|
soon as the GUI window has been opened. To make this happen early, add a
|
||||||
":gui" command in the vimrc file.
|
":gui" command in the vimrc file.
|
||||||
*:debug*
|
*:debug*
|
||||||
@@ -583,9 +583,13 @@ For example, to profile the one_script.vim script file: >
|
|||||||
|
|
||||||
:prof[ile] start {fname} *:prof* *:profile* *E750*
|
:prof[ile] start {fname} *:prof* *:profile* *E750*
|
||||||
Start profiling, write the output in {fname} upon exit.
|
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.
|
If {fname} already exists it will be silently overwritten.
|
||||||
The variable |v:profiling| is set to one.
|
The variable |v:profiling| is set to one.
|
||||||
|
|
||||||
|
:prof[ile] stop
|
||||||
|
Write the logfile and stop profiling.
|
||||||
|
|
||||||
:prof[ile] pause
|
:prof[ile] pause
|
||||||
Don't profile until the following ":profile continue". Can be
|
Don't profile until the following ":profile continue". Can be
|
||||||
used when doing something that should not be counted (e.g., an
|
used when doing something that should not be counted (e.g., an
|
||||||
@@ -609,6 +613,9 @@ For example, to profile the one_script.vim script file: >
|
|||||||
after this command. A :profile command in the script itself
|
after this command. A :profile command in the script itself
|
||||||
won't work.
|
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*
|
:profd[el] ... *:profd* *:profdel*
|
||||||
Stop profiling for the arguments specified. See |:breakdel|
|
Stop profiling for the arguments specified. See |:breakdel|
|
||||||
@@ -652,10 +659,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
|
Profiling should give a good indication of where time is spent, but keep in
|
||||||
mind there are various things that may clobber the results:
|
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
|
- 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
|
delays at unpredictable moments. You may want to run the profiling several
|
||||||
times and use the lowest results.
|
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
|
o Somewhat slower in right-to-left mode, because right-to-left motion is
|
||||||
emulated inside Vim, not by the controlling terminal.
|
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.
|
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.
|
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
|
depends on your mouse driver. If the scroll action causes input focus
|
||||||
problems, see |intellimouse-wheel-problems|.
|
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
|
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
|
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
|
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
|
This only works when Vim gets the scroll wheel events, of course. You can
|
||||||
check if this works with the "xev" program.
|
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>*
|
*<MouseDown>* *<MouseUp>*
|
||||||
The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp>
|
The keys <MouseDown> and <MouseUp> have been deprecated. Use <ScrollWheelUp>
|
||||||
instead of <MouseDown> and use <ScrollWheelDown> instead of <MouseUp>.
|
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
|
Define the file name where the bitmap can be found. Should be
|
||||||
a full path. The bitmap should fit in the place of two
|
a full path. The bitmap should fit in the place of two
|
||||||
characters. This is not checked. If the bitmap is too big it
|
characters. This is not checked. If the bitmap is too big it
|
||||||
will cause redraw problems. Only GTK 2 can scale the bitmap
|
will cause redraw problems.
|
||||||
to fit the space available.
|
|
||||||
toolkit supports ~
|
toolkit supports ~
|
||||||
GTK 1 pixmap (.xpm)
|
|
||||||
GTK 2 many
|
|
||||||
Motif pixmap (.xpm)
|
|
||||||
Win32 .bmp, .ico, .cur
|
Win32 .bmp, .ico, .cur
|
||||||
pixmap (.xpm) |+xpm_w32|
|
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
|
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 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
|
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:
|
word. Note: this slows down the appearance of the popup menu.
|
||||||
don't release the right mouse button until the menu appears, otherwise it
|
|
||||||
won't work.
|
|
||||||
|
|
||||||
To search for the next misspelled word:
|
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
|
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.
|
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
|
Exactly one out of the following five items may be used to choose how to
|
||||||
start editing:
|
start editing:
|
||||||
|
|
||||||
@@ -358,7 +356,7 @@ accordingly. Vim proceeds in this order:
|
|||||||
|
|
||||||
1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
|
1. Set the 'shell' and 'term' option *SHELL* *COMSPEC* *TERM*
|
||||||
The environment variable SHELL, if it exists, is used to set the
|
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.
|
if SHELL is not set.
|
||||||
The environment variable TERM, if it exists, is used to set the 'term'
|
The environment variable TERM, if it exists, is used to set the 'term'
|
||||||
option. However, 'term' will change later when starting the GUI (step
|
option. However, 'term' will change later when starting the GUI (step
|
||||||
@@ -402,10 +400,9 @@ accordingly. Vim proceeds in this order:
|
|||||||
initializations until 4. are skipped. Only the "-u" option is
|
initializations until 4. are skipped. Only the "-u" option is
|
||||||
interpreted.
|
interpreted.
|
||||||
*system-vimrc*
|
*system-vimrc*
|
||||||
a. For Unix, MS-DOS, MS-Windows, and Macintosh, the system vimrc file is
|
a. For Unix, MS-Windows, and Macintosh, the system vimrc file is read for
|
||||||
read for initializations. The path of this file is shown with the
|
initializations. The path of this file is shown with the
|
||||||
":version" command. Mostly it's "$VIM/vimrc".
|
":version" command. Mostly it's "$VIM/vimrc".
|
||||||
For the Macintosh the $VIMRUNTIME/macmap.vim is read.
|
|
||||||
|
|
||||||
*VIMINIT* *EXINIT* *$MYVIMRC*
|
*VIMINIT* *EXINIT* *$MYVIMRC*
|
||||||
b. Four places are searched for initializations. The first that exists
|
b. Four places are searched for initializations. The first that exists
|
||||||
@@ -497,7 +494,7 @@ sessions. Put it in a place so that it will be found by 3b:
|
|||||||
Local setup:
|
Local setup:
|
||||||
Put all commands that you need for editing a specific directory only into a
|
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"
|
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.
|
have to turn on the option 'exrc'. See |trojan-horse| too.
|
||||||
|
|
||||||
System setup:
|
System setup:
|
||||||
@@ -519,10 +516,9 @@ interfere with Vi, then use the variable VIMINIT and the file init.vim
|
|||||||
instead.
|
instead.
|
||||||
|
|
||||||
MS-DOS line separators:
|
MS-DOS line separators:
|
||||||
On MS-DOS-like systems (MS-DOS itself and Win32), Vim assumes that all
|
On Windows systems Vim assumes that all the vimrc files have <CR> <NL> pairs
|
||||||
the vimrc files have <CR> <NL> pairs as line separators. This will give
|
as line separators. This will give problems if you have a file with only
|
||||||
problems if you have a file with only <NL>s and have a line like
|
<NL>s and have a line like ":map xx yy^M". The trailing ^M will be ignored.
|
||||||
":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
|
The $MYVIMRC or $MYGVIMRC file will be set to the first found vimrc and/or
|
||||||
gvimrc file.
|
gvimrc file.
|
||||||
@@ -950,7 +946,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
|
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
|
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
|
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:".
|
use "ra:,rb:".
|
||||||
The |v:oldfiles| variable is filled with the file names that the ShaDa file
|
The |v:oldfiles| variable is filled with the file names that the ShaDa file
|
||||||
has marks for.
|
has marks for.
|
||||||
@@ -1163,13 +1159,14 @@ running) you have additional options:
|
|||||||
*:wv* *:wviminfo*
|
*:wv* *:wviminfo*
|
||||||
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
:wv[iminfo][!] [file] Deprecated alias to |:wshada| command.
|
||||||
|
|
||||||
*:ol* *:oldfiles*
|
*:o* *:ol* *:oldfiles*
|
||||||
:ol[dfiles] List the files that have marks stored in the ShaDa
|
:o[ldfiles][!] List the files that have marks stored in the ShaDa
|
||||||
file. This list is read on startup and only changes
|
file. This list is read on startup and only changes
|
||||||
afterwards with ":rshada!". Also see |v:oldfiles|.
|
afterwards with ":rshada!". Also see |v:oldfiles|.
|
||||||
The number can be used with |c_#<|.
|
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
|
List file names as with |:oldfiles|, and then prompt
|
||||||
for a number. When the number is valid that file from
|
for a number. When the number is valid that file from
|
||||||
the list is edited.
|
the list is edited.
|
||||||
@@ -1232,6 +1229,8 @@ exactly four MessagePack objects:
|
|||||||
With |shada-h| or 'nohlsearch'
|
With |shada-h| or 'nohlsearch'
|
||||||
this key is always false.
|
this key is always false.
|
||||||
sp Binary N/A Actual pattern. Required.
|
sp Binary N/A Actual pattern. Required.
|
||||||
|
sb Boolean false True if search direction is
|
||||||
|
backward.
|
||||||
* any none Other keys are allowed for
|
* any none Other keys are allowed for
|
||||||
compatibility reasons, see
|
compatibility reasons, see
|
||||||
|shada-compatibility|.
|
|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
|
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||||
@@ -71,10 +71,10 @@ with: >
|
|||||||
For a color terminal see |:hi-normal-cterm|.
|
For a color terminal see |:hi-normal-cterm|.
|
||||||
For setting up your own colors syntax highlighting see |syncolor|.
|
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>.
|
NOTE: The syntax files on Windows have lines that end in <CR><NL>. The files
|
||||||
The files for Unix end in <NL>. This means you should use the right type of
|
for Unix end in <NL>. This means you should use the right type of file for
|
||||||
file for your system. Although on MS-DOS and Windows the right format is
|
your system. Although on Windows the right format is automatically selected
|
||||||
automatically selected if the 'fileformats' option is not empty.
|
if the 'fileformats' option is not empty.
|
||||||
|
|
||||||
NOTE: When using reverse video ("gvim -fg white -bg black"), the default value
|
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
|
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.
|
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
|
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
|
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.
|
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
|
:let diff_translations = 0
|
||||||
|
|
||||||
|
Also see |diff-slow|.
|
||||||
|
|
||||||
|
|
||||||
DIRCOLORS *dircolors.vim* *ft-dircolors-syntax*
|
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: >
|
It will look much better with a font in a quadratic cell size, e.g. for X: >
|
||||||
:set guifont=-*-clean-medium-r-*-*-8-*-*-*-*-80-*
|
: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*
|
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
|
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
|
adding "minlines"). This is useful if you have few things to sync on and a
|
||||||
slow machine. Example: >
|
slow machine. Example: >
|
||||||
:syntax sync ccomment maxlines=500
|
:syntax sync maxlines=500 ccomment
|
||||||
<
|
<
|
||||||
*:syn-sync-linebreaks*
|
*:syn-sync-linebreaks*
|
||||||
When using a pattern that matches multiple lines, a change in one line may
|
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*
|
*highlight-args* *E416* *E417* *E423*
|
||||||
There are three types of terminals for highlighting:
|
There are three types of terminals for highlighting:
|
||||||
term a normal terminal (vt100, xterm)
|
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)
|
termcap entry)
|
||||||
gui the GUI
|
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
|
Note that for some color terminals these names may result in the wrong
|
||||||
colors!
|
colors!
|
||||||
|
|
||||||
|
You can also use "NONE" to remove the color.
|
||||||
|
|
||||||
*:hi-normal-cterm*
|
*:hi-normal-cterm*
|
||||||
When setting the "ctermfg" or "ctermbg" colors for the Normal group,
|
When setting the "ctermfg" or "ctermbg" colors for the Normal group,
|
||||||
these will become the colors used for the non-highlighted text.
|
these will become the colors used for the non-highlighted text.
|
||||||
@@ -4650,7 +4681,7 @@ ctermbg={color-nr} *highlight-ctermbg*
|
|||||||
*E419* *E420*
|
*E419* *E420*
|
||||||
When Vim knows the normal foreground and background colors, "fg" and
|
When Vim knows the normal foreground and background colors, "fg" and
|
||||||
"bg" can be used as color names. This only works after setting the
|
"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: >
|
reverse video: >
|
||||||
:highlight Visual ctermfg=bg ctermbg=fg
|
:highlight Visual ctermfg=bg ctermbg=fg
|
||||||
< Note that the colors are used that are valid at the moment this
|
< 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
|
When setting the font for the "Normal" group, this becomes the default
|
||||||
font (until the 'guifont' option is changed; the last one set is
|
font (until the 'guifont' option is changed; the last one set is
|
||||||
used).
|
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 "Menu" group, the menus will be changed.
|
||||||
When setting the font for the "Tooltip" group, the tooltips will be
|
When setting the font for the "Tooltip" group, the tooltips will be
|
||||||
changed.
|
changed.
|
||||||
@@ -4864,11 +4895,6 @@ Menu Current font, background and foreground colors of the menus.
|
|||||||
Also used for the toolbar.
|
Also used for the toolbar.
|
||||||
Applicable highlight arguments: font, guibg, guifg.
|
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*
|
*hl-Scrollbar*
|
||||||
Scrollbar Current background and foreground of the main window's
|
Scrollbar Current background and foreground of the main window's
|
||||||
scrollbars.
|
scrollbars.
|
||||||
@@ -4878,11 +4904,6 @@ Scrollbar Current background and foreground of the main window's
|
|||||||
Tooltip Current font, background and foreground of the tooltips.
|
Tooltip Current font, background and foreground of the tooltips.
|
||||||
Applicable highlight arguments: font, guibg, guifg.
|
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*
|
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
|
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.
|
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
|
This also works in a few GUI versions, esp. Win32. But only when clicking
|
||||||
clicking right of the labels.
|
right of the labels.
|
||||||
|
|
||||||
In the GUI tab pages line you can use the right mouse button to open menu.
|
In the GUI tab pages line you can use the right mouse button to open menu.
|
||||||
|tabline-menu|.
|
|tabline-menu|.
|
||||||
@@ -197,22 +197,29 @@ REORDERING TAB PAGES:
|
|||||||
Move the current tab page to after tab page N. Use zero to
|
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
|
make the current tab page the first one. Without N the tab
|
||||||
page is made the last one. >
|
page is made the last one. >
|
||||||
|
:.tabmove " do nothing
|
||||||
:-tabmove " move the tab page to the left
|
:-tabmove " move the tab page to the left
|
||||||
:tabmove " move the tab page to the right
|
:+tabmove " move the tab page to the right
|
||||||
:.tabmove " as above
|
|
||||||
:+tabmove " as above
|
|
||||||
:0tabmove " move the tab page to the beginning of the tab
|
:0tabmove " move the tab page to the beginning of the tab
|
||||||
" list
|
" 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]
|
||||||
:tabm[ove] -[N]
|
:tabm[ove] -[N]
|
||||||
Move the current tab page N places to the right (with +) or to
|
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
|
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
|
:Ntabmove. And move it by N places by using :+Ntabmove. For clarification what
|
||||||
clarification what +N means in this context see |[range]|.
|
+N means in this context see |[range]|.
|
||||||
|
|
||||||
|
|
||||||
LOOPING OVER TAB PAGES:
|
LOOPING OVER TAB PAGES:
|
||||||
@@ -234,7 +241,8 @@ LOOPING OVER TAB PAGES:
|
|||||||
current tab page.
|
current tab page.
|
||||||
{cmd} can contain '|' to concatenate several commands.
|
{cmd} can contain '|' to concatenate several commands.
|
||||||
{cmd} must not open or close tab pages or reorder them.
|
{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*
|
3. Other items *tab-page-other*
|
||||||
|
@@ -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
|
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,
|
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.
|
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
|
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*
|
*xterm-resize*
|
||||||
Window resizing with xterm only works if the allowWindowOps resource is
|
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
|
Unfortunately it is not possible to deduce from the termcap how cursor
|
||||||
positioning should be done when using a scrolling region: Relative to the
|
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.
|
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
|
Most terminals use the first method. The 't_CS' option should be set to any
|
||||||
(pcterm). The 't_CS' option should be set to any string when cursor
|
string when cursor positioning is relative to the start of the scrolling
|
||||||
positioning is relative to the start of the scrolling region. It should be
|
region. It should be set to an empty string otherwise.
|
||||||
set to an empty string otherwise. It defaults to "yes" when 'term' is
|
|
||||||
"pcterm".
|
|
||||||
|
|
||||||
Note for xterm users: The shifted cursor keys normally don't work. You can
|
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.
|
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
|
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
|
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,
|
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
|
only in some versions (GUI, Windows) will the dragging be shown immediately.
|
||||||
immediately. Note that you can make the text scroll by moving the mouse at
|
Note that you can make the text scroll by moving the mouse at least one
|
||||||
least one character in the first/last line in the window when 'scrolloff' is
|
character in the first/last line in the window when 'scrolloff' is non-zero.
|
||||||
non-zero.
|
|
||||||
|
|
||||||
In Normal, Visual and Select mode clicking the right mouse button causes the
|
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
|
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).
|
alt key is pressed (it may move the window).
|
||||||
|
|
||||||
*double-click*
|
*double-click*
|
||||||
Double, triple and quadruple clicks are supported when the GUI is active,
|
Double, triple and quadruple clicks are supported when the GUI is active, for
|
||||||
for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is
|
Windows and for an xterm. For selecting text, extra clicks extend the
|
||||||
available). For selecting text, extra clicks extend the selection:
|
selection:
|
||||||
click select ~
|
click select ~
|
||||||
double word or % match *<2-LeftMouse>*
|
double word or % match *<2-LeftMouse>*
|
||||||
triple line *<3-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
|
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
|
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
|
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
|
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
|
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
|
VIM USER MANUAL - by Bram Moolenaar
|
||||||
|
|
||||||
@@ -29,11 +29,10 @@ To start Vim, enter this command: >
|
|||||||
|
|
||||||
gvim file.txt
|
gvim file.txt
|
||||||
|
|
||||||
In UNIX you can type this at any command prompt. If you are running Microsoft
|
On Unix you can type this at any command prompt. If you are running Windows,
|
||||||
Windows, open an MS-DOS prompt window and enter the command.
|
open a command prompt window and enter the command. In either case, Vim
|
||||||
In either case, Vim starts editing a file called file.txt. Because this
|
starts editing a file called file.txt. Because this is a new file, you get a
|
||||||
is a new file, you get a blank window. This is what your screen will look
|
blank window. This is what your screen will look like:
|
||||||
like:
|
|
||||||
|
|
||||||
+---------------------------------------+
|
+---------------------------------------+
|
||||||
|# |
|
|# |
|
||||||
@@ -61,10 +60,9 @@ use this command: >
|
|||||||
|
|
||||||
the editing occurs inside your command window. In other words, if you are
|
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
|
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
|
the command prompt under Microsoft Windows, the editing occurs inside this
|
||||||
inside this window. The text in the window will look the same for both
|
window. The text in the window will look the same for both versions, but with
|
||||||
versions, but with gvim you have extra features, like a menu bar. More about
|
gvim you have extra features, like a menu bar. More about that later.
|
||||||
that later.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*02.2* Inserting text
|
*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: >
|
limerick, this is what you type: >
|
||||||
|
|
||||||
iA very intelligent turtle
|
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
|
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
|
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 |
|
|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 |
|
|A very intelligent turtle |
|
||||||
|Found programming UNIX a hurdle |
|
|Found programming Unix a hurdle |
|
||||||
|~ |
|
|~ |
|
||||||
|~ |
|
|~ |
|
||||||
|-- INSERT -- |
|
|-- INSERT -- |
|
||||||
@@ -187,7 +185,7 @@ look like this:
|
|||||||
|
|
||||||
+---------------------------------------+
|
+---------------------------------------+
|
||||||
|intelligent turtle |
|
|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 |
|
|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:
|
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:
|
Suppose the cursor is somewhere in the first of these two lines:
|
||||||
|
|
||||||
A very intelligent turtle ~
|
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: >
|
If you now use the "o" command and type new text: >
|
||||||
|
|
||||||
@@ -342,7 +340,7 @@ The result is:
|
|||||||
|
|
||||||
A very intelligent turtle ~
|
A very intelligent turtle ~
|
||||||
That liked using Vim ~
|
That liked using Vim ~
|
||||||
Found programming UNIX a hurdle ~
|
Found programming Unix a hurdle ~
|
||||||
|
|
||||||
The "O" command (uppercase) opens a line above the cursor.
|
The "O" command (uppercase) opens a line above the cursor.
|
||||||
|
|
||||||
@@ -518,9 +516,11 @@ Summary: *help-summary* >
|
|||||||
:help subject()
|
:help subject()
|
||||||
< Function "subject". >
|
< Function "subject". >
|
||||||
:help -subject
|
:help -subject
|
||||||
< Command-line option "-subject". >
|
< Command-line argument "-subject". >
|
||||||
:help +subject
|
:help +subject
|
||||||
< Compile-time feature "+subject". >
|
< Compile-time feature "+subject". >
|
||||||
|
:help /*
|
||||||
|
< Regular expression item "*" >
|
||||||
:help EventName
|
:help EventName
|
||||||
< Autocommand event "EventName". >
|
< Autocommand event "EventName". >
|
||||||
:help digraphs.txt
|
:help digraphs.txt
|
||||||
|
@@ -528,7 +528,7 @@ MATCHING ANY SINGLE CHARACTER
|
|||||||
|
|
||||||
The . (dot) character matches any existing character. For example, the
|
The . (dot) character matches any existing character. For example, the
|
||||||
pattern "c.m" matches a string whose first character is a c, whose second
|
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. ~
|
We use a computer that became the cummin winter. ~
|
||||||
xxx xxx xxx
|
xxx xxx xxx
|
||||||
|
@@ -285,7 +285,6 @@ Where can you find plugins?
|
|||||||
- You could write one yourself, see |write-plugin|.
|
- You could write one yourself, see |write-plugin|.
|
||||||
|
|
||||||
Some plugins come as a vimball archive, see |vimball|.
|
Some plugins come as a vimball archive, see |vimball|.
|
||||||
Some plugins can be updated automatically, see |getscript|.
|
|
||||||
|
|
||||||
|
|
||||||
USING A GLOBAL PLUGIN
|
USING A GLOBAL PLUGIN
|
||||||
|
@@ -134,10 +134,10 @@ The following command makes the mouse work like a Microsoft Windows mouse: >
|
|||||||
|
|
||||||
:behave mswin
|
:behave mswin
|
||||||
|
|
||||||
The default behavior of the mouse on UNIX systems is xterm. The default
|
The default behavior of the mouse on Unix systems is xterm. The default
|
||||||
behavior on a Microsoft Windows system is selected during the installation
|
behavior on Windows systems is selected during the installation process. For
|
||||||
process. For details about what the two behaviors are, see |:behave|. Here
|
details about what the two behaviors are, see |:behave|. Here follows a
|
||||||
follows a summary.
|
summary.
|
||||||
|
|
||||||
|
|
||||||
XTERM MOUSE BEHAVIOR
|
XTERM MOUSE BEHAVIOR
|
||||||
|
@@ -698,10 +698,10 @@ still be something that an external command can do better or faster.
|
|||||||
through an external program. In other words, it runs the system command
|
through an external program. In other words, it runs the system command
|
||||||
represented by {program}, giving it the block of text represented by {motion}
|
represented by {program}, giving it the block of text represented by {motion}
|
||||||
as input. The output of this command then replaces the selected block.
|
as input. The output of this command then replaces the selected block.
|
||||||
Because this summarizes badly if you are unfamiliar with UNIX filters, take
|
Because this summarizes badly if you are unfamiliar with Unix filters, take
|
||||||
a look at an example. The sort command sorts a file. If you execute the
|
a look at an example. The sort command sorts a file. If you execute the
|
||||||
following command, the unsorted file input.txt will be sorted and written to
|
following command, the unsorted file input.txt will be sorted and written to
|
||||||
output.txt. (This works on both UNIX and Microsoft Windows.) >
|
output.txt. This works on both Unix and Windows. >
|
||||||
|
|
||||||
sort <input.txt >output.txt
|
sort <input.txt >output.txt
|
||||||
|
|
||||||
|
@@ -293,7 +293,6 @@ If you really don't want to see this message, you can add the 'A' flag to the
|
|||||||
'updatecount' Number of key strokes after which the swap file is flushed to
|
'updatecount' Number of key strokes after which the swap file is flushed to
|
||||||
disk.
|
disk.
|
||||||
'updatetime' Timeout after which the swap file is flushed to disk.
|
'updatetime' Timeout after which the swap file is flushed to disk.
|
||||||
'swapsync' Whether the disk is synced when the swap file is flushed.
|
|
||||||
'directory' List of directory names where to store the swap file.
|
'directory' List of directory names where to store the swap file.
|
||||||
'maxmem' Limit for memory usage before writing text to the swap file.
|
'maxmem' Limit for memory usage before writing text to the swap file.
|
||||||
'maxmemtot' Same, but for all files in total.
|
'maxmemtot' Same, but for all files in total.
|
||||||
|
@@ -309,7 +309,7 @@ matches can be found.
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
*12.8* Find where a word is used
|
*12.8* Find where a word is used
|
||||||
|
|
||||||
If you are a UNIX user, you can use a combination of Vim and the grep command
|
If you are a Unix user, you can use a combination of Vim and the grep command
|
||||||
to edit all the files that contain a given word. This is extremely useful if
|
to edit all the files that contain a given word. This is extremely useful if
|
||||||
you are working on a program and want to view or edit all the files that
|
you are working on a program and want to view or edit all the files that
|
||||||
contain a specific variable.
|
contain a specific variable.
|
||||||
@@ -324,7 +324,7 @@ will only list the files containing the word and not print the matching lines.
|
|||||||
The word it is searching for is "frame_counter". Actually, this can be any
|
The word it is searching for is "frame_counter". Actually, this can be any
|
||||||
regular expression. (Note: What grep uses for regular expressions is not
|
regular expression. (Note: What grep uses for regular expressions is not
|
||||||
exactly the same as what Vim uses.)
|
exactly the same as what Vim uses.)
|
||||||
The entire command is enclosed in backticks (`). This tells the UNIX shell
|
The entire command is enclosed in backticks (`). This tells the Unix shell
|
||||||
to run this command and pretend that the results were typed on the command
|
to run this command and pretend that the results were typed on the command
|
||||||
line. So what happens is that the grep command is run and produces a list of
|
line. So what happens is that the grep command is run and produces a list of
|
||||||
files, these files are put on the Vim command line. This results in Vim
|
files, these files are put on the Vim command line. This results in Vim
|
||||||
|
@@ -70,9 +70,7 @@ difference. Without it executes the program normally, with the range a number
|
|||||||
of text lines is filtered through the program.
|
of text lines is filtered through the program.
|
||||||
|
|
||||||
Executing a whole row of programs this way is possible. But a shell is much
|
Executing a whole row of programs this way is possible. But a shell is much
|
||||||
better at it. You can start a new shell this way: >
|
better at it. You can start a new shell with |:terminal|.
|
||||||
|
|
||||||
:shell
|
|
||||||
|
|
||||||
This is similar to using CTRL-Z to suspend Vim. The difference is that a new
|
This is similar to using CTRL-Z to suspend Vim. The difference is that a new
|
||||||
shell is started.
|
shell is started.
|
||||||
|
@@ -25,7 +25,7 @@ Back in the early days, the old Teletype machines used two characters to
|
|||||||
start a new line. One to move the carriage back to the first position
|
start a new line. One to move the carriage back to the first position
|
||||||
(carriage return, <CR>), another to move the paper up (line feed, <LF>).
|
(carriage return, <CR>), another to move the paper up (line feed, <LF>).
|
||||||
When computers came out, storage was expensive. Some people decided that
|
When computers came out, storage was expensive. Some people decided that
|
||||||
they did not need two characters for end-of-line. The UNIX people decided
|
they did not need two characters for end-of-line. The Unix people decided
|
||||||
they could use <Line Feed> only for end-of-line. The Apple people
|
they could use <Line Feed> only for end-of-line. The Apple people
|
||||||
standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to
|
standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to
|
||||||
keep the old <CR><LF>.
|
keep the old <CR><LF>.
|
||||||
@@ -34,7 +34,7 @@ have line-break problems. The Vim editor automatically recognizes the
|
|||||||
different file formats and handles things properly behind your back.
|
different file formats and handles things properly behind your back.
|
||||||
The option 'fileformats' contains the various formats that will be tried
|
The option 'fileformats' contains the various formats that will be tried
|
||||||
when a new file is edited. The following command, for example, tells Vim to
|
when a new file is edited. The following command, for example, tells Vim to
|
||||||
try UNIX format first and MS-DOS format second: >
|
try Unix format first and MS-DOS format second: >
|
||||||
|
|
||||||
:set fileformats=unix,dos
|
:set fileformats=unix,dos
|
||||||
|
|
||||||
@@ -97,12 +97,12 @@ CONVERSION
|
|||||||
|
|
||||||
You can use the 'fileformat' option to convert from one file format to
|
You can use the 'fileformat' option to convert from one file format to
|
||||||
another. Suppose, for example, that you have an MS-DOS file named README.TXT
|
another. Suppose, for example, that you have an MS-DOS file named README.TXT
|
||||||
that you want to convert to UNIX format. Start by editing the MS-DOS format
|
that you want to convert to Unix format. Start by editing the MS-DOS format
|
||||||
file: >
|
file: >
|
||||||
vim README.TXT
|
vim README.TXT
|
||||||
|
|
||||||
Vim will recognize this as a dos format file. Now change the file format to
|
Vim will recognize this as a dos format file. Now change the file format to
|
||||||
UNIX: >
|
Unix: >
|
||||||
|
|
||||||
:set fileformat=unix
|
:set fileformat=unix
|
||||||
:write
|
:write
|
||||||
|
@@ -563,9 +563,9 @@ that combination. Thus CTRL-K dP also works. Since there is no digraph for
|
|||||||
"dP" Vim will also search for a "Pd" digraph.
|
"dP" Vim will also search for a "Pd" digraph.
|
||||||
|
|
||||||
Note:
|
Note:
|
||||||
The digraphs depend on the character set that Vim assumes you are
|
The digraphs depend on the character set that Vim assumes you
|
||||||
using. On MS-DOS they are different from MS-Windows. Always use
|
are using. Always use ":digraphs" to find out which digraphs are
|
||||||
":digraphs" to find out which digraphs are currently available.
|
currently available.
|
||||||
|
|
||||||
You can define your own digraphs. Example: >
|
You can define your own digraphs. Example: >
|
||||||
|
|
||||||
|
@@ -83,7 +83,7 @@ matter if 'ignorecase' or 'smartcase' was changed.
|
|||||||
|
|
||||||
Note:
|
Note:
|
||||||
If your search takes much longer than you expected, you can interrupt
|
If your search takes much longer than you expected, you can interrupt
|
||||||
it with CTRL-C on Unix and CTRL-Break on MS-DOS and MS-Windows.
|
it with CTRL-C on Unix and CTRL-Break on Windows.
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
*27.2* Wrapping around the file end
|
*27.2* Wrapping around the file end
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
*usr_41.txt* For Vim version 7.4. Last change: 2014 Aug 16
|
*usr_41.txt* For Vim version 7.4. Last change: 2015 Nov 30
|
||||||
|
|
||||||
VIM USER MANUAL - by Bram Moolenaar
|
VIM USER MANUAL - by Bram Moolenaar
|
||||||
|
|
||||||
@@ -888,6 +888,11 @@ Mappings: *mapping-functions*
|
|||||||
maparg() get rhs of a mapping
|
maparg() get rhs of a mapping
|
||||||
wildmenumode() check if the wildmode is active
|
wildmenumode() check if the wildmode is active
|
||||||
|
|
||||||
|
Testing: *test-functions*
|
||||||
|
assert_equal() assert that two expressions values are equal
|
||||||
|
assert_false() assert that an expression is false
|
||||||
|
assert_true() assert that an expression is true
|
||||||
|
|
||||||
Various: *various-functions*
|
Various: *various-functions*
|
||||||
mode() get current editing mode
|
mode() get current editing mode
|
||||||
visualmode() last visual mode used
|
visualmode() last visual mode used
|
||||||
@@ -1494,8 +1499,8 @@ Here is a summary of items that apply to Vim scripts. They are also mentioned
|
|||||||
elsewhere, but form a nice checklist.
|
elsewhere, but form a nice checklist.
|
||||||
|
|
||||||
The end-of-line character depends on the system. For Unix a single <NL>
|
The end-of-line character depends on the system. For Unix a single <NL>
|
||||||
character is used. For MS-DOS, Windows and the like, <CR><LF> is used.
|
character is used. For Windows <CR><LF> is used. This is important when
|
||||||
This is important when using mappings that end in a <CR>. See |:source_crnl|.
|
using mappings that end in a <CR>. See |:source_crnl|.
|
||||||
|
|
||||||
|
|
||||||
WHITE SPACE
|
WHITE SPACE
|
||||||
@@ -2465,8 +2470,6 @@ utility is recommended.
|
|||||||
For utmost portability use Vim itself to pack scripts together. This can be
|
For utmost portability use Vim itself to pack scripts together. This can be
|
||||||
done with the Vimball utility. See |vimball|.
|
done with the Vimball utility. See |vimball|.
|
||||||
|
|
||||||
It's good if you add a line to allow automatic updating. See |glvs-plugins|.
|
|
||||||
|
|
||||||
==============================================================================
|
==============================================================================
|
||||||
|
|
||||||
Next chapter: |usr_42.txt| Add new menus
|
Next chapter: |usr_42.txt| Add new menus
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user