mirror of
https://github.com/zoriya/vim.git
synced 2025-12-25 16:45:26 +00:00
Compare commits
575 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
899dddf888 | ||
|
|
5c6a2d5323 | ||
|
|
bd404149f7 | ||
|
|
42bbef4a49 | ||
|
|
fa1d140a2c | ||
|
|
2217cae0c0 | ||
|
|
1a14c2ccd1 | ||
|
|
c17ef8ef36 | ||
|
|
7fcab2a02c | ||
|
|
76b92b2830 | ||
|
|
c01140a1a0 | ||
|
|
db552d60ec | ||
|
|
7b5f8325ee | ||
|
|
8ab561d31e | ||
|
|
e580b0c34d | ||
|
|
433f7c88d5 | ||
|
|
76916e60ed | ||
|
|
eee697b748 | ||
|
|
b3656edcb9 | ||
|
|
9b2200acd6 | ||
|
|
0126585dbb | ||
|
|
371d5403d0 | ||
|
|
ceaf7b8b66 | ||
|
|
39f05630ad | ||
|
|
c15ef30c08 | ||
|
|
e0fa560e6f | ||
|
|
2c93230f48 | ||
|
|
97b2ad3542 | ||
|
|
658b74a736 | ||
|
|
8d6ea5eb4f | ||
|
|
be4d506b5f | ||
|
|
f0acfce534 | ||
|
|
ca003e1e4f | ||
|
|
68f1a48647 | ||
|
|
a83c3e0ebd | ||
|
|
ea0cd36bdd | ||
|
|
2eb25daffd | ||
|
|
efd2bf158a | ||
|
|
d3667a2e29 | ||
|
|
cf03447964 | ||
|
|
27dc19509b | ||
|
|
95e9b49537 | ||
|
|
9d47f1707b | ||
|
|
7d47b6eed7 | ||
|
|
5671873089 | ||
|
|
c4675a193d | ||
|
|
db00351723 | ||
|
|
114216c417 | ||
|
|
34e9e2f13d | ||
|
|
a9a568ca77 | ||
|
|
2092d32231 | ||
|
|
1f4d4de1ba | ||
|
|
3b1ddfed51 | ||
|
|
c7d893589e | ||
|
|
af48b0924f | ||
|
|
0ce29937aa | ||
|
|
1e60789f9b | ||
|
|
019ff6825b | ||
|
|
346d743df2 | ||
|
|
35a2e197cf | ||
|
|
3c56a964af | ||
|
|
a1956f6b07 | ||
|
|
17be7e614e | ||
|
|
5316eee835 | ||
|
|
1c8f93ff02 | ||
|
|
b9a02fc557 | ||
|
|
600dddcf66 | ||
|
|
1fc0046932 | ||
|
|
c4956c8d1d | ||
|
|
2b48ad5cd7 | ||
|
|
5baddf0285 | ||
|
|
60f8377e42 | ||
|
|
f71a3db47e | ||
|
|
e48ec1fa6b | ||
|
|
a5b6ad13ef | ||
|
|
eb94e559e0 | ||
|
|
038221bcd0 | ||
|
|
d289f1315f | ||
|
|
c270d806f8 | ||
|
|
96d2c5b5be | ||
|
|
838bb71992 | ||
|
|
0b598c2fda | ||
|
|
d996771378 | ||
|
|
8ee8926785 | ||
|
|
ade0083d3a | ||
|
|
a94bc430e8 | ||
|
|
5c4bab0fe7 | ||
|
|
eca1575717 | ||
|
|
4e42719355 | ||
|
|
1056d98844 | ||
|
|
4ea8fe1d06 | ||
|
|
0fd9289de3 | ||
|
|
a3227e2b15 | ||
|
|
1f35bf9cab | ||
|
|
a203182302 | ||
|
|
362e1a30c6 | ||
|
|
768b8c4dbc | ||
|
|
87b5ca5172 | ||
|
|
36fc535cb1 | ||
|
|
d0131a8bd2 | ||
|
|
0e34f6269e | ||
|
|
3517bb1ece | ||
|
|
65c923adf3 | ||
|
|
bfb2d40b6e | ||
|
|
a55252087b | ||
|
|
8fd89f0fe7 | ||
|
|
0b23879827 | ||
|
|
c06ac34092 | ||
|
|
b475fb917b | ||
|
|
261bfeab3e | ||
|
|
fd2ac767eb | ||
|
|
e1438bb8d0 | ||
|
|
e224ffa156 | ||
|
|
03f4855fc2 | ||
|
|
b388adb188 | ||
|
|
5e3cb7e869 | ||
|
|
eddf53b02e | ||
|
|
a23ccb8ac6 | ||
|
|
1cad292503 | ||
|
|
a226a6dd9f | ||
|
|
a562149de3 | ||
|
|
5c8837f9d7 | ||
|
|
c542aef58d | ||
|
|
ba6c05240f | ||
|
|
32466aa2e9 | ||
|
|
2a3f7eeebf | ||
|
|
df1bdc92c2 | ||
|
|
80a94a582c | ||
|
|
d1f56e68f1 | ||
|
|
238a564935 | ||
|
|
8f7fd65b24 | ||
|
|
030f0dfad5 | ||
|
|
faa959a870 | ||
|
|
70836c8ba8 | ||
|
|
2a0449d129 | ||
|
|
7e8fd63682 | ||
|
|
997fb4ba69 | ||
|
|
49d7bf13e0 | ||
|
|
f740b29ae2 | ||
|
|
4c7ed462cb | ||
|
|
e45828b593 | ||
|
|
98ea5defcf | ||
|
|
1d2ba7fa85 | ||
|
|
f52c725c47 | ||
|
|
c7453f52d4 | ||
|
|
110bc6bc91 | ||
|
|
06b5db9397 | ||
|
|
3d0a603fa9 | ||
|
|
754b56089f | ||
|
|
cf0c554e3f | ||
|
|
8b6144bdfe | ||
|
|
9f2c6e1deb | ||
|
|
a65576059f | ||
|
|
41cabdadc2 | ||
|
|
a37420f46f | ||
|
|
0e5bd96f84 | ||
|
|
986920760e | ||
|
|
49315f65c9 | ||
|
|
1ef15e30a0 | ||
|
|
afeb4fa8a7 | ||
|
|
b8a7b560b1 | ||
|
|
280f126ef0 | ||
|
|
17c7c01170 | ||
|
|
51156d5a87 | ||
|
|
6ab5b84db4 | ||
|
|
d12f5c17be | ||
|
|
28c258fd24 | ||
|
|
7df351eb8a | ||
|
|
09df3127f4 | ||
|
|
33aec765bd | ||
|
|
71fe80dddd | ||
|
|
66fa271a25 | ||
|
|
0ac9379acf | ||
|
|
c716c306e9 | ||
|
|
b1b715d1fb | ||
|
|
b71eaaeaa8 | ||
|
|
2d3f489e09 | ||
|
|
8ada17c4d9 | ||
|
|
05a7bb363b | ||
|
|
c32840f267 | ||
|
|
04dbce064e | ||
|
|
316059c019 | ||
|
|
ea8bd73212 | ||
|
|
a40ceaf88a | ||
|
|
4770d09abd | ||
|
|
1cbe5f739d | ||
|
|
c7486e034e | ||
|
|
86e01085a1 | ||
|
|
371baa928d | ||
|
|
ebefac63f3 | ||
|
|
cc984263d7 | ||
|
|
0ce33f34a4 | ||
|
|
8fa0445c4f | ||
|
|
5c2f050d91 | ||
|
|
f4cd3e8074 | ||
|
|
bb1004ee56 | ||
|
|
a9b1e74b5d | ||
|
|
195d6357b4 | ||
|
|
46b8015066 | ||
|
|
e3226be91a | ||
|
|
d35f9711d4 | ||
|
|
da1b1a7357 | ||
|
|
3b18181f28 | ||
|
|
acf534595b | ||
|
|
97d29a1ace | ||
|
|
146522e760 | ||
|
|
83c465c705 | ||
|
|
12033fb4bf | ||
|
|
bca84a12bd | ||
|
|
38f1825274 | ||
|
|
61da4986dd | ||
|
|
6496966ad1 | ||
|
|
b2c2efa53a | ||
|
|
c6d8db78b1 | ||
|
|
b0bf8580c3 | ||
|
|
900b4d77f0 | ||
|
|
2c7a29c7fd | ||
|
|
5b962cf71c | ||
|
|
63a121b750 | ||
|
|
b348038631 | ||
|
|
292ad19e92 | ||
|
|
cdbac1ee33 | ||
|
|
cc016f5410 | ||
|
|
e5180526fd | ||
|
|
24552beda0 | ||
|
|
43abc52195 | ||
|
|
ba930509b0 | ||
|
|
18f9a79673 | ||
|
|
77197e44d6 | ||
|
|
d5bc83f576 | ||
|
|
4e330bbf21 | ||
|
|
b815dac061 | ||
|
|
be79f90adc | ||
|
|
e64ac77a28 | ||
|
|
241a8aaa48 | ||
|
|
9372a11ca6 | ||
|
|
cef9dcc37e | ||
|
|
943d2b5b80 | ||
|
|
f4d1145328 | ||
|
|
c6039d8fcb | ||
|
|
bba577a242 | ||
|
|
36c31f71ad | ||
|
|
9835862c81 | ||
|
|
a39571032c | ||
|
|
c64d13ad5b | ||
|
|
16d8f87b45 | ||
|
|
5fe38612c9 | ||
|
|
3d2381ec09 | ||
|
|
b4d392824a | ||
|
|
12625caaa3 | ||
|
|
1afcace307 | ||
|
|
c20658076d | ||
|
|
a5792f5890 | ||
|
|
af289d333a | ||
|
|
a5fac54aea | ||
|
|
61036991ab | ||
|
|
8349fd7c7e | ||
|
|
784c614cb1 | ||
|
|
95b28ecc4a | ||
|
|
202795bed4 | ||
|
|
a5fb28b609 | ||
|
|
d5cdbeb8dd | ||
|
|
196dfbcca1 | ||
|
|
ac30844d60 | ||
|
|
4b77947252 | ||
|
|
8d4f404a7b | ||
|
|
9b9714bee4 | ||
|
|
761b1131b8 | ||
|
|
07d4d7328a | ||
|
|
1c7715dfe4 | ||
|
|
bb15b65864 | ||
|
|
69e0ff94dc | ||
|
|
c54b8a78fa | ||
|
|
f25fd51b89 | ||
|
|
4effc80a8c | ||
|
|
482aaeb058 | ||
|
|
4463f296d0 | ||
|
|
1e01546026 | ||
|
|
bfd8fc0529 | ||
|
|
60a795aad6 | ||
|
|
6b730e111c | ||
|
|
58071af793 | ||
|
|
ab194816fe | ||
|
|
cd292719e0 | ||
|
|
4c903f9891 | ||
|
|
e6facf9490 | ||
|
|
f75a963eea | ||
|
|
5e0d6678ad | ||
|
|
6efa2b30f4 | ||
|
|
dcca87b394 | ||
|
|
578b49e4f7 | ||
|
|
32330d3c67 | ||
|
|
d43b6cf7de | ||
|
|
a4a0838802 | ||
|
|
e7eb9df59a | ||
|
|
a5373faa17 | ||
|
|
7ca3043e1e | ||
|
|
7bb4c6e3f6 | ||
|
|
caa0fcfa6b | ||
|
|
4615234489 | ||
|
|
ffb8ab0402 | ||
|
|
d1231f991a | ||
|
|
cafda4f893 | ||
|
|
4440382f3c | ||
|
|
dd2436f352 | ||
|
|
92d640fad1 | ||
|
|
8b96d64cb5 | ||
|
|
e344bead3e | ||
|
|
da2303d96b | ||
|
|
ac6e65f88d | ||
|
|
81f1ecbc4d | ||
|
|
955295684b | ||
|
|
6e7c7f3a19 | ||
|
|
5bcb2eba3d | ||
|
|
6de6853ce3 | ||
|
|
a2036d2b48 | ||
|
|
6f16eb817b | ||
|
|
7862282f2e | ||
|
|
a6c840d7d4 | ||
|
|
e52325c254 | ||
|
|
d52d9741ee | ||
|
|
90915b5d48 | ||
|
|
50c8195012 | ||
|
|
cee5560a4b | ||
|
|
d12a132603 | ||
|
|
8aff23a13e | ||
|
|
5195e45609 | ||
|
|
5b8d8fdb52 | ||
|
|
ae5bce1c12 | ||
|
|
90cfdbe040 | ||
|
|
e5b8e3d3c6 | ||
|
|
8c45cdf4cf | ||
|
|
488c6512d9 | ||
|
|
8b1e71fa25 | ||
|
|
8b59de9f2f | ||
|
|
0fa313a718 | ||
|
|
c388fbf9d9 | ||
|
|
670f9312cc | ||
|
|
aba2f487ff | ||
|
|
4f574c8ab1 | ||
|
|
329cc7e429 | ||
|
|
8af244281c | ||
|
|
f57907ec2c | ||
|
|
f6cf987574 | ||
|
|
648120b750 | ||
|
|
572cb561ac | ||
|
|
86eb7a2c03 | ||
|
|
0be6e647d1 | ||
|
|
1d94f9b30e | ||
|
|
04a09c1975 | ||
|
|
83bab71b3c | ||
|
|
d314b2519b | ||
|
|
ecf07c8910 | ||
|
|
78984f503c | ||
|
|
53805d1eaa | ||
|
|
34cf2f5f49 | ||
|
|
25ceb22747 | ||
|
|
5a8684e782 | ||
|
|
3a6c56e422 | ||
|
|
403bd9487a | ||
|
|
4be06f9e1b | ||
|
|
661b182095 | ||
|
|
cfc7d63267 | ||
|
|
87e25fdf80 | ||
|
|
231334e6ef | ||
|
|
027436338b | ||
|
|
c013cb66a6 | ||
|
|
81366db6d6 | ||
|
|
65de869c4f | ||
|
|
58d9823409 | ||
|
|
b01585904a | ||
|
|
d8c0087cce | ||
|
|
63b3ce8757 | ||
|
|
342337a1a0 | ||
|
|
4536002e30 | ||
|
|
a3ffd9c780 | ||
|
|
80fc04348a | ||
|
|
87b774daf2 | ||
|
|
84fb85aaf6 | ||
|
|
fd6e52886b | ||
|
|
7b30e18223 | ||
|
|
0e634daa95 | ||
|
|
84110acb60 | ||
|
|
6a9aa37a3e | ||
|
|
9fad308621 | ||
|
|
ff6f061a9d | ||
|
|
d6c04cd66a | ||
|
|
6c131c43ff | ||
|
|
e7c5a15631 | ||
|
|
f8c07b2712 | ||
|
|
ce0842a6ee | ||
|
|
bbebc85750 | ||
|
|
fe3ca8ddd9 | ||
|
|
b635633989 | ||
|
|
e759a7aa9a | ||
|
|
8d34330fe5 | ||
|
|
1f28b07867 | ||
|
|
5eba4c2daf | ||
|
|
a40058acc7 | ||
|
|
3b56eb3d31 | ||
|
|
9ff7011bcb | ||
|
|
d8e9bb2090 | ||
|
|
35fdbb540a | ||
|
|
a466c99842 | ||
|
|
ac76e4dd91 | ||
|
|
51bab74a87 | ||
|
|
8d7fc6c298 | ||
|
|
e8bb2552eb | ||
|
|
045e82deef | ||
|
|
63b80986ac | ||
|
|
ec8a10a4e4 | ||
|
|
97409f1261 | ||
|
|
8e735a17f8 | ||
|
|
42332f5856 | ||
|
|
dc27ac1c5e | ||
|
|
bfb2006fd5 | ||
|
|
551f84f4e8 | ||
|
|
1756879365 | ||
|
|
53180ce2e7 | ||
|
|
dfb9ac0021 | ||
|
|
0dc065ee7c | ||
|
|
7d1f5dbc0a | ||
|
|
51ac12f683 | ||
|
|
0d9c26dd83 | ||
|
|
f9184a1d31 | ||
|
|
0f7d31ad83 | ||
|
|
1f8a5f0eac | ||
|
|
ba4128faa3 | ||
|
|
7887d88a9f | ||
|
|
505e82870e | ||
|
|
7fae636fc8 | ||
|
|
d042c56e34 | ||
|
|
e6b165e0f4 | ||
|
|
9c96f592af | ||
|
|
42eeac3552 | ||
|
|
24bbcfe8fe | ||
|
|
d7b31706f7 | ||
|
|
a1ba811ac9 | ||
|
|
9a50b1bf21 | ||
|
|
39a58ca3d4 | ||
|
|
d4098f5f19 | ||
|
|
702517dd70 | ||
|
|
b61d40504e | ||
|
|
cf6bf39f68 | ||
|
|
238f4fa798 | ||
|
|
d9fba318b8 | ||
|
|
80b29f273d | ||
|
|
1e498f5e5d | ||
|
|
0017fc52cb | ||
|
|
4eec5ec8ce | ||
|
|
f461c8e7f8 | ||
|
|
ea408854a8 | ||
|
|
29a1c1d374 | ||
|
|
1ec484f58e | ||
|
|
0a5fe2140d | ||
|
|
c4def13f8b | ||
|
|
3b506942eb | ||
|
|
47cc752267 | ||
|
|
f417f2b6af | ||
|
|
f81b0fe011 | ||
|
|
6ad01d6077 | ||
|
|
30abd28f16 | ||
|
|
d114dbee50 | ||
|
|
0c40586a7b | ||
|
|
0dd492fdd5 | ||
|
|
d857f0e0f4 | ||
|
|
3f77047607 | ||
|
|
25414f2917 | ||
|
|
e13305e3be | ||
|
|
3c2def6bd2 | ||
|
|
1d73c88503 | ||
|
|
92124a33fd | ||
|
|
b2ec307fc6 | ||
|
|
e756604ff5 | ||
|
|
f7bbbc506e | ||
|
|
8db7318c2a | ||
|
|
520470a9d6 | ||
|
|
6bab4d1fd7 | ||
|
|
cf851ce930 | ||
|
|
ea424166e2 | ||
|
|
78599adb52 | ||
|
|
c998e3c16e | ||
|
|
f3bd51a172 | ||
|
|
a41461e061 | ||
|
|
8348ea624c | ||
|
|
9f30f50471 | ||
|
|
9ba0eb850c | ||
|
|
bac97eb8ae | ||
|
|
eaa48e7d41 | ||
|
|
3638c6876d | ||
|
|
f3681cc330 | ||
|
|
c669e66fb6 | ||
|
|
3eb98fbbd8 | ||
|
|
3982c54106 | ||
|
|
0e4d877ed8 | ||
|
|
82cf9b6851 | ||
|
|
c4a06d3447 | ||
|
|
78916d7c3b | ||
|
|
631d6f6847 | ||
|
|
b765d63491 | ||
|
|
86bc1fb004 | ||
|
|
45eeb13324 | ||
|
|
cfc6c43ce2 | ||
|
|
fb67026c27 | ||
|
|
aeb25e1f15 | ||
|
|
08e310e2a2 | ||
|
|
bc045ea87a | ||
|
|
50cde8273e | ||
|
|
75c50c46a6 | ||
|
|
51485f0624 | ||
|
|
4debb442bd | ||
|
|
6c0b44b5bf | ||
|
|
d6f676daaf | ||
|
|
2c29beed4c | ||
|
|
0cde940475 | ||
|
|
54ee775e9d | ||
|
|
5c06f8b043 | ||
|
|
a04f10b606 | ||
|
|
8b044b3264 | ||
|
|
d6ec8454b0 | ||
|
|
0e6830e009 | ||
|
|
21de6660e1 | ||
|
|
01a7b9dd06 | ||
|
|
389cb3eb25 | ||
|
|
ee0446cf60 | ||
|
|
67fe1a1336 | ||
|
|
de934d77b1 | ||
|
|
2389c3c640 | ||
|
|
0d40699d6d | ||
|
|
f95dc3b823 | ||
|
|
f4630b60f5 | ||
|
|
c930a3cc82 | ||
|
|
35c54e5651 | ||
|
|
c1087e64bc | ||
|
|
686f51ef8e | ||
|
|
555b280f28 | ||
|
|
051b782fa0 | ||
|
|
9c13b359b4 | ||
|
|
34cdc3e329 | ||
|
|
a7fc0101b2 | ||
|
|
142695f3c5 | ||
|
|
d9d305836e | ||
|
|
d8a4e563d0 | ||
|
|
c9a2d2e240 | ||
|
|
dba8a917ba | ||
|
|
46df82e4eb | ||
|
|
c91506a033 | ||
|
|
2a489f5fdd | ||
|
|
41bfd309b8 | ||
|
|
6f3058f6b4 | ||
|
|
86261f63f8 | ||
|
|
0cb032ecb8 | ||
|
|
8fcc0f71a1 | ||
|
|
091271e19f | ||
|
|
8fef2ad609 | ||
|
|
54ff3419c7 | ||
|
|
9d0ec2e49a | ||
|
|
1f74d98357 | ||
|
|
f3d8cff9d0 | ||
|
|
4ee034d26b | ||
|
|
2cf8b301df | ||
|
|
2c5bc17eb7 | ||
|
|
5c5474b386 | ||
|
|
fe5cafe9b4 | ||
|
|
b6b6dc8973 | ||
|
|
310f10370b | ||
|
|
63d5a1e57b | ||
|
|
0e21a3f623 | ||
|
|
99942f0b16 | ||
|
|
5482f33f78 | ||
|
|
075757c932 | ||
|
|
37799766b0 | ||
|
|
13fcaaf195 | ||
|
|
402d2fea70 | ||
|
|
4499d2ee58 |
8
Contents
8
Contents
@@ -9,10 +9,10 @@ Vim Vi IMproved. A clone of the UNIX text editor Vi. Very useful
|
||||
messages, shows current file name in window title, on-line
|
||||
help, rectangular cut/paste, etc., etc., etc...
|
||||
|
||||
Version 7.0aa. Also runs under UNIX, MSDOS and other systems.
|
||||
vim70aart.tgz contains the documentation and syntax files.
|
||||
vim70aabin.tgz contains the binaries.
|
||||
vim70aasrc.tgz contains the sources.
|
||||
Version 7.0b. Also runs under UNIX, MSDOS and other systems.
|
||||
vim70brt.tgz contains the documentation and syntax files.
|
||||
vim70bbin.tgz contains the binaries.
|
||||
vim70bsrc.tgz contains the sources.
|
||||
Author: Bram Moolenaar et al.
|
||||
|
||||
|
||||
|
||||
70
Filelist
70
Filelist
@@ -2,7 +2,7 @@
|
||||
# Used by Makefile and upload.aap.
|
||||
|
||||
# source files for all source archives
|
||||
SRC_ALL1 = \
|
||||
SRC_ALL = \
|
||||
src/README.txt \
|
||||
src/arabic.c \
|
||||
src/arabic.h \
|
||||
@@ -30,7 +30,8 @@ SRC_ALL1 = \
|
||||
src/gui.h \
|
||||
src/gui_beval.c \
|
||||
src/gui_beval.h \
|
||||
src/hashtable.c \
|
||||
src/hardcopy.c \
|
||||
src/hashtab.c \
|
||||
src/keymap.h \
|
||||
src/macros.h \
|
||||
src/main.c \
|
||||
@@ -51,6 +52,7 @@ SRC_ALL1 = \
|
||||
src/ops.c \
|
||||
src/option.c \
|
||||
src/option.h \
|
||||
src/popupmnu.c \
|
||||
src/quickfix.c \
|
||||
src/regexp.c \
|
||||
src/regexp.h \
|
||||
@@ -70,13 +72,12 @@ SRC_ALL1 = \
|
||||
src/vim.h \
|
||||
src/window.c \
|
||||
src/xxd/xxd.c \
|
||||
|
||||
SRC_ALL2 = \
|
||||
src/main.aap \
|
||||
src/testdir/main.aap \
|
||||
src/testdir/*.in \
|
||||
src/testdir/test[0-9]*.ok \
|
||||
src/testdir/test49.vim \
|
||||
src/testdir/test60.vim \
|
||||
src/proto.h \
|
||||
src/proto/buffer.pro \
|
||||
src/proto/charset.pro \
|
||||
@@ -94,7 +95,8 @@ SRC_ALL2 = \
|
||||
src/proto/getchar.pro \
|
||||
src/proto/gui.pro \
|
||||
src/proto/gui_beval.pro \
|
||||
src/proto/hashtable.pro \
|
||||
src/proto/hardcopy.pro \
|
||||
src/proto/hashtab.pro \
|
||||
src/proto/main.pro \
|
||||
src/proto/mark.pro \
|
||||
src/proto/mbyte.pro \
|
||||
@@ -109,6 +111,7 @@ SRC_ALL2 = \
|
||||
src/proto/normal.pro \
|
||||
src/proto/ops.pro \
|
||||
src/proto/option.pro \
|
||||
src/proto/popupmnu.pro \
|
||||
src/proto/quickfix.pro \
|
||||
src/proto/regexp.pro \
|
||||
src/proto/screen.pro \
|
||||
@@ -134,7 +137,6 @@ SRC_UNIX = \
|
||||
pixmaps/gen-inline-pixbufs.sh \
|
||||
pixmaps/stock_icons.h \
|
||||
src/INSTALL \
|
||||
src/INSTALLkde.txt \
|
||||
src/Makefile \
|
||||
src/auto/configure \
|
||||
src/config.aap.in \
|
||||
@@ -151,11 +153,6 @@ SRC_UNIX = \
|
||||
src/gui_gtk_f.c \
|
||||
src/gui_gtk_f.h \
|
||||
src/gui_gtk_x11.c \
|
||||
src/gui_kde.cc \
|
||||
src/gui_kde_wid.cc \
|
||||
src/gui_kde_wid.h \
|
||||
src/gui_kde_x11.cc \
|
||||
src/kvim_iface.h \
|
||||
src/gui_motif.c \
|
||||
src/gui_xmdlg.c \
|
||||
src/gui_xmebw.c \
|
||||
@@ -181,8 +178,6 @@ SRC_UNIX = \
|
||||
src/proto/gui_athena.pro \
|
||||
src/proto/gui_gtk.pro \
|
||||
src/proto/gui_gtk_x11.pro \
|
||||
src/proto/gui_kde.pro \
|
||||
src/proto/gui_kde_x11.pro \
|
||||
src/proto/gui_motif.pro \
|
||||
src/proto/gui_xmdlg.pro \
|
||||
src/proto/gui_x11.pro \
|
||||
@@ -215,6 +210,7 @@ SRC_DOS_UNIX = \
|
||||
src/if_perlsfio.c \
|
||||
src/if_python.c \
|
||||
src/if_ruby.c \
|
||||
src/if_sniff.h \
|
||||
src/if_tcl.c \
|
||||
src/proto/if_cscope.pro \
|
||||
src/proto/if_mzsch.pro \
|
||||
@@ -252,6 +248,7 @@ SRC_DOS = \
|
||||
src/Make_mvc.mak \
|
||||
src/Make_w16.mak \
|
||||
src/bigvim.bat \
|
||||
src/msvcsetup.bat \
|
||||
src/dimm.idl \
|
||||
src/dlldata.c \
|
||||
src/dosinst.c \
|
||||
@@ -289,6 +286,7 @@ SRC_DOS = \
|
||||
src/uninstal.c \
|
||||
src/vim.def \
|
||||
src/vim.rc \
|
||||
src/vimio.h \
|
||||
src/gvim.exe.mnf \
|
||||
src/vim16.def \
|
||||
src/vim16.rc \
|
||||
@@ -335,7 +333,8 @@ SRC_DOS_BIN = \
|
||||
src/vim.tlb \
|
||||
src/vimtbar.lib \
|
||||
src/vimtbar.dll \
|
||||
nsis/icons \
|
||||
nsis/icons/*.bmp \
|
||||
nsis/icons/*.ico \
|
||||
|
||||
# source files for Amiga, DOS, etc. (also in the extra archive)
|
||||
SRC_AMI_DOS = \
|
||||
@@ -360,21 +359,15 @@ SRC_AMI = \
|
||||
# source files for the Mac (also in the extra archive)
|
||||
SRC_MAC = \
|
||||
src/INSTALLmac.txt \
|
||||
src/Make_mpw.mak \
|
||||
src/dehqx.py \
|
||||
src/gui_mac.c \
|
||||
src/gui_mac.icns \
|
||||
src/gui_mac.r \
|
||||
src/os_mac.build \
|
||||
src/os_mac.c \
|
||||
src/os_mac.h \
|
||||
src/os_mac.rsr.hqx \
|
||||
src/os_mac.sit.hqx \
|
||||
src/os_mac_conv.c \
|
||||
src/os_macosx.c \
|
||||
src/os_mac.pbproj/project.pbxproj \
|
||||
src/proto/gui_mac.pro \
|
||||
src/proto/os_mac.pro \
|
||||
src/proto/os_mac_conv.pro \
|
||||
|
||||
# source files for VMS (in the extra archive)
|
||||
SRC_VMS = \
|
||||
@@ -424,7 +417,6 @@ SRC_EXTRA = \
|
||||
src/gui_riscos.c \
|
||||
src/gui_riscos.h \
|
||||
src/if_sniff.c \
|
||||
src/if_sniff.h \
|
||||
src/infplist.xml \
|
||||
src/link.390 \
|
||||
src/os_beos.c \
|
||||
@@ -456,6 +448,7 @@ RT_ALL = \
|
||||
runtime/gvimrc_example.vim \
|
||||
runtime/macros/README.txt \
|
||||
runtime/macros/dvorak \
|
||||
runtime/macros/editexisting.vim \
|
||||
runtime/macros/hanoi/click.me \
|
||||
runtime/macros/hanoi/hanoi.vim \
|
||||
runtime/macros/hanoi/poster \
|
||||
@@ -506,9 +499,12 @@ RT_SCRIPTS = \
|
||||
runtime/filetype.vim \
|
||||
runtime/scripts.vim \
|
||||
runtime/menu.vim \
|
||||
runtime/macmap.vim \
|
||||
runtime/delmenu.vim \
|
||||
runtime/synmenu.vim \
|
||||
runtime/makemenu.vim \
|
||||
runtime/autoload/*.vim \
|
||||
runtime/autoload/README.txt \
|
||||
runtime/colors/*.vim \
|
||||
runtime/colors/README.txt \
|
||||
runtime/compiler/*.vim \
|
||||
@@ -528,10 +524,6 @@ RT_UNIX = \
|
||||
runtime/KVim.desktop \
|
||||
runtime/hi16-action-make.png \
|
||||
runtime/hi22-action-make.png \
|
||||
runtime/kde-tips \
|
||||
runtime/kvim32x32.png \
|
||||
runtime/kvim48x48.png \
|
||||
runtime/kvim64x64.png \
|
||||
runtime/vim16x16.png \
|
||||
runtime/vim16x16.xpm \
|
||||
runtime/vim32x32.png \
|
||||
@@ -662,8 +654,12 @@ EXTRA = \
|
||||
# generic language files
|
||||
LANG_GEN = \
|
||||
README_lang.txt \
|
||||
runtime/doc/*-fr.1 \
|
||||
runtime/doc/*-fr.UTF-8.1 \
|
||||
runtime/doc/*-it.1 \
|
||||
runtime/doc/*-it.UTF-8.1 \
|
||||
runtime/doc/*-pl.1 \
|
||||
runtime/doc/*-pl.UTF-8.1 \
|
||||
runtime/doc/*-ru.1 \
|
||||
runtime/doc/*-ru.UTF-8.1 \
|
||||
runtime/lang/README.txt \
|
||||
@@ -678,16 +674,36 @@ LANG_GEN = \
|
||||
runtime/tutor/tutor.ko.* \
|
||||
runtime/tutor/tutor.pl.* \
|
||||
runtime/tutor/tutor.ru.* \
|
||||
runtime/tutor/tutor.sk.* \
|
||||
runtime/tutor/tutor.zh.* \
|
||||
runtime/spell/en.spl \
|
||||
runtime/spell/README.txt \
|
||||
runtime/spell/??/*.diff \
|
||||
runtime/spell/??/main.aap \
|
||||
runtime/spell/yi/README.txt \
|
||||
runtime/spell/main.aap \
|
||||
runtime/spell/cleanadd.vim \
|
||||
runtime/spell/*.vim \
|
||||
runtime/spell/fixdup \
|
||||
|
||||
# generic language files, binary
|
||||
LANG_GEN_BIN = \
|
||||
runtime/spell/README_en.txt \
|
||||
runtime/spell/en.ascii.spl \
|
||||
runtime/spell/en.latin1.spl \
|
||||
runtime/spell/en.utf-8.spl \
|
||||
runtime/spell/en.ascii.sug \
|
||||
runtime/spell/en.latin1.sug \
|
||||
runtime/spell/en.utf-8.sug \
|
||||
|
||||
# all files for lang archive
|
||||
LANG_SRC = \
|
||||
src/po/README.txt \
|
||||
src/po/README_mingw.txt \
|
||||
src/po/README_mvc.txt \
|
||||
src/po/check.vim \
|
||||
src/po/cleanup.vim \
|
||||
src/po/Makefile \
|
||||
src/po/Make_cyg.mak \
|
||||
src/po/Make_ming.mak \
|
||||
src/po/Make_mvc.mak \
|
||||
src/po/sjiscorr.c \
|
||||
|
||||
91
Makefile
91
Makefile
@@ -37,8 +37,6 @@ all install uninstall tools config configure proto depend lint tags types test t
|
||||
#
|
||||
# TARGET PRODUCES CONTAINS
|
||||
# unixall vim-#.#.tar.bz2 Runtime files and Sources for Unix
|
||||
# unixrt vim-#.#-rt[12].tar.gz Runtime files for Unix
|
||||
# unixsrc vim-#.#-src[12].tar.gz Sources for Unix
|
||||
#
|
||||
# extra vim-#.#-extra.tar.gz Extra source and runtime files
|
||||
# lang vim-#.#-lang.tar.gz multi-language files
|
||||
@@ -66,24 +64,25 @@ all install uninstall tools config configure proto depend lint tags types test t
|
||||
#
|
||||
# All output files are created in the "dist" directory. Existing files are
|
||||
# overwritten!
|
||||
# To do all this you need the unixrt, unixsrc, extra and lang archives, and
|
||||
# To do all this you need the unix, extra and lang archives, and
|
||||
# compiled binaries.
|
||||
# Before creating an archive first delete all backup files, *.orig, etc.
|
||||
|
||||
MAJOR = 6
|
||||
MINOR = 3
|
||||
MAJOR = 7
|
||||
MINOR = 0b
|
||||
|
||||
# Uncomment this line if the Win32s version is to be included.
|
||||
#DOSBIN_S = dosbin_s
|
||||
DOSBIN_S = dosbin_s
|
||||
|
||||
# CHECKLIST for creating a new version:
|
||||
#
|
||||
# - Update Vim version number. For a test version in: src/version.h, Contents,
|
||||
# MAJOR/MINOR above, VIMRTDIR and VERSION in src/Makefile, README*.txt,
|
||||
# runtime/doc/*.txt and nsis/gvim.nsi. For a minor/major version:
|
||||
# src/GvimExt/GvimExt.reg, src/vim16.def.
|
||||
# MAJOR/MINOR above, VIMMAJOR and VIMMINOR in src/Makefile, README*.txt,
|
||||
# runtime/doc/*.txt and nsis/gvim.nsi. Other things in README_os2.txt. For a
|
||||
# minor/major version: src/GvimExt/GvimExt.reg, src/vim.def, src/vim16.def.
|
||||
# - Correct included_patches[] in src/version.c.
|
||||
# - Compile Vim with GTK, Perl, Python, TCL, Ruby, Cscope and "huge" features.
|
||||
# - Compile Vim with GTK, Perl, Python, TCL, Ruby, MZscheme, Cscope and "huge"
|
||||
# features. Exclude workshop and SNiFF.
|
||||
# - With these features: "make proto" (requires cproto and Motif installed;
|
||||
# ignore warnings for missing include files, fix problems for syntax errors).
|
||||
# - With these features: "make depend" (works best with gcc).
|
||||
@@ -93,7 +92,7 @@ MINOR = 3
|
||||
# - Check for missing entries in runtime/makemenu.vim (with checkmenu script).
|
||||
# - Check for missing options in runtime/optwin.vim et al. (with check.vim).
|
||||
# - Do "make menu" to update the runtime/synmenu.vim file.
|
||||
# - Add remarks for changes to runtime/doc/version6.txt.
|
||||
# - Add remarks for changes to runtime/doc/version7.txt.
|
||||
# - In runtime/doc run "make" and "make html" to check for errors.
|
||||
# - Check if src/Makefile and src/feature.h don't contain any personal
|
||||
# preferences or the GTK, Perl, etc. mentioned above.
|
||||
@@ -125,25 +124,28 @@ MINOR = 3
|
||||
# "uninstald16.exe".
|
||||
# 32 bit DOS version:
|
||||
# - Set environment for compiling with DJGPP; "gmake -f Make_djg.mak".
|
||||
# - "rm testdir/*.out", "make -f Make_djg.mak test" and check the output.
|
||||
# - "rm testdir/*.out", "gmake -f Make_djg.mak test" and check the output.
|
||||
# - Rename the executables to "vimd32.exe", "xxdd32.exe", "installd32.exe" and
|
||||
# "uninstald32.exe".
|
||||
# Win32 console version:
|
||||
# - Set environment for Visual C++ 5.0: "vcvars32"
|
||||
# - Set environment for Visual C++ Toolkit 2003: "msvcsetup.bat"
|
||||
# - "nmake -f Make_mvc.mak"
|
||||
# - "rm testdir/*.out", "nmake -f Make_mvc.mak test" and check the output.
|
||||
# - Rename the executables to "vimw32.exe", "xxdw32.exe".
|
||||
# - Rename ObjC/vim.pdb to vimw32.pdb.
|
||||
# - When building the Win32s version later, delete vimrun.exe, install.exe and
|
||||
# uninstal.exe. Otherwise rename executables to installw32.exe and
|
||||
# uninstalw32.exe.
|
||||
# Win32 GUI version:
|
||||
# - "nmake -f Make_mvc.mak GUI=yes.
|
||||
# - move "gvim.exe" to here (otherwise the OLE version will overwrite it).
|
||||
# - Move ObjG/gvim.pdb to here.
|
||||
# - Delete vimrun.exe, install.exe and uninstall.exe.
|
||||
# - Copy "GvimExt/gvimext.dll" to here.
|
||||
# Win32 GUI version with OLE, PERL, TCL, PYTHON and dynamic IME:
|
||||
# - Run src/bigvim.bat ("nmake -f Make_mvc.mak GUI=yes OLE=yes IME=yes ...)
|
||||
# - Rename "gvim.exe" to "gvim_ole.exe".
|
||||
# - Rename ObjGOLYTR/gvim.pdb to "gvim_ole.pdb".
|
||||
# - Delete install.exe and uninstall.exe.
|
||||
# - If building the Win32s version delete vimrun.exe.
|
||||
# Win32s GUI version:
|
||||
@@ -262,10 +264,8 @@ dist/$(COMMENT_FARSI): dist/comment
|
||||
dist/$(COMMENT_LANG): dist/comment
|
||||
echo "Vim - Vi IMproved - v$(VDOT) MS-Windows language files" > dist/$(COMMENT_LANG)
|
||||
|
||||
unixrt: dist prepare
|
||||
-rm -f dist/$(VIMVER)-rt1.tar.gz
|
||||
-rm -f dist/$(VIMVER)-rt2.tar.gz
|
||||
# first runtime file
|
||||
unixall: dist prepare
|
||||
-rm -f dist/$(VIMVER).tar.bz2
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
@@ -273,35 +273,10 @@ unixrt: dist prepare
|
||||
$(RT_ALL_BIN) \
|
||||
$(RT_UNIX) \
|
||||
$(RT_UNIX_DOS_BIN) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-rt1.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-rt1.tar
|
||||
# second runtime file (script and language files)
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(RT_SCRIPTS) \
|
||||
$(LANG_GEN) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-rt2.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-rt2.tar
|
||||
|
||||
unixsrc: dist prepare
|
||||
-rm -f dist/$(VIMVER)-src1.tar.gz
|
||||
-rm -f dist/$(VIMVER)-src2.tar.gz
|
||||
# first source file
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL1) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
cd dist && tar cf $(VIMVER)-src1.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-src1.tar
|
||||
# second source file
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL2) \
|
||||
$(LANG_GEN_BIN) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_UNIX) \
|
||||
$(SRC_DOS_UNIX) \
|
||||
| (cd dist/$(VIMRTDIR); tar xf -)
|
||||
@@ -309,21 +284,6 @@ unixsrc: dist prepare
|
||||
cp -f src/config.mk.dist dist/$(VIMRTDIR)/src/auto/config.mk
|
||||
# Create an empty config.h file, make dependencies require it
|
||||
touch dist/$(VIMRTDIR)/src/auto/config.h
|
||||
# Make sure configure is newer than config.mk to force it to be generated
|
||||
touch dist/$(VIMRTDIR)/src/configure
|
||||
cd dist && tar cf $(VIMVER)-src2.tar $(VIMRTDIR)
|
||||
gzip -9 dist/$(VIMVER)-src2.tar
|
||||
|
||||
unixall: dist unixsrc unixrt
|
||||
-rm -f dist/$(VIMVER).tar.bz2
|
||||
-rm -rf dist/$(VIMRTDIR)
|
||||
mkdir dist/$(VIMRTDIR)
|
||||
cd dist && tar xfz $(VIMVER)-src1.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-src2.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-rt1.tar.gz
|
||||
cd dist && tar xfz $(VIMVER)-rt2.tar.gz
|
||||
# Create an empty config.h file, make dependencies require it
|
||||
touch dist/$(VIMRTDIR)/src/auto/config.h
|
||||
# Make sure configure is newer than config.mk to force it to be generated
|
||||
touch dist/$(VIMRTDIR)/src/configure
|
||||
cd dist && tar cf $(VIMVER).tar $(VIMRTDIR)
|
||||
@@ -404,8 +364,7 @@ amisrc: dist prepare
|
||||
mkdir dist/Vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(ROOT_AMI) \
|
||||
$(SRC_ALL1) \
|
||||
$(SRC_ALL2) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_AMI) \
|
||||
$(SRC_AMI_DOS) \
|
||||
| (cd dist/Vim/$(VIMRTDIR); tar xf -)
|
||||
@@ -422,12 +381,15 @@ dosrt: dist dist/$(COMMENT_RT) dosrt_unix2dos
|
||||
-rm -rf dist/vim$(VERSION)rt.zip
|
||||
cd dist && zip -9 -rD -z vim$(VERSION)rt.zip vim <$(COMMENT_RT)
|
||||
|
||||
# Split in two parts to avoid a "argument list too long" error.
|
||||
dosrt_unix2dos: dist prepare no_title.vim
|
||||
-rm -rf dist/vim
|
||||
mkdir dist/vim
|
||||
mkdir dist/vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(RT_ALL) \
|
||||
| (cd dist/vim/$(VIMRTDIR); tar xf -)
|
||||
tar cf - \
|
||||
$(RT_SCRIPTS) \
|
||||
$(RT_DOS) \
|
||||
$(RT_NO_UNIX) \
|
||||
@@ -439,6 +401,7 @@ dosrt_unix2dos: dist prepare no_title.vim
|
||||
$(RT_UNIX_DOS_BIN) \
|
||||
$(RT_ALL_BIN) \
|
||||
$(RT_DOS_BIN) \
|
||||
$(LANG_GEN_BIN) \
|
||||
| (cd dist/vim/$(VIMRTDIR); tar xf -)
|
||||
mv dist/vim/$(VIMRTDIR)/runtime/* dist/vim/$(VIMRTDIR)
|
||||
rmdir dist/vim/$(VIMRTDIR)/runtime
|
||||
@@ -470,6 +433,7 @@ dosbin_gvim: dist no_title.vim dist/$(COMMENT_GVIM)
|
||||
cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
|
||||
cp gvimext.dll dist/vim/$(VIMRTDIR)/gvimext.dll
|
||||
cd dist && zip -9 -rD -z gvim$(VERSION).zip vim <$(COMMENT_GVIM)
|
||||
cp gvim.pdb dist/gvim$(VERSION).pdb
|
||||
|
||||
# make Win32 console
|
||||
dosbin_w32: dist no_title.vim dist/$(COMMENT_W32)
|
||||
@@ -486,6 +450,7 @@ dosbin_w32: dist no_title.vim dist/$(COMMENT_W32)
|
||||
cp installw32.exe dist/vim/$(VIMRTDIR)/install.exe
|
||||
cp uninstalw32.exe dist/vim/$(VIMRTDIR)/uninstal.exe
|
||||
cd dist && zip -9 -rD -z vim$(VERSION)w32.zip vim <$(COMMENT_W32)
|
||||
cp vimw32.pdb dist/vim$(VERSION)w32.pdb
|
||||
|
||||
# make 32bit DOS
|
||||
dosbin_d32: dist no_title.vim dist/$(COMMENT_D32)
|
||||
@@ -540,6 +505,7 @@ dosbin_ole: dist no_title.vim dist/$(COMMENT_OLE)
|
||||
cp src/VisVim/VisVim.dll dist/vim/$(VIMRTDIR)/VisVim.dll
|
||||
cp src/VisVim/README_VisVim.txt dist/vim/$(VIMRTDIR)
|
||||
cd dist && zip -9 -rD -z gvim$(VERSION)ole.zip vim <$(COMMENT_OLE)
|
||||
cp gvim_ole.pdb dist/gvim$(VERSION)ole.pdb
|
||||
|
||||
# make Win32s gvim
|
||||
dosbin_s: dist no_title.vim dist/$(COMMENT_W32S)
|
||||
@@ -588,8 +554,7 @@ dossrc: dist no_title.vim dist/$(COMMENT_SRC) runtime/doc/uganda.nsis.txt
|
||||
mkdir dist/vim
|
||||
mkdir dist/vim/$(VIMRTDIR)
|
||||
tar cf - \
|
||||
$(SRC_ALL1) \
|
||||
$(SRC_ALL2) \
|
||||
$(SRC_ALL) \
|
||||
$(SRC_DOS) \
|
||||
$(SRC_AMI_DOS) \
|
||||
$(SRC_DOS_UNIX) \
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
|
||||
WHAT IS VIM
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_ami.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_ami.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on Amiga systems.
|
||||
See README.txt for general information about Vim.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_amibin.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_amibin.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
See "README.txt" for general information about Vim.
|
||||
See "README_ami.txt" for installation instructions for the Amiga.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_amisrc.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_amisrc.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
See "README.txt" for general information about Vim.
|
||||
See "README_ami.txt" for installation instructions for the Amiga.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_bindos.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_bindos.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
See "README.txt" for general information about Vim.
|
||||
See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_dos.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_dos.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on MS-DOS and MS-Windows systems.
|
||||
See "README.txt" for general information about Vim.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_extra.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_extra.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
The extra archive of Vim is to be used in combination with the source archive
|
||||
(vim-6.0-src.tar.gz). The extra archive is useless without it.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_lang.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_lang.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file contains files for non-English languages:
|
||||
- Translated messages.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_mac.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_mac.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on Macintosh systems.
|
||||
See "README.txt" for general information about Vim.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_ole.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_ole.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This archive contains gvim.exe with OLE interface and VisVim.
|
||||
This version of gvim.exe can also load a number of interface dynamically (you
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
README_os2.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_os2.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on OS/2 systems.
|
||||
See "README.txt" for general information about Vim.
|
||||
|
||||
|
||||
NOTE: You will need two archives:
|
||||
vim62rt.zip contains the runtime files (same as for the PC version)
|
||||
vim62os2.zip contains the OS/2 executables
|
||||
vim70rt.zip contains the runtime files (same as for the PC version)
|
||||
vim70os2.zip contains the OS/2 executables
|
||||
|
||||
1. Go to the directory where you want to put the Vim files. Examples:
|
||||
cd C:\
|
||||
cd D:\editors
|
||||
|
||||
2. Unpack the zip archives. This will create a new directory "vim/vim62",
|
||||
2. Unpack the zip archives. This will create a new directory "vim/vim70",
|
||||
in which all the distributed Vim files are placed. Since the directory
|
||||
name includes the version number, it is unlikely that you overwrite
|
||||
existing files.
|
||||
Examples:
|
||||
pkunzip -d vim62os2.zip
|
||||
unzip vim62os2.zip
|
||||
pkunzip -d vim70os2.zip
|
||||
unzip vim70os2.zip
|
||||
|
||||
After you unpacked the files, you can still move the whole directory tree
|
||||
to another location.
|
||||
|
||||
3. Add the directory where vim.exe is to your path. The simplest is to add a
|
||||
line to your autoexec.bat. Examples:
|
||||
set path=%path%;C:\vim\vim62
|
||||
set path=%path%;D:\editors\vim\vim62
|
||||
set path=%path%;C:\vim\vim70
|
||||
set path=%path%;D:\editors\vim\vim70
|
||||
|
||||
That's it!
|
||||
|
||||
@@ -41,10 +41,10 @@ Extra remarks:
|
||||
C:\vim\_viminfo Dynamic info for 'viminfo'.
|
||||
C:\vim\... Other files you made.
|
||||
Distributed files:
|
||||
C:\vim\vim62\vim.exe The Vim version 6.2 executable.
|
||||
C:\vim\vim62\doc\*.txt The version 6.2 documentation files.
|
||||
C:\vim\vim62\bugreport.vim A Vim version 6.2 script.
|
||||
C:\vim\vim62\... Other version 6.2 distributed files.
|
||||
C:\vim\vim70\vim.exe The Vim version 7.0 executable.
|
||||
C:\vim\vim70\doc\*.txt The version 7.0 documentation files.
|
||||
C:\vim\vim70\bugreport.vim A Vim version 7.0 script.
|
||||
C:\vim\vim70\... Other version 7.0 distributed files.
|
||||
In this case the $VIM environment variable would be set like this:
|
||||
set VIM=C:\vim
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_os_390.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_os_390.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
Welcome to the OS/390 Unix port of VIM.
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_src.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_src.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
The source archive contains the files needed to compile Vim on Unix systems.
|
||||
It is packed for Unix systems (NL line separator). It is also used for other
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_srcdos.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_srcdos.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
See "README.txt" for general information about Vim.
|
||||
See "README_dos.txt" for installation instructions for MS-DOS and MS-Windows.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_unix.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_unix.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on Unix systems.
|
||||
See "README.txt" for general information about Vim.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_vms.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_vms.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This file explains the installation of Vim on VMS systems.
|
||||
See "README.txt" in the runtime archive for information about Vim.
|
||||
@@ -14,27 +14,34 @@ To compile Vim yourself you need three archives:
|
||||
vim-X.X-extra.tar.gz extra source files
|
||||
|
||||
Compilation is recommended, in order to make sure that the correct
|
||||
libraries are used for your specific system. However, you might not be
|
||||
able to compile Vim, read more from src/INSTALLvms.txt.
|
||||
libraries are used for your specific system. Read about compiling in
|
||||
src/INSTALLvms.txt.
|
||||
|
||||
To use the binary version, you need one of these archives:
|
||||
|
||||
vim-XX-exe-alpha-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-alpha-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-alpha-term.zip Alpha console executables
|
||||
vim-XX-exe-ia64-gui.zip IA64 GUI/Motif executables
|
||||
vim-XX-exe-ia64-gtk.zip IA64 GUI/GTK executables
|
||||
vim-XX-exe-ia64-term.zip IA64 console executables
|
||||
vim-XX-exe-axp-gui.zip Alpha GUI/Motif executables
|
||||
vim-XX-exe-axp-gtk.zip Alpha GUI/GTK executables
|
||||
vim-XX-exe-axp-term.zip Alpha console executables
|
||||
vim-XX-exe-vax-gui.zip VAX GUI executables
|
||||
vim-XX-exe-vax-term.zip VAX console executables
|
||||
vim-XX-exe-vax-term.zip VAX console executables
|
||||
|
||||
and of course
|
||||
vim-XX-runtime.zip runtime files
|
||||
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe, mms_vim.exe files,
|
||||
The binary archives contain: vim.exe, ctags.exe, xxd.exe files,
|
||||
but there are also prepared "deploy ready" archives:
|
||||
|
||||
vim-XX-alpha.zip GUI and console executables with runtime and
|
||||
help files for Alpha systems
|
||||
vim-XX-vax.zip GUI and console executables with runtime and
|
||||
help files for VAX systems
|
||||
vim-XX-ia64.zip GUI and console executables with runtime and
|
||||
help files for IA64 systems
|
||||
vim-XX-axp.zip GUI and console executables with runtime and
|
||||
help files for Alpha systems
|
||||
vim-XX-vax.zip GUI and console executables with runtime and
|
||||
help files for VAX systems
|
||||
|
||||
GTK builds need LIBGTK library installed.
|
||||
|
||||
These executables and up to date patches for OpenVMS system are downloadable
|
||||
from http://www.polarhome.com/vim/ or ftp://ftp.polarhome.com/pub/vim/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
README_w32s.txt for version 7.0aa of Vim: Vi IMproved.
|
||||
README_w32s.txt for version 7.0b of Vim: Vi IMproved.
|
||||
|
||||
This archive contains the gvim.exe that was specifically compiled for use in
|
||||
the Win32s subsystem in MS-Windows 3.1 and 3.11.
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
!define HAVE_NLS
|
||||
|
||||
!define VER_MAJOR 7
|
||||
!define VER_MINOR 0aa
|
||||
!define VER_MINOR 0b
|
||||
|
||||
# ----------- No configurable settings below this line -----------
|
||||
|
||||
@@ -116,7 +116,7 @@ Function .onInit
|
||||
# $2 - holds the names to create batch files for
|
||||
StrCpy $0 "$INSTDIR\vim${VER_MAJOR}${VER_MINOR}"
|
||||
StrCpy $1 "-register-OLE"
|
||||
StrCpy $2 "gvim evim gview gvimdiff"
|
||||
StrCpy $2 "gvim evim gview gvimdiff vimtutor"
|
||||
|
||||
FunctionEnd
|
||||
|
||||
@@ -214,9 +214,18 @@ Section "Vim executables and runtime files"
|
||||
SetOutPath $0\plugin
|
||||
File ${VIMRT}\plugin\*.*
|
||||
|
||||
SetOutPath $0\autoload
|
||||
File ${VIMRT}\autoload\*.*
|
||||
|
||||
SetOutPath $0\syntax
|
||||
File ${VIMRT}\syntax\*.*
|
||||
|
||||
SetOutPath $0\spell
|
||||
File ${VIMRT}\spell\*.txt
|
||||
File ${VIMRT}\spell\*.vim
|
||||
File ${VIMRT}\spell\*.spl
|
||||
File ${VIMRT}\spell\*.sug
|
||||
|
||||
SetOutPath $0\tools
|
||||
File ${VIMRT}\tools\*.*
|
||||
|
||||
|
||||
BIN
nsis/icons/disabled.bmp
Normal file
BIN
nsis/icons/disabled.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 358 B |
BIN
nsis/icons/enabled.bmp
Normal file
BIN
nsis/icons/enabled.bmp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 358 B |
BIN
nsis/icons/vim_16c.ico
Normal file
BIN
nsis/icons/vim_16c.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
BIN
nsis/icons/vim_uninst_16c.ico
Normal file
BIN
nsis/icons/vim_uninst_16c.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 766 B |
21
runtime/autoload/README.txt
Normal file
21
runtime/autoload/README.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
The autoload directory is for standard Vim autoload scripts.
|
||||
|
||||
These are functions used by plugins and for general use. They will be loaded
|
||||
automatically when the function is invoked. See ":help autoload".
|
||||
|
||||
gzip.vim for editing compressed files
|
||||
netrw*.vim browsing (remote) directories and editing remote files
|
||||
tar.vim browsing tar files
|
||||
zip.vim browsing zip files
|
||||
paste.vim common code for mswin.vim, menu.vim and macmap.vim
|
||||
spellfile.vim downloading of a missing spell file
|
||||
|
||||
Omni completion files:
|
||||
ccomplete.vim C
|
||||
csscomplete.vim HTML / CSS
|
||||
htmlcomplete.vim HTML
|
||||
javascriptcomplete.vim Javascript
|
||||
phpcomplete.vim PHP
|
||||
pycomplete.vim Python
|
||||
syntaxcomplete.vim from syntax highlighting
|
||||
xmlcomplete.vim XML (uses files in the xml directory)
|
||||
582
runtime/autoload/ccomplete.vim
Normal file
582
runtime/autoload/ccomplete.vim
Normal file
@@ -0,0 +1,582 @@
|
||||
" Vim completion script
|
||||
" Language: C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Mar 24
|
||||
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! ccomplete#Complete(findstart, base)
|
||||
if a:findstart
|
||||
" Locate the start of the item, including ".", "->" and "[...]".
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let lastword = -1
|
||||
while start > 0
|
||||
if line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.'
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 1
|
||||
elseif start > 1 && line[start - 2] == '-' && line[start - 1] == '>'
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 2
|
||||
elseif line[start - 1] == ']'
|
||||
" Skip over [...].
|
||||
let n = 0
|
||||
let start -= 1
|
||||
while start > 0
|
||||
let start -= 1
|
||||
if line[start] == '['
|
||||
if n == 0
|
||||
break
|
||||
endif
|
||||
let n -= 1
|
||||
elseif line[start] == ']' " nested []
|
||||
let n += 1
|
||||
endif
|
||||
endwhile
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Return the column of the last word, which is going to be changed.
|
||||
" Remember the text that comes before it in s:prepended.
|
||||
if lastword == -1
|
||||
let s:prepended = ''
|
||||
return start
|
||||
endif
|
||||
let s:prepended = strpart(line, start, lastword - start)
|
||||
return lastword
|
||||
endif
|
||||
|
||||
" Return list of matches.
|
||||
|
||||
let base = s:prepended . a:base
|
||||
|
||||
" Don't do anything for an empty base, would result in all the tags in the
|
||||
" tags file.
|
||||
if base == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
" init cache for vimgrep to empty
|
||||
let s:grepCache = {}
|
||||
|
||||
" Split item in words, keep empty word after "." or "->".
|
||||
" "aa" -> ['aa'], "aa." -> ['aa', ''], "aa.bb" -> ['aa', 'bb'], etc.
|
||||
" We can't use split, because we need to skip nested [...].
|
||||
let items = []
|
||||
let s = 0
|
||||
while 1
|
||||
let e = match(base, '\.\|->\|\[', s)
|
||||
if e < 0
|
||||
if s == 0 || base[s - 1] != ']'
|
||||
call add(items, strpart(base, s))
|
||||
endif
|
||||
break
|
||||
endif
|
||||
if s == 0 || base[s - 1] != ']'
|
||||
call add(items, strpart(base, s, e - s))
|
||||
endif
|
||||
if base[e] == '.'
|
||||
let s = e + 1 " skip over '.'
|
||||
elseif base[e] == '-'
|
||||
let s = e + 2 " skip over '->'
|
||||
else
|
||||
" Skip over [...].
|
||||
let n = 0
|
||||
let s = e
|
||||
let e += 1
|
||||
while e < len(base)
|
||||
if base[e] == ']'
|
||||
if n == 0
|
||||
break
|
||||
endif
|
||||
let n -= 1
|
||||
elseif base[e] == '[' " nested [...]
|
||||
let n += 1
|
||||
endif
|
||||
let e += 1
|
||||
endwhile
|
||||
let e += 1
|
||||
call add(items, strpart(base, s, e - s))
|
||||
let s = e
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Find the variable items[0].
|
||||
" 1. in current function (like with "gd")
|
||||
" 2. in tags file(s) (like with ":tag")
|
||||
" 3. in current file (like with "gD")
|
||||
let res = []
|
||||
if searchdecl(items[0], 0, 1) == 0
|
||||
" Found, now figure out the type.
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
if len(items) == 1
|
||||
" Completing one word and it's a local variable: May add '[', '.' or
|
||||
" '->'.
|
||||
let match = items[0]
|
||||
let kind = 'v'
|
||||
if match(line, '\<' . match . '\s*\[') > 0
|
||||
let match .= '['
|
||||
else
|
||||
let res = s:Nextitem(strpart(line, 0, col), [''], 0, 1)
|
||||
if len(res) > 0
|
||||
" There are members, thus add "." or "->".
|
||||
if match(line, '\*[ \t(]*' . match . '\>') > 0
|
||||
let match .= '->'
|
||||
else
|
||||
let match .= '.'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
let res = [{'match': match, 'tagline' : '', 'kind' : kind, 'info' : line}]
|
||||
else
|
||||
" Completing "var.", "var.something", etc.
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
|
||||
endif
|
||||
endif
|
||||
|
||||
if len(items) == 1
|
||||
" Only one part, no "." or "->": complete from tags file.
|
||||
let tags = taglist('^' . base)
|
||||
|
||||
" Remove members, these can't appear without something in front.
|
||||
call filter(tags, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
|
||||
|
||||
" Remove static matches in other files.
|
||||
call filter(tags, '!has_key(v:val, "static") || !v:val["static"] || bufnr("%") == bufnr(v:val["filename"])')
|
||||
|
||||
call extend(res, map(tags, 's:Tag2item(v:val)'))
|
||||
endif
|
||||
|
||||
if len(res) == 0
|
||||
" Find the variable in the tags file(s)
|
||||
let diclist = taglist('^' . items[0] . '$')
|
||||
|
||||
" Remove members, these can't appear without something in front.
|
||||
call filter(diclist, 'has_key(v:val, "kind") ? v:val["kind"] != "m" : 1')
|
||||
|
||||
let res = []
|
||||
for i in range(len(diclist))
|
||||
" New ctags has the "typeref" field. Patched version has "typename".
|
||||
if has_key(diclist[i], 'typename')
|
||||
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1))
|
||||
elseif has_key(diclist[i], 'typeref')
|
||||
call extend(res, s:StructMembers(diclist[i]['typeref'], items[1:], 1))
|
||||
endif
|
||||
|
||||
" For a variable use the command, which must be a search pattern that
|
||||
" shows the declaration of the variable.
|
||||
if diclist[i]['kind'] == 'v'
|
||||
let line = diclist[i]['cmd']
|
||||
if line[0] == '/' && line[1] == '^'
|
||||
let col = match(line, '\<' . items[0] . '\>')
|
||||
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1))
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
if len(res) == 0 && searchdecl(items[0], 1) == 0
|
||||
" Found, now figure out the type.
|
||||
" TODO: join previous line if it makes sense
|
||||
let line = getline('.')
|
||||
let col = col('.')
|
||||
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
|
||||
endif
|
||||
|
||||
" If the last item(s) are [...] they need to be added to the matches.
|
||||
let last = len(items) - 1
|
||||
let brackets = ''
|
||||
while last >= 0
|
||||
if items[last][0] != '['
|
||||
break
|
||||
endif
|
||||
let brackets = items[last] . brackets
|
||||
let last -= 1
|
||||
endwhile
|
||||
|
||||
return map(res, 's:Tagline2item(v:val, brackets)')
|
||||
endfunc
|
||||
|
||||
function! s:GetAddition(line, match, memarg, bracket)
|
||||
" Guess if the item is an array.
|
||||
if a:bracket && match(a:line, a:match . '\s*\[') > 0
|
||||
return '['
|
||||
endif
|
||||
|
||||
" Check if the item has members.
|
||||
if len(s:SearchMembers(a:memarg, [''], 0)) > 0
|
||||
" If there is a '*' before the name use "->".
|
||||
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
|
||||
return '->'
|
||||
else
|
||||
return '.'
|
||||
endif
|
||||
endif
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
" Turn the tag info "val" into an item for completion.
|
||||
" "val" is is an item in the list returned by taglist().
|
||||
" If it is a variable we may add "." or "->". Don't do it for other types,
|
||||
" such as a typedef, by not including the info that s:GetAddition() uses.
|
||||
function! s:Tag2item(val)
|
||||
let res = {'match': a:val['name']}
|
||||
|
||||
let res['extra'] = s:Tagcmd2extra(a:val['cmd'], a:val['name'], a:val['filename'])
|
||||
|
||||
let s = s:Dict2info(a:val)
|
||||
if s != ''
|
||||
let res['info'] = s
|
||||
endif
|
||||
|
||||
let res['tagline'] = ''
|
||||
if has_key(a:val, "kind")
|
||||
let kind = a:val['kind']
|
||||
let res['kind'] = kind
|
||||
if kind == 'v'
|
||||
let res['tagline'] = "\t" . a:val['cmd']
|
||||
let res['dict'] = a:val
|
||||
elseif kind == 'f'
|
||||
let res['match'] = a:val['name'] . '('
|
||||
endif
|
||||
endif
|
||||
|
||||
return res
|
||||
endfunction
|
||||
|
||||
" Use all the items in dictionary for the "info" entry.
|
||||
function! s:Dict2info(dict)
|
||||
let info = ''
|
||||
for k in sort(keys(a:dict))
|
||||
let info .= k . repeat(' ', 10 - len(k))
|
||||
if k == 'cmd'
|
||||
let info .= substitute(matchstr(a:dict['cmd'], '/^\s*\zs.*\ze$/'), '\\\(.\)', '\1', 'g')
|
||||
else
|
||||
let info .= a:dict[k]
|
||||
endif
|
||||
let info .= "\n"
|
||||
endfor
|
||||
return info
|
||||
endfunc
|
||||
|
||||
" Parse a tag line and return a dictionary with items like taglist()
|
||||
function! s:ParseTagline(line)
|
||||
let l = split(a:line, "\t")
|
||||
let d = {}
|
||||
if len(l) >= 3
|
||||
let d['name'] = l[0]
|
||||
let d['filename'] = l[1]
|
||||
let d['cmd'] = l[2]
|
||||
let n = 2
|
||||
if l[2] =~ '^/'
|
||||
" Find end of cmd, it may contain Tabs.
|
||||
while n < len(l) && l[n] !~ '/;"$'
|
||||
let n += 1
|
||||
let d['cmd'] .= " " . l[n]
|
||||
endwhile
|
||||
endif
|
||||
for i in range(n + 1, len(l) - 1)
|
||||
if l[i] == 'file:'
|
||||
let d['static'] = 1
|
||||
elseif l[i] !~ ':'
|
||||
let d['kind'] = l[i]
|
||||
else
|
||||
let d[matchstr(l[i], '[^:]*')] = matchstr(l[i], ':\zs.*')
|
||||
endif
|
||||
endfor
|
||||
endif
|
||||
|
||||
return d
|
||||
endfunction
|
||||
|
||||
" Turn a match item "val" into an item for completion.
|
||||
" "val['match']" is the matching item.
|
||||
" "val['tagline']" is the tagline in which the last part was found.
|
||||
function! s:Tagline2item(val, brackets)
|
||||
let line = a:val['tagline']
|
||||
let add = s:GetAddition(line, a:val['match'], [a:val], a:brackets == '')
|
||||
let res = {'word': a:val['match'] . a:brackets . add }
|
||||
|
||||
if has_key(a:val, 'info')
|
||||
" Use info from Tag2item().
|
||||
let res['info'] = a:val['info']
|
||||
else
|
||||
" Parse the tag line and add each part to the "info" entry.
|
||||
let s = s:Dict2info(s:ParseTagline(line))
|
||||
if s != ''
|
||||
let res['info'] = s
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(a:val, 'kind')
|
||||
let res['kind'] = a:val['kind']
|
||||
elseif add == '('
|
||||
let res['kind'] = 'f'
|
||||
else
|
||||
let s = matchstr(line, '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
|
||||
if s != ''
|
||||
let res['kind'] = s
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(a:val, 'extra')
|
||||
let res['menu'] = a:val['extra']
|
||||
return res
|
||||
endif
|
||||
|
||||
" Isolate the command after the tag and filename.
|
||||
let s = matchstr(line, '[^\t]*\t[^\t]*\t\zs\(/^.*$/\|[^\t]*\)\ze\(;"\t\|\t\|$\)')
|
||||
if s != ''
|
||||
let res['menu'] = s:Tagcmd2extra(s, a:val['match'], matchstr(line, '[^\t]*\t\zs[^\t]*\ze\t'))
|
||||
endif
|
||||
return res
|
||||
endfunction
|
||||
|
||||
" Turn a command from a tag line to something that is useful in the menu
|
||||
function! s:Tagcmd2extra(cmd, name, fname)
|
||||
if a:cmd =~ '^/^'
|
||||
" The command is a search command, useful to see what it is.
|
||||
let x = matchstr(a:cmd, '^/^\s*\zs.*\ze$/')
|
||||
let x = substitute(x, '\<' . a:name . '\>', '@@', '')
|
||||
let x = substitute(x, '\\\(.\)', '\1', 'g')
|
||||
let x = x . ' - ' . a:fname
|
||||
elseif a:cmd =~ '^\d*$'
|
||||
" The command is a line number, the file name is more useful.
|
||||
let x = a:fname . ' - ' . a:cmd
|
||||
else
|
||||
" Not recognized, use command and file name.
|
||||
let x = a:cmd . ' - ' . a:fname
|
||||
endif
|
||||
return x
|
||||
endfunction
|
||||
|
||||
" Find composing type in "lead" and match items[0] with it.
|
||||
" Repeat this recursively for items[1], if it's there.
|
||||
" When resolving typedefs "depth" is used to avoid infinite recursion.
|
||||
" Return the list of matches.
|
||||
function! s:Nextitem(lead, items, depth, all)
|
||||
|
||||
" Use the text up to the variable name and split it in tokens.
|
||||
let tokens = split(a:lead, '\s\+\|\<')
|
||||
|
||||
" Try to recognize the type of the variable. This is rough guessing...
|
||||
let res = []
|
||||
for tidx in range(len(tokens))
|
||||
|
||||
" Skip tokens starting with a non-ID character.
|
||||
if tokens[tidx] !~ '^\h'
|
||||
continue
|
||||
endif
|
||||
|
||||
" Recognize "struct foobar" and "union foobar".
|
||||
if (tokens[tidx] == 'struct' || tokens[tidx] == 'union') && tidx + 1 < len(tokens)
|
||||
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all)
|
||||
break
|
||||
endif
|
||||
|
||||
" TODO: add more reserved words
|
||||
if index(['int', 'short', 'char', 'float', 'double', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
|
||||
continue
|
||||
endif
|
||||
|
||||
" Use the tags file to find out if this is a typedef.
|
||||
let diclist = taglist('^' . tokens[tidx] . '$')
|
||||
for tagidx in range(len(diclist))
|
||||
let item = diclist[tagidx]
|
||||
|
||||
" New ctags has the "typeref" field. Patched version has "typename".
|
||||
if has_key(item, 'typeref')
|
||||
call extend(res, s:StructMembers(item['typeref'], a:items, a:all))
|
||||
continue
|
||||
endif
|
||||
if has_key(item, 'typename')
|
||||
call extend(res, s:StructMembers(item['typename'], a:items, a:all))
|
||||
continue
|
||||
endif
|
||||
|
||||
" Only handle typedefs here.
|
||||
if item['kind'] != 't'
|
||||
continue
|
||||
endif
|
||||
|
||||
" Skip matches local to another file.
|
||||
if has_key(item, 'static') && item['static'] && bufnr('%') != bufnr(item['filename'])
|
||||
continue
|
||||
endif
|
||||
|
||||
" For old ctags we recognize "typedef struct aaa" and
|
||||
" "typedef union bbb" in the tags file command.
|
||||
let cmd = item['cmd']
|
||||
let ei = matchend(cmd, 'typedef\s\+')
|
||||
if ei > 1
|
||||
let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
|
||||
if len(cmdtokens) > 1
|
||||
if cmdtokens[0] == 'struct' || cmdtokens[0] == 'union'
|
||||
let name = ''
|
||||
" Use the first identifier after the "struct" or "union"
|
||||
for ti in range(len(cmdtokens) - 1)
|
||||
if cmdtokens[ti] =~ '^\w'
|
||||
let name = cmdtokens[ti]
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
if name != ''
|
||||
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all))
|
||||
endif
|
||||
elseif a:depth < 10
|
||||
" Could be "typedef other_T some_T".
|
||||
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
if len(res) > 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
endfunction
|
||||
|
||||
|
||||
" Search for members of structure "typename" in tags files.
|
||||
" Return a list with resulting matches.
|
||||
" Each match is a dictionary with "match" and "tagline" entries.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:StructMembers(typename, items, all)
|
||||
" Todo: What about local structures?
|
||||
let fnames = join(map(tagfiles(), 'escape(v:val, " \\")'))
|
||||
if fnames == ''
|
||||
return []
|
||||
endif
|
||||
|
||||
let typename = a:typename
|
||||
let qflist = []
|
||||
let cached = 0
|
||||
if a:all == 0
|
||||
let n = '1' " stop at first found match
|
||||
if has_key(s:grepCache, a:typename)
|
||||
let qflist = s:grepCache[a:typename]
|
||||
let cached = 1
|
||||
endif
|
||||
else
|
||||
let n = ''
|
||||
endif
|
||||
if !cached
|
||||
while 1
|
||||
exe 'silent! ' . n . 'vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
|
||||
|
||||
let qflist = getqflist()
|
||||
if len(qflist) > 0 || match(typename, "::") < 0
|
||||
break
|
||||
endif
|
||||
" No match for "struct:context::name", remove "context::" and try again.
|
||||
let typename = substitute(typename, ':[^:]*::', ':', '')
|
||||
endwhile
|
||||
|
||||
if a:all == 0
|
||||
" Store the result to be able to use it again later.
|
||||
let s:grepCache[a:typename] = qflist
|
||||
endif
|
||||
endif
|
||||
|
||||
" Put matching members in matches[].
|
||||
let matches = []
|
||||
for l in qflist
|
||||
let memb = matchstr(l['text'], '[^\t]*')
|
||||
if memb =~ '^' . a:items[0]
|
||||
" Skip matches local to another file.
|
||||
if match(l['text'], "\tfile:") < 0 || bufnr('%') == bufnr(matchstr(l['text'], '\t\zs[^\t]*'))
|
||||
let item = {'match': memb, 'tagline': l['text']}
|
||||
|
||||
" Add the kind of item.
|
||||
let s = matchstr(l['text'], '\t\(kind:\)\=\zs\S\ze\(\t\|$\)')
|
||||
if s != ''
|
||||
let item['kind'] = s
|
||||
if s == 'f'
|
||||
let item['match'] = memb . '('
|
||||
endif
|
||||
endif
|
||||
|
||||
call add(matches, item)
|
||||
endif
|
||||
endif
|
||||
endfor
|
||||
|
||||
if len(matches) > 0
|
||||
" Skip over [...] items
|
||||
let idx = 1
|
||||
while 1
|
||||
if idx >= len(a:items)
|
||||
return matches " No further items, return the result.
|
||||
endif
|
||||
if a:items[idx][0] != '['
|
||||
break
|
||||
endif
|
||||
let idx += 1
|
||||
endwhile
|
||||
|
||||
" More items following. For each of the possible members find the
|
||||
" matching following members.
|
||||
return s:SearchMembers(matches, a:items[idx :], a:all)
|
||||
endif
|
||||
|
||||
" Failed to find anything.
|
||||
return []
|
||||
endfunction
|
||||
|
||||
" For matching members, find matches for following items.
|
||||
" When "all" is non-zero find all, otherwise just return 1 if there is any
|
||||
" member.
|
||||
function! s:SearchMembers(matches, items, all)
|
||||
let res = []
|
||||
for i in range(len(a:matches))
|
||||
let typename = ''
|
||||
if has_key(a:matches[i], 'dict')
|
||||
if has_key(a:matches[i].dict, 'typename')
|
||||
let typename = a:matches[i].dict['typename']
|
||||
elseif has_key(a:matches[i].dict, 'typeref')
|
||||
let typename = a:matches[i].dict['typeref']
|
||||
endif
|
||||
let line = "\t" . a:matches[i].dict['cmd']
|
||||
else
|
||||
let line = a:matches[i]['tagline']
|
||||
let e = matchend(line, '\ttypename:')
|
||||
if e < 0
|
||||
let e = matchend(line, '\ttyperef:')
|
||||
endif
|
||||
if e > 0
|
||||
" Use typename field
|
||||
let typename = matchstr(line, '[^\t]*', e)
|
||||
endif
|
||||
endif
|
||||
|
||||
if typename != ''
|
||||
call extend(res, s:StructMembers(typename, a:items, a:all))
|
||||
else
|
||||
" Use the search command (the declaration itself).
|
||||
let s = match(line, '\t\zs/^')
|
||||
if s > 0
|
||||
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
|
||||
if e > 0
|
||||
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items, 0, a:all))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
if a:all == 0 && len(res) > 0
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endfunc
|
||||
430
runtime/autoload/csscomplete.vim
Normal file
430
runtime/autoload/csscomplete.vim
Normal file
@@ -0,0 +1,430 @@
|
||||
" Vim completion script
|
||||
" Language: CSS 2.1
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2005 Oct 12
|
||||
|
||||
function! csscomplete#CompleteCSS(findstart, base)
|
||||
if a:findstart
|
||||
" We need whole line to proper checking
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let compl_begin = col('.') - 2
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|-\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
return start
|
||||
else
|
||||
" There are few chars important for context:
|
||||
" ^ ; : { } /* */
|
||||
" Where ^ is start of line and /* */ are comment borders
|
||||
" Depending on their relative position to cursor we will now what should
|
||||
" be completed.
|
||||
" 1. if nearest are ^ or { or ; current word is property
|
||||
" 2. if : it is value (with exception of pseudo things)
|
||||
" 3. if } we are outside of css definitions
|
||||
" 4. for comments ignoring is be the easiest but assume they are the same
|
||||
" as 1.
|
||||
" 5. if @ complete at-rule
|
||||
" 6. if ! complete important
|
||||
if exists("b:compl_context")
|
||||
let line = b:compl_context
|
||||
unlet! b:compl_context
|
||||
else
|
||||
let line = a:base
|
||||
endif
|
||||
|
||||
let res = []
|
||||
let res2 = []
|
||||
let borders = {}
|
||||
|
||||
" We need the last occurrence of char so reverse line
|
||||
let revline = join(reverse(split(line, '.\zs')), '')
|
||||
|
||||
let openbrace = stridx(revline, '{')
|
||||
let closebrace = stridx(revline, '}')
|
||||
let colon = stridx(revline, ':')
|
||||
let semicolon = stridx(revline, ';')
|
||||
let opencomm = stridx(revline, '*/') " Line was reversed
|
||||
let closecomm = stridx(revline, '/*') " Line was reversed
|
||||
let style = stridx(revline, '=\s*elyts') " Line was reversed
|
||||
let atrule = stridx(revline, '@')
|
||||
let exclam = stridx(revline, '!')
|
||||
|
||||
if openbrace > -1
|
||||
let borders[openbrace] = "openbrace"
|
||||
endif
|
||||
if closebrace > -1
|
||||
let borders[closebrace] = "closebrace"
|
||||
endif
|
||||
if colon > -1
|
||||
let borders[colon] = "colon"
|
||||
endif
|
||||
if semicolon > -1
|
||||
let borders[semicolon] = "semicolon"
|
||||
endif
|
||||
if opencomm > -1
|
||||
let borders[opencomm] = "opencomm"
|
||||
endif
|
||||
if closecomm > -1
|
||||
let borders[closecomm] = "closecomm"
|
||||
endif
|
||||
if style > -1
|
||||
let borders[style] = "style"
|
||||
endif
|
||||
if atrule > -1
|
||||
let borders[atrule] = "atrule"
|
||||
endif
|
||||
if exclam > -1
|
||||
let borders[exclam] = "exclam"
|
||||
endif
|
||||
|
||||
|
||||
if len(borders) == 0 || borders[min(keys(borders))] =~ '^\(openbrace\|semicolon\|opencomm\|closecomm\|style\)$'
|
||||
" Complete properties
|
||||
|
||||
let values = split("azimuth background background-attachment background-color background-image background-position background-repeat border bottom border-collapse border-color border-spacing border-style border-top border-right border-bottom border-left border-top-color border-right-color border-bottom-color border-left-color border-top-style border-right-style border-bottom-style border-left-style border-top-width border-right-width border-bottom-width border-left-width border-width caption-side clear clip color content counter-increment counter-reset cue cue-after cue-before cursor display direction elevation empty-cells float font font-family font-size font-style font-variant font-weight height left letter-spacing line-height list-style list-style-image list-style-position list-style-type margin margin-right margin-left margin-top margin-bottom max-height max-width min-height min-width orphans outline outline-color outline-style outline-width overflow padding padding-top padding-right padding-bottom padding-left page-break-after page-break-before page-break-inside pause pause-after pause-before pitch pitch-range play-during position quotes right richness speak speak-header speak-numeral speak-punctuation speech-rate stress table-layout text-align text-decoration text-indent text-transform top unicode-bidi vertical-align visibility voice-family volume white-space width widows word-spacing z-index")
|
||||
|
||||
let entered_property = matchstr(line, '.\{-}\zs[a-zA-Z-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_property
|
||||
call add(res, m . ':')
|
||||
elseif m =~? entered_property
|
||||
call add(res2, m . ':')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif borders[min(keys(borders))] == 'colon'
|
||||
" Get name of property
|
||||
let prop = tolower(matchstr(line, '\zs[a-zA-Z-]*\ze\s*:[^:]\{-}$'))
|
||||
|
||||
if prop == 'azimuth'
|
||||
let values = ["left-side", "far-left", "left", "center-left", "center", "center-right", "right", "far-right", "right-side", "behind", "leftwards", "rightwards"]
|
||||
elseif prop == 'background-attachment'
|
||||
let values = ["scroll", "fixed"]
|
||||
elseif prop == 'background-color'
|
||||
let values = ["transparent", "rgb(", "#"]
|
||||
elseif prop == 'background-image'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'background-position'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z]\+\)\?$'
|
||||
let values = ["top", "center", "bottom"]
|
||||
elseif vals =~ '^[a-zA-Z]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["left", "center", "right"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'background-repeat'
|
||||
let values = ["repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'background'
|
||||
let values = ["url(", "scroll", "fixed", "transparent", "rgb(", "#", "none", "top", "center", "bottom" , "left", "right", "repeat", "repeat-x", "repeat-y", "no-repeat"]
|
||||
elseif prop == 'border-collapse'
|
||||
let values = ["collapse", "separate"]
|
||||
elseif prop == 'border-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop == 'border-spacing'
|
||||
return []
|
||||
elseif prop == 'border-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)$'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-color'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop =~ 'border-\(top\|right\|bottom\|left\)-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'border-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'border'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9.]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9.]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["rgb(", "#", "transparent"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'bottom'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'caption-side'
|
||||
let values = ["top", "bottom"]
|
||||
elseif prop == 'clear'
|
||||
let values = ["none", "left", "right", "both"]
|
||||
elseif prop == 'clip'
|
||||
let values = ["auto", "rect("]
|
||||
elseif prop == 'color'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif prop == 'content'
|
||||
let values = ["normal", "attr(", "open-quote", "close-quote", "no-open-quote", "no-close-quote"]
|
||||
elseif prop =~ 'counter-\(increment\|reset\)$'
|
||||
let values = ["none"]
|
||||
elseif prop =~ '^\(cue-after\|cue-before\|cue\)$'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'cursor'
|
||||
let values = ["url(", "auto", "crosshair", "default", "pointer", "move", "e-resize", "ne-resize", "nw-resize", "n-resize", "se-resize", "sw-resize", "s-resize", "w-resize", "text", "wait", "help", "progress"]
|
||||
elseif prop == 'direction'
|
||||
let values = ["ltr", "rtl"]
|
||||
elseif prop == 'display'
|
||||
let values = ["inline", "block", "list-item", "run-in", "inline-block", "table", "inline-table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption", "none"]
|
||||
elseif prop == 'elevation'
|
||||
let values = ["below", "level", "above", "higher", "lower"]
|
||||
elseif prop == 'empty-cells'
|
||||
let values = ["show", "hide"]
|
||||
elseif prop == 'float'
|
||||
let values = ["left", "right", "none"]
|
||||
elseif prop == 'font-family'
|
||||
let values = ["sans-serif", "serif", "monospace", "cursive", "fantasy"]
|
||||
elseif prop == 'font-size'
|
||||
let values = ["xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller"]
|
||||
elseif prop == 'font-style'
|
||||
let values = ["normal", "italic", "oblique"]
|
||||
elseif prop == 'font-variant'
|
||||
let values = ["normal", "small-caps"]
|
||||
elseif prop == 'font-weight'
|
||||
let values = ["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]
|
||||
elseif prop == 'font'
|
||||
let values = ["normal", "italic", "oblique", "small-caps", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900", "xx-small", "x-small", "small", "medium", "large", "x-large", "xx-large", "larger", "smaller", "sans-serif", "serif", "monospace", "cursive", "fantasy", "caption", "icon", "menu", "message-box", "small-caption", "status-bar"]
|
||||
elseif prop =~ '^\(height\|width\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop =~ '^\(left\|rigth\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'letter-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'line-height'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'list-style-image'
|
||||
let values = ["url(", "none"]
|
||||
elseif prop == 'list-style-position'
|
||||
let values = ["inside", "outside"]
|
||||
elseif prop == 'list-style-type'
|
||||
let values = ["disc", "circle", "square", "decimal", "decimal-leading-zero", "lower-roman", "upper-roman", "lower-latin", "upper-latin", "none"]
|
||||
elseif prop == 'list-style'
|
||||
return []
|
||||
elseif prop == 'margin'
|
||||
let values = ["auto"]
|
||||
elseif prop =~ 'margin-\(right\|left\|top\|bottom\)$'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-height'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'max-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-height'
|
||||
let values = ["none"]
|
||||
elseif prop == 'min-width'
|
||||
let values = ["none"]
|
||||
elseif prop == 'orphans'
|
||||
return []
|
||||
elseif prop == 'outline-color'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif prop == 'outline-style'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif prop == 'outline-width'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
elseif prop == 'outline'
|
||||
let vals = matchstr(line, '.*:\s*\zs.*')
|
||||
if vals =~ '^\([a-zA-Z0-9,()#]\+\)\?$'
|
||||
let values = ["rgb(", "#"]
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+\([a-zA-Z]\+\)\?$'
|
||||
let values = ["none", "hidden", "dotted", "dashed", "solid", "double", "groove", "ridge", "inset", "outset"]
|
||||
elseif vals =~ '^[a-zA-Z0-9,()#]\+\s\+[a-zA-Z]\+\s\+\([a-zA-Z(]\+\)\?$'
|
||||
let values = ["thin", "thick", "medium"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
elseif prop == 'overflow'
|
||||
let values = ["visible", "hidden", "scroll", "auto"]
|
||||
elseif prop == 'padding'
|
||||
return []
|
||||
elseif prop =~ 'padding-\(top\|right\|bottom\|left\)$'
|
||||
return []
|
||||
elseif prop =~ 'page-break-\(after\|before\)$'
|
||||
let values = ["auto", "always", "avoid", "left", "right"]
|
||||
elseif prop == 'page-break-inside'
|
||||
let values = ["auto", "avoid"]
|
||||
elseif prop =~ 'pause-\(after\|before\)$'
|
||||
return []
|
||||
elseif prop == 'pause'
|
||||
return []
|
||||
elseif prop == 'pitch-range'
|
||||
return []
|
||||
elseif prop == 'pitch'
|
||||
let values = ["x-low", "low", "medium", "high", "x-high"]
|
||||
elseif prop == 'play-during'
|
||||
let values = ["url(", "mix", "repeat", "auto", "none"]
|
||||
elseif prop == 'position'
|
||||
let values = ["static", "relative", "absolute", "fixed"]
|
||||
elseif prop == 'quotes'
|
||||
let values = ["none"]
|
||||
elseif prop == 'richness'
|
||||
return []
|
||||
elseif prop == 'speak-header'
|
||||
let values = ["once", "always"]
|
||||
elseif prop == 'speak-numeral'
|
||||
let values = ["digits", "continuous"]
|
||||
elseif prop == 'speak-punctuation'
|
||||
let values = ["code", "none"]
|
||||
elseif prop == 'speak'
|
||||
let values = ["normal", "none", "spell-out"]
|
||||
elseif prop == 'speech-rate'
|
||||
let values = ["x-slow", "slow", "medium", "fast", "x-fast", "faster", "slower"]
|
||||
elseif prop == 'stress'
|
||||
return []
|
||||
elseif prop == 'table-layout'
|
||||
let values = ["auto", "fixed"]
|
||||
elseif prop == 'text-align'
|
||||
let values = ["left", "right", "center", "justify"]
|
||||
elseif prop == 'text-decoration'
|
||||
let values = ["none", "underline", "overline", "line-through", "blink"]
|
||||
elseif prop == 'text-indent'
|
||||
return []
|
||||
elseif prop == 'text-transform'
|
||||
let values = ["capitalize", "uppercase", "lowercase", "none"]
|
||||
elseif prop == 'top'
|
||||
let values = ["auto"]
|
||||
elseif prop == 'unicode-bidi'
|
||||
let values = ["normal", "embed", "bidi-override"]
|
||||
elseif prop == 'vertical-align'
|
||||
let values = ["baseline", "sub", "super", "top", "text-top", "middle", "bottom", "text-bottom"]
|
||||
elseif prop == 'visibility'
|
||||
let values = ["visible", "hidden", "collapse"]
|
||||
elseif prop == 'voice-family'
|
||||
return []
|
||||
elseif prop == 'volume'
|
||||
let values = ["silent", "x-soft", "soft", "medium", "loud", "x-loud"]
|
||||
elseif prop == 'white-space'
|
||||
let values = ["normal", "pre", "nowrap", "pre-wrap", "pre-line"]
|
||||
elseif prop == 'widows'
|
||||
return []
|
||||
elseif prop == 'word-spacing'
|
||||
let values = ["normal"]
|
||||
elseif prop == 'z-index'
|
||||
let values = ["auto"]
|
||||
else
|
||||
" If no property match it is possible we are outside of {} and
|
||||
" trying to complete pseudo-(class|element)
|
||||
let element = tolower(matchstr(line, '\zs[a-zA-Z1-6]*\ze:[^:[:space:]]\{-}$'))
|
||||
if ",a,abbr,acronym,address,area,b,base,bdo,big,blockquote,body,br,button,caption,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,fieldset,form,head,h1,h2,h3,h4,h5,h6,hr,html,i,img,input,ins,kbd,label,legend,li,link,map,meta,noscript,object,ol,optgroup,option,p,param,pre,q,samp,script,select,small,span,strong,style,sub,sup,table,tbody,td,textarea,tfoot,th,thead,title,tr,tt,ul,var," =~ ','.element.','
|
||||
let values = ["first-child", "link", "visited", "hover", "active", "focus", "lang", "first-line", "first-letter", "before", "after"]
|
||||
else
|
||||
return []
|
||||
endif
|
||||
endif
|
||||
|
||||
" Complete values
|
||||
let entered_value = matchstr(line, '.\{-}\zs[a-zA-Z0-9#,.(_-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_value
|
||||
call add(res, m)
|
||||
elseif m =~? entered_value
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
elseif borders[min(keys(borders))] == 'closebrace'
|
||||
|
||||
return []
|
||||
|
||||
elseif borders[min(keys(borders))] == 'exclam'
|
||||
|
||||
" Complete values
|
||||
let entered_imp = matchstr(line, '.\{-}!\s*\zs[a-zA-Z ]*$')
|
||||
|
||||
let values = ["important"]
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_imp
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res
|
||||
|
||||
elseif borders[min(keys(borders))] == 'atrule'
|
||||
|
||||
let afterat = matchstr(line, '.*@\zs.*')
|
||||
|
||||
if afterat =~ '\s'
|
||||
|
||||
let atrulename = matchstr(line, '.*@\zs[a-zA-Z-]\+\ze')
|
||||
|
||||
if atrulename == 'media'
|
||||
let values = ["screen", "tty", "tv", "projection", "handheld", "print", "braille", "aural", "all"]
|
||||
|
||||
let atruleafterbase = matchstr(line, '.*@media\s\+\ze.*$')
|
||||
let entered_atruleafter = matchstr(line, '.*@media\s\+\zs.*$')
|
||||
|
||||
elseif atrulename == 'import'
|
||||
let atruleafterbase = matchstr(line, '.*@import\s\+\ze.*$')
|
||||
let entered_atruleafter = matchstr(line, '.*@import\s\+\zs.*$')
|
||||
|
||||
if entered_atruleafter =~ "^[\"']"
|
||||
let filestart = matchstr(entered_atruleafter, '^.\zs.*')
|
||||
let files = split(glob(filestart.'*'), '\n')
|
||||
let values = map(copy(files), '"\"".v:val')
|
||||
|
||||
elseif entered_atruleafter =~ "^url("
|
||||
let filestart = matchstr(entered_atruleafter, "^url([\"']\\?\\zs.*")
|
||||
let files = split(glob(filestart.'*'), '\n')
|
||||
let values = map(copy(files), '"url(".v:val')
|
||||
|
||||
else
|
||||
let values = ['"', 'url(']
|
||||
|
||||
endif
|
||||
|
||||
else
|
||||
return []
|
||||
|
||||
endif
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_atruleafter
|
||||
call add(res, m)
|
||||
elseif m =~? entered_atruleafter
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
let values = ["charset", "page", "media", "import", "font-face"]
|
||||
|
||||
let entered_atrule = matchstr(line, '.*@\zs[a-zA-Z-]*$')
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.entered_atrule
|
||||
call add(res, m .' ')
|
||||
elseif m =~? entered_atrule
|
||||
call add(res2, m .' ')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
return []
|
||||
|
||||
endif
|
||||
endfunction
|
||||
173
runtime/autoload/gzip.vim
Normal file
173
runtime/autoload/gzip.vim
Normal file
@@ -0,0 +1,173 @@
|
||||
" Vim autoload file for editing compressed files.
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2005 Jul 26
|
||||
|
||||
" These functions are used by the gzip plugin.
|
||||
|
||||
" Function to check that executing "cmd [-f]" works.
|
||||
" The result is cached in s:have_"cmd" for speed.
|
||||
fun s:check(cmd)
|
||||
let name = substitute(a:cmd, '\(\S*\).*', '\1', '')
|
||||
if !exists("s:have_" . name)
|
||||
let e = executable(name)
|
||||
if e < 0
|
||||
let r = system(name . " --version")
|
||||
let e = (r !~ "not found" && r != "")
|
||||
endif
|
||||
exe "let s:have_" . name . "=" . e
|
||||
endif
|
||||
exe "return s:have_" . name
|
||||
endfun
|
||||
|
||||
" Set b:gzip_comp_arg to the gzip argument to be used for compression, based on
|
||||
" the flags in the compressed file.
|
||||
" The only compression methods that can be detected are max speed (-1) and max
|
||||
" compression (-9).
|
||||
fun s:set_compression(line)
|
||||
" get the Compression Method
|
||||
let l:cm = char2nr(a:line[2])
|
||||
" if it's 8 (DEFLATE), we can check for the compression level
|
||||
if l:cm == 8
|
||||
" get the eXtra FLags
|
||||
let l:xfl = char2nr(a:line[8])
|
||||
" max compression
|
||||
if l:xfl == 2
|
||||
let b:gzip_comp_arg = "-9"
|
||||
" min compression
|
||||
elseif l:xfl == 4
|
||||
let b:gzip_comp_arg = "-1"
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
|
||||
" After reading compressed file: Uncompress text in buffer with "cmd"
|
||||
fun gzip#read(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if !s:check(a:cmd)
|
||||
return
|
||||
endif
|
||||
|
||||
" for gzip check current compression level and set b:gzip_comp_arg.
|
||||
silent! unlet b:gzip_comp_arg
|
||||
if a:cmd[0] == 'g'
|
||||
call s:set_compression(getline(1))
|
||||
endif
|
||||
|
||||
" make 'patchmode' empty, we don't want a copy of the written file
|
||||
let pm_save = &pm
|
||||
set pm=
|
||||
" remove 'a' and 'A' from 'cpo' to avoid the alternate file changes
|
||||
let cpo_save = &cpo
|
||||
set cpo-=a cpo-=A
|
||||
" set 'modifiable'
|
||||
let ma_save = &ma
|
||||
setlocal ma
|
||||
" when filtering the whole buffer, it will become empty
|
||||
let empty = line("'[") == 1 && line("']") == line("$")
|
||||
let tmp = tempname()
|
||||
let tmpe = tmp . "." . expand("<afile>:e")
|
||||
" write the just read lines to a temp file "'[,']w tmp.gz"
|
||||
execute "silent '[,']w " . tmpe
|
||||
" uncompress the temp file: call system("gzip -dn tmp.gz")
|
||||
call system(a:cmd . " " . tmpe)
|
||||
if !filereadable(tmp)
|
||||
" uncompress didn't work! Keep the compressed file then.
|
||||
echoerr "Error: Could not read uncompressed file"
|
||||
return
|
||||
endif
|
||||
" delete the compressed lines; remember the line number
|
||||
let l = line("'[") - 1
|
||||
if exists(":lockmarks")
|
||||
lockmarks '[,']d _
|
||||
else
|
||||
'[,']d _
|
||||
endif
|
||||
" read in the uncompressed lines "'[-1r tmp"
|
||||
setlocal nobin
|
||||
if exists(":lockmarks")
|
||||
execute "silent lockmarks " . l . "r " . tmp
|
||||
else
|
||||
execute "silent " . l . "r " . tmp
|
||||
endif
|
||||
|
||||
" if buffer became empty, delete trailing blank line
|
||||
if empty
|
||||
silent $delete _
|
||||
1
|
||||
endif
|
||||
" delete the temp file and the used buffers
|
||||
call delete(tmp)
|
||||
silent! exe "bwipe " . tmp
|
||||
silent! exe "bwipe " . tmpe
|
||||
let &pm = pm_save
|
||||
let &cpo = cpo_save
|
||||
let &l:ma = ma_save
|
||||
" When uncompressed the whole buffer, do autocommands
|
||||
if empty
|
||||
if &verbose >= 8
|
||||
execute "doau BufReadPost " . expand("%:r")
|
||||
else
|
||||
execute "silent! doau BufReadPost " . expand("%:r")
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" After writing compressed file: Compress written file with "cmd"
|
||||
fun gzip#write(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if s:check(a:cmd)
|
||||
" Rename the file before compressing it.
|
||||
let nm = resolve(expand("<afile>"))
|
||||
let nmt = s:tempname(nm)
|
||||
if rename(nm, nmt) == 0
|
||||
if exists("b:gzip_comp_arg")
|
||||
call system(a:cmd . " " . b:gzip_comp_arg . " " . nmt)
|
||||
else
|
||||
call system(a:cmd . " " . nmt)
|
||||
endif
|
||||
call rename(nmt . "." . expand("<afile>:e"), nm)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" Before appending to compressed file: Uncompress file with "cmd"
|
||||
fun gzip#appre(cmd)
|
||||
" don't do anything if the cmd is not supported
|
||||
if s:check(a:cmd)
|
||||
let nm = expand("<afile>")
|
||||
|
||||
" for gzip check current compression level and set b:gzip_comp_arg.
|
||||
silent! unlet b:gzip_comp_arg
|
||||
if a:cmd[0] == 'g'
|
||||
call s:set_compression(readfile(nm, "b", 1)[0])
|
||||
endif
|
||||
|
||||
" Rename to a weird name to avoid the risk of overwriting another file
|
||||
let nmt = expand("<afile>:p:h") . "/X~=@l9q5"
|
||||
let nmte = nmt . "." . expand("<afile>:e")
|
||||
if rename(nm, nmte) == 0
|
||||
if &patchmode != "" && getfsize(nm . &patchmode) == -1
|
||||
" Create patchmode file by creating the decompressed file new
|
||||
call system(a:cmd . " -c " . nmte . " > " . nmt)
|
||||
call rename(nmte, nm . &patchmode)
|
||||
else
|
||||
call system(a:cmd . " " . nmte)
|
||||
endif
|
||||
call rename(nmt, nm)
|
||||
endif
|
||||
endif
|
||||
endfun
|
||||
|
||||
" find a file name for the file to be compressed. Use "name" without an
|
||||
" extension if possible. Otherwise use a weird name to avoid overwriting an
|
||||
" existing file.
|
||||
fun s:tempname(name)
|
||||
let fn = fnamemodify(a:name, ":r")
|
||||
if !filereadable(fn) && !isdirectory(fn)
|
||||
return fn
|
||||
endif
|
||||
return fnamemodify(a:name, ":p:h") . "/X~=@l9q5"
|
||||
endfun
|
||||
|
||||
" vim: set sw=2 :
|
||||
4674
runtime/autoload/htmlcomplete.vim
Normal file
4674
runtime/autoload/htmlcomplete.vim
Normal file
File diff suppressed because it is too large
Load Diff
625
runtime/autoload/javascriptcomplete.vim
Normal file
625
runtime/autoload/javascriptcomplete.vim
Normal file
@@ -0,0 +1,625 @@
|
||||
" Vim completion script
|
||||
" Language: Java Script
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Feb 6
|
||||
|
||||
function! javascriptcomplete#CompleteJS(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let curline = line('.')
|
||||
let compl_begin = col('.') - 2
|
||||
" Bit risky but JS is rather limited language and local chars shouldn't
|
||||
" fint way into names
|
||||
while start >= 0 && line[start - 1] =~ '\k'
|
||||
let start -= 1
|
||||
endwhile
|
||||
let b:compl_context = getline('.')[0:compl_begin]
|
||||
return start
|
||||
else
|
||||
" Initialize base return lists
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
" Shortcontext is context without a:base, useful for checking if we are
|
||||
" looking for objects and for what objects we are looking for
|
||||
let context = b:compl_context
|
||||
let shortcontext = substitute(context, a:base.'$', '', '')
|
||||
unlet! b:compl_context
|
||||
|
||||
if exists("b:jsrange")
|
||||
let file = getline(b:jsrange[0],b:jsrange[1])
|
||||
unlet! b:jsrange
|
||||
|
||||
if len(b:js_extfiles) > 0
|
||||
let file = b:js_extfiles + file
|
||||
endif
|
||||
|
||||
else
|
||||
let file = getline(1, '$')
|
||||
endif
|
||||
|
||||
|
||||
" Completion of properties, methods, etc. {{{
|
||||
if shortcontext =~ '\.$'
|
||||
" Complete methods and properties for objects
|
||||
" DOM separate
|
||||
let doms = ['style.']
|
||||
" Arrays
|
||||
let arrayprop = ['constructor', 'index', 'input', 'length', 'prototype']
|
||||
let arraymeth = ['concat', 'join', 'pop', 'push', 'reverse', 'shift',
|
||||
\ 'splice', 'sort', 'toSource', 'toString', 'unshift', 'valueOf',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(arraymeth, 'v:val."("')
|
||||
let arrays = arrayprop + arraymeth
|
||||
|
||||
" Boolean - complete subset of array values
|
||||
" properties - constructor, prototype
|
||||
" methods - toSource, toString, valueOf
|
||||
|
||||
" Date
|
||||
" properties - constructor, prototype
|
||||
let datemeth = ['getDate', 'getDay', 'getFullYear', 'getHours', 'getMilliseconds',
|
||||
\ 'getMinutes', 'getMonth', 'getSeconds', 'getTime', 'getTimezoneOffset',
|
||||
\ 'getUTCDate', 'getUTCDay', 'getUTCFullYear', 'getUTCHours', 'getUTCMilliseconds',
|
||||
\ 'getUTCMinutes', 'getUTCMonth', 'getUTCSeconds',
|
||||
\ 'getYear', 'parse', 'parse',
|
||||
\ 'setDate', 'setDay', 'setFullYear', 'setHours', 'setMilliseconds',
|
||||
\ 'setMinutes', 'setMonth', 'setSeconds',
|
||||
\ 'setUTCDate', 'setUTCDay', 'setUTCFullYear', 'setUTCHours', 'setUTCMilliseconds',
|
||||
\ 'setUTCMinutes', 'setUTCMonth', 'setUTCSeconds', 'setYear', 'setTime',
|
||||
\ 'toGMTString', 'toLocaleString', 'toLocaleDateString', 'toLocaleTimeString',
|
||||
\ 'toSource', 'toString', 'toUTCString', 'UTC', 'valueOf', 'watch', 'unwatch']
|
||||
call map(datemeth, 'v:val."("')
|
||||
let dates = datemeth
|
||||
|
||||
" Function
|
||||
let funcprop = ['arguments', 'arguments.callee', 'arguments.caller', 'arguments.length',
|
||||
\ 'arity', 'constructor', 'length', 'prototype']
|
||||
let funcmeth = ['apply', 'call', 'toSource', 'toString', 'valueOf']
|
||||
call map(funcmeth, 'v:val."("')
|
||||
let funcs = funcprop + funcmeth
|
||||
|
||||
" Math
|
||||
let mathprop = ['E', 'LN2', 'LN10', 'LOG2E', 'LOG10E', 'PI', 'SQRT1_2', 'SQRT']
|
||||
let mathmeth = ['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor',
|
||||
\ 'log', 'max', 'min', 'pow', 'random', 'round', 'sin', 'sqrt', 'tan',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(mathmeth, 'v:val."("')
|
||||
let maths = mathprop + mathmeth
|
||||
|
||||
" Number
|
||||
let numbprop = ['MAX_VALUE', 'MIN_VALUE', 'NaN', 'NEGATIVE_INFINITY', 'POSITIVE_INFINITY',
|
||||
\ 'constructor', 'prototype']
|
||||
let numbmeth = ['toExponential', 'toFixed', 'toPrecision', 'toSource', 'toString', 'valueOf',
|
||||
\ 'watch', 'unwatch']
|
||||
call map(numbmeth, 'v:val."("')
|
||||
let numbs = numbprop + numbmeth
|
||||
|
||||
" Object
|
||||
let objeprop = ['constructor', 'prototype']
|
||||
let objemeth = ['eval', 'toSource', 'toString', 'unwatch', 'watch', 'valueOf']
|
||||
call map(objemeth, 'v:val."("')
|
||||
let objes = objeprop + objemeth
|
||||
|
||||
" RegExp
|
||||
let regeprop = ['constructor', 'global', 'ignoreCase', 'lastIndex', 'multiline', 'source', 'prototype']
|
||||
let regemeth = ['exec', 'test', 'toSource', 'toString', 'watch', 'unwatch']
|
||||
call map(regemeth, 'v:val."("')
|
||||
let reges = regeprop + regemeth
|
||||
|
||||
" String
|
||||
let striprop = ['constructor', 'length', 'prototype']
|
||||
let strimeth = ['anchor', 'big', 'blink', 'bold', 'charAt', 'charCodeAt', 'concat',
|
||||
\ 'fixed', 'fontcolor', 'fontsize', 'fromCharCode', 'indexOf', 'italics',
|
||||
\ 'lastIndexOf', 'link', 'match', 'replace', 'search', 'slice', 'small',
|
||||
\ 'split', 'strike', 'sub', 'substr', 'substring', 'sup', 'toLowerCase',
|
||||
\ 'toSource', 'toString', 'toUpperCase', 'watch', 'unwatch']
|
||||
call map(strimeth, 'v:val."("')
|
||||
let stris = striprop + strimeth
|
||||
|
||||
" User created properties
|
||||
let user_props1 = filter(copy(file), 'v:val =~ "this\\.\\k"')
|
||||
let juser_props1 = join(user_props1, ' ')
|
||||
let user_props1 = split(juser_props1, '\zethis\.')
|
||||
unlet! juser_props1
|
||||
call map(user_props1, 'matchstr(v:val, "this\\.\\zs\\k\\+\\ze")')
|
||||
|
||||
let user_props2 = filter(copy(file), 'v:val =~ "\\.prototype\\.\\k"')
|
||||
let juser_props2 = join(user_props2, ' ')
|
||||
let user_props2 = split(juser_props2, '\zeprototype\.')
|
||||
unlet! juser_props2
|
||||
call map(user_props2, 'matchstr(v:val, "prototype\\.\\zs\\k\\+\\ze")')
|
||||
let user_props = user_props1 + user_props2
|
||||
|
||||
" HTML DOM properties
|
||||
" Anchors - anchor.
|
||||
let anchprop = ['accessKey', 'charset', 'coords', 'href', 'hreflang', 'id', 'innerHTML',
|
||||
\ 'name', 'rel', 'rev', 'shape', 'tabIndex', 'target', 'type', 'onBlur', 'onFocus']
|
||||
let anchmeth = ['blur', 'focus']
|
||||
call map(anchmeth, 'v:val."("')
|
||||
let anths = anchprop + anchmeth
|
||||
" Area - area.
|
||||
let areaprop = ['accessKey', 'alt', 'coords', 'hash', 'host', 'hostname', 'href', 'id',
|
||||
\ 'noHref', 'pathname', 'port', 'protocol', 'search', 'shape', 'tabIndex', 'target']
|
||||
let areameth = ['onClick', 'onDblClick', 'onMouseOut', 'onMouseOver']
|
||||
call map(areameth, 'v:val."("')
|
||||
let areas = areaprop + areameth
|
||||
" Base - base.
|
||||
let baseprop = ['href', 'id', 'target']
|
||||
let bases = baseprop
|
||||
" Body - body.
|
||||
let bodyprop = ['aLink', 'background', 'gbColor', 'id', 'link', 'scrollLeft', 'scrollTop',
|
||||
\ 'text', 'vLink']
|
||||
let bodys = bodyprop
|
||||
" Document - document.
|
||||
let docuprop = ['anchors', 'applets', 'childNodes', 'embeds', 'forms', 'images', 'links', 'stylesheets',
|
||||
\ 'body', 'cookie', 'documentElement', 'domain', 'lastModified', 'referrer', 'title', 'URL']
|
||||
let documeth = ['close', 'createAttribute', 'createElement', 'createTextNode', 'focus', 'getElementById',
|
||||
\ 'getElementsByName', 'getElementsByTagName', 'open', 'write', 'writeln',
|
||||
\ 'onClick', 'onDblClick', 'onFocus', 'onKeyDown', 'onKeyPress', 'onKeyUp',
|
||||
\ 'onMouseDown', 'onMouseMove', 'onMouseOut', 'onMouseOver', 'onMouseUp', 'onResize']
|
||||
call map(documeth, 'v:val."("')
|
||||
let docuxprop = ['attributes', 'childNodes', 'doctype', 'documentElement', 'firstChild',
|
||||
\ 'implementation', 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType',
|
||||
\ 'nodeValue', 'ownerDocument', 'parentNode', 'previousSibling']
|
||||
let docuxmeth = ['createAttribute', 'createCDATASection',
|
||||
\ 'createComment', 'createDocument', 'createDocumentFragment',
|
||||
\ 'createElement', 'createEntityReference', 'createProcessingInstruction',
|
||||
\ 'createTextNode']
|
||||
call map(docuxmeth, 'v:val."("')
|
||||
let docus = docuprop + docuxprop + documeth + docuxmeth
|
||||
" Form - form.
|
||||
let formprop = ['elements', 'acceptCharset', 'action', 'encoding', 'enctype', 'id', 'length',
|
||||
\ 'method', 'name', 'tabIndex', 'target']
|
||||
let formmeth = ['reset', 'submit', 'onReset', 'onSubmit']
|
||||
call map(formmeth, 'v:val."("')
|
||||
let forms = formprop + formmeth
|
||||
" Frame - frame.
|
||||
let framprop = ['contentDocument', 'frameBorder', 'id', 'longDesc', 'marginHeight', 'marginWidth',
|
||||
\ 'name', 'noResize', 'scrolling', 'src']
|
||||
let frammeth = ['blur', 'focus']
|
||||
call map(frammeth, 'v:val."("')
|
||||
let frams = framprop + frammeth
|
||||
" Frameset - frameset.
|
||||
let fsetprop = ['cols', 'id', 'rows']
|
||||
let fsetmeth = ['blur', 'focus']
|
||||
call map(fsetmeth, 'v:val."("')
|
||||
let fsets = fsetprop + fsetmeth
|
||||
" History - history.
|
||||
let histprop = ['length']
|
||||
let histmeth = ['back', 'forward', 'go']
|
||||
call map(histmeth, 'v:val."("')
|
||||
let hists = histprop + histmeth
|
||||
" Iframe - iframe.
|
||||
let ifraprop = ['align', 'frameBorder', 'height', 'id', 'longDesc', 'marginHeight', 'marginWidth',
|
||||
\ 'name', 'scrolling', 'src', 'width']
|
||||
let ifras = ifraprop
|
||||
" Image - image.
|
||||
let imagprop = ['align', 'alt', 'border', 'complete', 'height', 'hspace', 'id', 'isMap', 'longDesc',
|
||||
\ 'lowSrc', 'name', 'src', 'useMap', 'vspace', 'width']
|
||||
let imagmeth = ['onAbort', 'onError', 'onLoad']
|
||||
call map(imagmeth, 'v:val."("')
|
||||
let imags = histprop + imagmeth
|
||||
" Button - accessible only by other properties
|
||||
let buttprop = ['accessKey', 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let buttmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(buttmeth, 'v:val."("')
|
||||
let butts = buttprop + buttmeth
|
||||
" Checkbox - accessible only by other properties
|
||||
let checprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let checmeth = ['blur', 'click', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(checmeth, 'v:val."("')
|
||||
let checs = checprop + checmeth
|
||||
" File upload - accessible only by other properties
|
||||
let fileprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let filemeth = ['blur', 'focus', 'onBlur', 'onClick', 'onFocus', 'onMouseDown', 'onMouseUp']
|
||||
call map(filemeth, 'v:val."("')
|
||||
let files = fileprop + filemeth
|
||||
" Hidden - accessible only by other properties
|
||||
let hiddprop = ['defaultValue', 'form', 'id', 'name', 'type', 'value']
|
||||
let hidds = hiddprop
|
||||
" Password - accessible only by other properties
|
||||
let passprop = ['accept', 'accessKey', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly', 'size', 'tabIndex',
|
||||
\ 'type', 'value']
|
||||
let passmeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus', 'onKeyDown',
|
||||
\ 'onKeyPress', 'onKeyUp']
|
||||
call map(passmeth, 'v:val."("')
|
||||
let passs = passprop + passmeth
|
||||
" Radio - accessible only by other properties
|
||||
let radiprop = ['accept', 'accessKey', 'align', 'alt', 'checked', 'defaultChecked',
|
||||
\ 'disabled', 'form', 'id', 'name', 'tabIndex', 'type', 'value']
|
||||
let radimeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
|
||||
call map(radimeth, 'v:val."("')
|
||||
let radis = radiprop + radimeth
|
||||
" Reset - accessible only by other properties
|
||||
let reseprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
|
||||
let resemeth = ['blur', 'click', 'focus', 'select', 'onBlur', 'onFocus']
|
||||
call map(resemeth, 'v:val."("')
|
||||
let reses = reseprop + resemeth
|
||||
" Submit - accessible only by other properties
|
||||
let submprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'size', 'tabIndex', 'type', 'value']
|
||||
let submmeth = ['blur', 'click', 'focus', 'select', 'onClick', 'onSelectStart']
|
||||
call map(submmeth, 'v:val."("')
|
||||
let subms = submprop + submmeth
|
||||
" Text - accessible only by other properties
|
||||
let textprop = ['accept', 'accessKey', 'align', 'alt', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'maxLength', 'name', 'readOnly',
|
||||
\ 'size', 'tabIndex', 'type', 'value']
|
||||
let textmeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus', 'onKeyDown',
|
||||
\ 'onKeyPress', 'onKeyUp', 'onSelect']
|
||||
call map(textmeth, 'v:val."("')
|
||||
let texts = textprop + textmeth
|
||||
" Link - link.
|
||||
let linkprop = ['charset', 'disabled', 'href', 'hreflang', 'id', 'media',
|
||||
\ 'rel', 'rev', 'target', 'type']
|
||||
let linkmeth = ['onLoad']
|
||||
call map(linkmeth, 'v:val."("')
|
||||
let links = linkprop + linkmeth
|
||||
" Location - location.
|
||||
let locaprop = ['href', 'hash', 'host', 'hostname', 'pathname', 'port', 'protocol',
|
||||
\ 'search']
|
||||
let locameth = ['assign', 'reload', 'replace']
|
||||
call map(locameth, 'v:val."("')
|
||||
let locas = locaprop + locameth
|
||||
" Meta - meta.
|
||||
let metaprop = ['charset', 'content', 'disabled', 'httpEquiv', 'name', 'scheme']
|
||||
let metas = metaprop
|
||||
" Navigator - navigator.
|
||||
let naviprop = ['plugins', 'appCodeName', 'appName', 'appVersion', 'cookieEnabled',
|
||||
\ 'platform', 'userAgent']
|
||||
let navimeth = ['javaEnabled', 'taintEnabled']
|
||||
call map(navimeth, 'v:val."("')
|
||||
let navis = naviprop + navimeth
|
||||
" Object - object.
|
||||
let objeprop = ['align', 'archive', 'border', 'code', 'codeBase', 'codeType', 'data',
|
||||
\ 'declare', 'form', 'height', 'hspace', 'id', 'name', 'standby', 'tabIndex',
|
||||
\ 'type', 'useMap', 'vspace', 'width']
|
||||
let objes = objeprop
|
||||
" Option - accessible only by other properties
|
||||
let optiprop = ['defaultSelected',
|
||||
\ 'disabled', 'form', 'id', 'index', 'label', 'selected', 'text', 'value']
|
||||
let optis = optiprop
|
||||
" Screen - screen.
|
||||
let screprop = ['availHeight', 'availWidth', 'colorDepth', 'height', 'width']
|
||||
let scres = screprop
|
||||
" Select - accessible only by other properties
|
||||
let seleprop = ['options', 'disabled', 'form', 'id', 'length', 'multiple', 'name',
|
||||
\ 'selectedIndex', 'size', 'tabIndex', 'type', 'value']
|
||||
let selemeth = ['blur', 'focus', 'remove', 'onBlur', 'onChange', 'onFocus']
|
||||
call map(selemeth, 'v:val."("')
|
||||
let seles = seleprop + selemeth
|
||||
" Style - style.
|
||||
let stylprop = ['background', 'backgroundAttachment', 'backgroundColor', 'backgroundImage',
|
||||
\ 'backgroundPosition', 'backgroundRepeat',
|
||||
\ 'border', 'borderBottom', 'borderLeft', 'borderRight', 'borderTop',
|
||||
\ 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor',
|
||||
\ 'borderBottomStyle', 'borderLeftStyle', 'borderRightStyle', 'borderTopStyle',
|
||||
\ 'borderBottomWidth', 'borderLeftWidth', 'borderRightWidth', 'borderTopWidth',
|
||||
\ 'borderColor', 'borderStyle', 'borderWidth', 'margin', 'marginBottom',
|
||||
\ 'marginLeft', 'marginRight', 'marginTop', 'outline', 'outlineStyle', 'outlineWidth',
|
||||
\ 'outlineColor', 'outlineStyle', 'outlineWidth', 'padding', 'paddingBottom',
|
||||
\ 'paddingLeft', 'paddingRight', 'paddingTop',
|
||||
\ 'clear', 'clip', 'clipBottom', 'clipLeft', 'clipRight', 'clipTop', 'content',
|
||||
\ 'counterIncrement', 'counterReset', 'cssFloat', 'cursor', 'direction',
|
||||
\ 'display', 'markerOffset', 'marks', 'maxHeight', 'maxWidth', 'minHeight',
|
||||
\ 'minWidth', 'overflow', 'overflowX', 'overflowY', 'verticalAlign', 'visibility',
|
||||
\ 'width',
|
||||
\ 'listStyle', 'listStyleImage', 'listStylePosition', 'listStyleType',
|
||||
\ 'cssText', 'bottom', 'height', 'left', 'position', 'right', 'top', 'width', 'zindex',
|
||||
\ 'orphans', 'widows', 'page', 'pageBreakAfter', 'pageBreakBefore', 'pageBreakInside',
|
||||
\ 'borderCollapse', 'borderSpacing', 'captionSide', 'emptyCells', 'tableLayout',
|
||||
\ 'color', 'font', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch',
|
||||
\ 'fontStyle', 'fontVariant', 'fontWeight', 'letterSpacing', 'lineHeight', 'quotes',
|
||||
\ 'textAlign', 'textIndent', 'textShadow', 'textTransform', 'textUnderlinePosition',
|
||||
\ 'unicodeBidi', 'whiteSpace', 'wordSpacing']
|
||||
let styls = stylprop
|
||||
" Table - table.
|
||||
let tablprop = ['rows', 'tBodies', 'align', 'bgColor', 'border', 'caption', 'cellPadding',
|
||||
\ 'cellSpacing', 'frame', 'height', 'rules', 'summary', 'tFoot', 'tHead', 'width']
|
||||
let tablmeth = ['createCaption', 'createTFoot', 'createTHead', 'deleteCaption', 'deleteRow',
|
||||
\ 'deleteTFoot', 'deleteTHead', 'insertRow']
|
||||
call map(tablmeth, 'v:val."("')
|
||||
let tabls = tablprop + tablmeth
|
||||
" Table data - TableData.
|
||||
let tdatprop = ['abbr', 'align', 'axis', 'bgColor', 'cellIndex', 'ch', 'chOff',
|
||||
\ 'colSpan', 'headers', 'noWrap', 'rowSpan', 'scope', 'vAlign', 'width']
|
||||
let tdats = tdatprop
|
||||
" Table row - TableRow.
|
||||
let trowprop = ['cells', 'align', 'bgColor', 'ch', 'chOff', 'rowIndex', 'sectionRowIndex',
|
||||
\ 'vAlign']
|
||||
let trowmeth = ['deleteCell', 'insertCell']
|
||||
call map(trowmeth, 'v:val."("')
|
||||
let trows = trowprop + trowmeth
|
||||
" Textarea - accessible only by other properties
|
||||
let tareprop = ['accessKey', 'cols', 'defaultValue',
|
||||
\ 'disabled', 'form', 'id', 'name', 'readOnly', 'rows',
|
||||
\ 'tabIndex', 'type', 'value', 'selectionStart', 'selectionEnd']
|
||||
let taremeth = ['blur', 'focus', 'select', 'onBlur', 'onChange', 'onFocus']
|
||||
call map(taremeth, 'v:val."("')
|
||||
let tares = tareprop + taremeth
|
||||
" Window - window.
|
||||
let windprop = ['frames', 'closed', 'defaultStatus', 'encodeURI', 'event', 'history',
|
||||
\ 'length', 'location', 'name', 'onload', 'opener', 'parent', 'screen', 'self',
|
||||
\ 'status', 'top', 'XMLHttpRequest', 'ActiveXObject']
|
||||
let windmeth = ['alert', 'blur', 'clearInterval', 'clearTimeout', 'close', 'confirm', 'focus',
|
||||
\ 'moveBy', 'moveTo', 'open', 'print', 'prompt', 'scrollBy', 'scrollTo', 'setInterval',
|
||||
\ 'setTimeout']
|
||||
call map(windmeth, 'v:val."("')
|
||||
let winds = windprop + windmeth
|
||||
" XMLHttpRequest - access by new xxx()
|
||||
let xmlhprop = ['onreadystatechange', 'readyState', 'responseText', 'responseXML',
|
||||
\ 'status', 'statusText', 'parseError']
|
||||
let xmlhmeth = ['abort', 'getAllResponseHeaders', 'getResponseHeaders', 'open',
|
||||
\ 'send', 'setRequestHeader']
|
||||
call map(xmlhmeth, 'v:val."("')
|
||||
let xmlhs = xmlhprop + xmlhmeth
|
||||
|
||||
" XML DOM
|
||||
" Attributes - element.attributes[x].
|
||||
let xdomattrprop = ['name', 'specified', 'value']
|
||||
" Element - anyelement.
|
||||
let xdomelemprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
|
||||
\ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
|
||||
\ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling', 'tagName']
|
||||
let xdomelemmeth = ['appendChild', 'cloneNode', 'getAttribute', 'getAttributeNode',
|
||||
\ 'getElementsByTagName', 'hasChildNodes', 'insertBefore', 'normalize',
|
||||
\ 'removeAttribute', 'removeAttributeNode', 'removeChild', 'replaceChild',
|
||||
\ 'setAttribute', 'setAttributeNode']
|
||||
call map(xdomelemmeth, 'v:val."("')
|
||||
let xdomelems = xdomelemprop + xdomelemmeth
|
||||
" Node - anynode.
|
||||
let xdomnodeprop = ['attributes', 'childNodes', 'firstChild', 'lastChild',
|
||||
\ 'namespaceURI', 'nextSibling', 'nodeName', 'nodeType', 'nodeValue',
|
||||
\ 'ownerDocument', 'parentNode', 'prefix', 'previousSibling']
|
||||
let xdomnodemeth = ['appendChild', 'cloneNode',
|
||||
\ 'hasChildNodes', 'insertBefore', 'removeChild', 'replaceChild']
|
||||
call map(xdomnodemeth, 'v:val."("')
|
||||
let xdomnodes = xdomnodeprop + xdomnodemeth
|
||||
" NodeList
|
||||
let xdomnliss = ['length', 'item(']
|
||||
" Error - parseError.
|
||||
let xdomerror = ['errorCode', 'reason', 'line', 'linepos', 'srcText', 'url', 'filepos']
|
||||
|
||||
" Find object type declaration to reduce number of suggestions. {{{
|
||||
" 1. Get object name
|
||||
" 2. Find object declaration line
|
||||
" 3. General declaration follows "= new Type" syntax, additional else
|
||||
" for regexp "= /re/"
|
||||
" 4. Make correction for Microsoft.XMLHTTP ActiveXObject
|
||||
" 5. Repeat for external files
|
||||
let object = matchstr(shortcontext, '\zs\k\+\ze\(\[.\{-}\]\)\?\.$')
|
||||
if len(object) > 0
|
||||
let decl_line = search(object.'.\{-}=\s*new\s*', 'bn')
|
||||
if decl_line > 0
|
||||
let object_type = matchstr(getline(decl_line), object.'.\{-}=\s*new\s*\zs\k\+\ze')
|
||||
if object_type == 'ActiveXObject' && matchstr(getline(decl_line), object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
|
||||
let object_type = 'XMLHttpRequest'
|
||||
endif
|
||||
else
|
||||
let decl_line = search('var\s*'.object.'\s*=\s*\/', 'bn')
|
||||
if decl_line > 0
|
||||
let object_type = 'RegExp'
|
||||
endif
|
||||
endif
|
||||
" We didn't find var declaration in current file but we may have
|
||||
" something in external files.
|
||||
if decl_line == 0 && exists("b:js_extfiles")
|
||||
let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "'.object.'.\\{-}=\\s*new\\s*"')
|
||||
if len(dext_line) > 0
|
||||
let object_type = matchstr(dext_line[-1], object.'.\{-}=\s*new\s*\zs\k\+\ze')
|
||||
if object_type == 'ActiveXObject' && matchstr(dext_line[-1], object.'.\{-}=\s*new\s*ActiveXObject\s*(.Microsoft\.XMLHTTP.)') != ''
|
||||
let object_type = 'XMLHttpRequest'
|
||||
endif
|
||||
else
|
||||
let dext_line = filter(copy(b:js_extfiles), 'v:val =~ "var\s*'.object.'\\s*=\\s*\\/"')
|
||||
if len(dext_line) > 0
|
||||
let object_type = 'RegExp'
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
" }}}
|
||||
|
||||
if !exists('object_type')
|
||||
let object_type = ''
|
||||
endif
|
||||
|
||||
if object_type == 'Date'
|
||||
let values = dates
|
||||
elseif object_type == 'Image'
|
||||
let values = imags
|
||||
elseif object_type == 'Array'
|
||||
let values = arrays
|
||||
elseif object_type == 'Boolean'
|
||||
" TODO: a bit more than real boolean
|
||||
let values = arrays
|
||||
elseif object_type == 'XMLHttpRequest'
|
||||
let values = xmlhs
|
||||
elseif object_type == 'String'
|
||||
let values = stris
|
||||
elseif object_type == 'RegExp'
|
||||
let values = reges
|
||||
elseif object_type == 'Math'
|
||||
let values = maths
|
||||
endif
|
||||
|
||||
if !exists('values')
|
||||
" List of properties
|
||||
if shortcontext =~ 'Math\.$'
|
||||
let values = maths
|
||||
elseif shortcontext =~ 'anchors\(\[.\{-}\]\)\?\.$'
|
||||
let values = anths
|
||||
elseif shortcontext =~ 'area\.$'
|
||||
let values = areas
|
||||
elseif shortcontext =~ 'base\.$'
|
||||
let values = bases
|
||||
elseif shortcontext =~ 'body\.$'
|
||||
let values = bodys
|
||||
elseif shortcontext =~ 'document\.$'
|
||||
let values = docus
|
||||
elseif shortcontext =~ 'forms\(\[.\{-}\]\)\?\.$'
|
||||
let values = forms
|
||||
elseif shortcontext =~ 'frameset\.$'
|
||||
let values = fsets
|
||||
elseif shortcontext =~ 'history\.$'
|
||||
let values = hists
|
||||
elseif shortcontext =~ 'iframe\.$'
|
||||
let values = ifras
|
||||
elseif shortcontext =~ 'images\(\[.\{-}\]\)\?\.$'
|
||||
let values = imags
|
||||
elseif shortcontext =~ 'links\(\[.\{-}\]\)\?\.$'
|
||||
let values = links
|
||||
elseif shortcontext =~ 'location\.$'
|
||||
let values = locas
|
||||
elseif shortcontext =~ 'meta\.$'
|
||||
let values = metas
|
||||
elseif shortcontext =~ 'navigator\.$'
|
||||
let values = navis
|
||||
elseif shortcontext =~ 'object\.$'
|
||||
let values = objes
|
||||
elseif shortcontext =~ 'screen\.$'
|
||||
let values = scres
|
||||
elseif shortcontext =~ 'style\.$'
|
||||
let values = styls
|
||||
elseif shortcontext =~ 'table\.$'
|
||||
let values = tabls
|
||||
elseif shortcontext =~ 'TableData\.$'
|
||||
let values = tdats
|
||||
elseif shortcontext =~ 'TableRow\.$'
|
||||
let values = trows
|
||||
elseif shortcontext =~ 'window\.$'
|
||||
let values = winds
|
||||
elseif shortcontext =~ 'parseError\.$'
|
||||
let values = xdomerror
|
||||
elseif shortcontext =~ 'attributes\[\d\+\]\.$'
|
||||
let values = xdomattrprop
|
||||
else
|
||||
let values = user_props + arrays + dates + funcs + maths + numbs + objes + reges + stris
|
||||
let values += doms + anths + areas + bases + bodys + docus + forms + frams + fsets + hists
|
||||
let values += ifras + imags + links + locas + metas + navis + objes + scres
|
||||
let values += tabls + trows + tares + winds
|
||||
let values += xdomnodes + xdomnliss + xdomelems
|
||||
endif
|
||||
endif
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m)
|
||||
elseif m =~? a:base
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
unlet! values
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
" }}}
|
||||
|
||||
" Get variables data.
|
||||
let variables = filter(copy(file), 'v:val =~ "var\\s"')
|
||||
call map(variables, 'matchstr(v:val, ".\\{-}var\\s\\+\\zs.*\\ze")')
|
||||
call map(variables, 'substitute(v:val, ";\\|$", ",", "g")')
|
||||
let vars = []
|
||||
" This loop (and next one) is necessary to get variable names from
|
||||
" constructs like: var var1, var2, var3 = "something";
|
||||
for i in range(len(variables))
|
||||
let comma_separated = split(variables[i], ',\s*')
|
||||
call map(comma_separated, 'matchstr(v:val, "\\k\\+")')
|
||||
let vars += comma_separated
|
||||
endfor
|
||||
|
||||
let variables = sort(vars)
|
||||
unlet! vars
|
||||
|
||||
" Add "no var" variables.
|
||||
let undeclared_variables = filter(copy(file), 'v:val =~ "^\\s*\\k\\+\\s*="')
|
||||
let u_vars = []
|
||||
for i in range(len(undeclared_variables))
|
||||
let split_equal = split(undeclared_variables[i], '\s*=')
|
||||
call map(split_equal, 'matchstr(v:val, "\\k\\+$")')
|
||||
let u_vars += split_equal
|
||||
endfor
|
||||
|
||||
let variables += sort(u_vars)
|
||||
unlet! u_vars
|
||||
|
||||
" Get functions
|
||||
let functions = filter(copy(file), 'v:val =~ "^\\s*function\\s"')
|
||||
let arguments = copy(functions)
|
||||
call map(functions, 'matchstr(v:val, "^\\s*function\\s\\+\\zs\\k\\+")')
|
||||
call map(functions, 'v:val."("')
|
||||
let functions = sort(functions)
|
||||
|
||||
" Create table to keep arguments for additional 'menu' info
|
||||
let b:js_menuinfo = {}
|
||||
for i in arguments
|
||||
let g:ia = i
|
||||
let f_elements = matchlist(i, 'function\s\+\(\k\+\)\s*(\(.\{-}\))')
|
||||
if len(f_elements) == 3
|
||||
let b:js_menuinfo[f_elements[1].'('] = f_elements[2]
|
||||
endif
|
||||
endfor
|
||||
|
||||
" Get functions arguments
|
||||
call map(arguments, 'matchstr(v:val, "function.\\{-}(\\zs.\\{-}\\ze)")')
|
||||
let jargs = join(arguments, ',')
|
||||
let jargs = substitute(jargs, '\s', '', 'g')
|
||||
let arguments = split(jargs, ',')
|
||||
let arguments = sort(arguments)
|
||||
|
||||
" Built-in functions
|
||||
let builtin = ['alert(', 'confirm(']
|
||||
|
||||
" Top-level HTML DOM objects
|
||||
let htmldom = ['document', 'anchor', 'area', 'base', 'body', 'document', 'event', 'form', 'frame', 'frameset', 'history', 'iframe', 'image', 'input', 'link', 'location', 'meta', 'navigator', 'object', 'option', 'screen', 'select', 'table', 'tableData', 'tableHeader', 'tableRow', 'textarea', 'window']
|
||||
call map(htmldom, 'v:val."."')
|
||||
|
||||
" Top-level properties
|
||||
let properties = ['decodeURI', 'decodeURIComponent', 'encodeURI', 'encodeURIComponent',
|
||||
\ 'eval', 'Infinity', 'isFinite', 'isNaN', 'NaN', 'Number', 'parseFloat',
|
||||
\ 'parseInt', 'String', 'undefined', 'escape', 'unescape']
|
||||
|
||||
" Keywords
|
||||
let keywords = ["Array", "Boolean", "Date", "Function", "Math", "Number", "Object", "RegExp", "String", "XMLHttpRequest", "ActiveXObject", "abstract", "boolean", "break", "byte", "case", "catch", "char", "class", "const", "continue", "debugger", "default", "delete", "do", "double ", "else", "enum", "export", "extends", "false", "final", "finally", "float", "for", "function", "goto", "if", "implements", "import", "in ", "instanceof", "int", "interface", "long", "native", "new", "null", "package", "private", "protected", "public", "return", "short", "static", "super ", "switch", "synchronized", "this", "throw", "throws", "transient", "true", "try", "typeof", "var", "void", "volatile", "while", "with"]
|
||||
|
||||
let values = variables + functions + htmldom + arguments + builtin + properties + keywords
|
||||
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m)
|
||||
elseif m =~? a:base
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
let menu = res + res2
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if item =~ '($'
|
||||
let kind = 'f'
|
||||
if has_key(b:js_menuinfo, item)
|
||||
let m_info = b:js_menuinfo[item]
|
||||
else
|
||||
let m_info = ''
|
||||
endif
|
||||
else
|
||||
let kind = 'v'
|
||||
let m_info = ''
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_info, 'kind':kind}]
|
||||
endfor
|
||||
let g:fm = final_menu
|
||||
return final_menu
|
||||
|
||||
endfunction
|
||||
|
||||
" vim:set foldmethod=marker:
|
||||
4193
runtime/autoload/netrw.vim
Normal file
4193
runtime/autoload/netrw.vim
Normal file
File diff suppressed because it is too large
Load Diff
@@ -1,21 +1,48 @@
|
||||
" NetrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrwFileHandlers: contains various extension-based file handlers for
|
||||
" netrw's browsers' x command ("eXecute launcher")
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Aug 31, 2004
|
||||
" Version: 3
|
||||
" Date: Mar 22, 2006
|
||||
" Version: 8
|
||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" netrwFileHandlers.vim is provided *as is* and comes with no
|
||||
" warranty of any kind, either expressed or implied. In no
|
||||
" event will the copyright holder be liable for any damages
|
||||
" resulting from the use of this software.
|
||||
"
|
||||
" Rom 6:23 (WEB) For the wages of sin is death, but the free gift of God {{{1
|
||||
" is eternal life in Christ Jesus our Lord.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Prevent Reloading: {{{1
|
||||
if exists("g:loaded_netrwfilehandlers") || &cp
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_netrwFileHandlers") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwfilehandlers= "v3"
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
let g:loaded_netrwFileHandlers= "v8"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_html: handles html when the user hits "x" when the {{{1
|
||||
" netrwFileHandlers#Invoke: {{{2
|
||||
fun! netrwFileHandlers#Invoke(exten,fname)
|
||||
" call Dfunc("netrwFileHandlers#Invoke(exten<".a:exten."> fname<".a:fname.">)")
|
||||
|
||||
if a:exten != "" && exists("*s:NFH_".a:exten)
|
||||
" call Decho("let ret= netrwFileHandlers#NFH_".a:exten.'("'.a:fname.'")')
|
||||
exe "let ret= s:NFH_".a:exten.'("'.a:fname.'")'
|
||||
endif
|
||||
|
||||
" call Dret("netrwFileHandlers#Invoke 0 : ret=".ret)
|
||||
return 0
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" s:NFH_html: handles html when the user hits "x" when the {{{1
|
||||
" cursor is atop a *.html file
|
||||
fun! NetrwFileHandler_html(pagefile)
|
||||
" call Dfunc("NetrwFileHandler_html(".a:pagefile.")")
|
||||
fun! s:NFH_html(pagefile)
|
||||
" call Dfunc("s:NFH_html(".a:pagefile.")")
|
||||
|
||||
let page= substitute(a:pagefile,'^','file://','')
|
||||
|
||||
@@ -26,19 +53,19 @@ fun! NetrwFileHandler_html(pagefile)
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape \"".page.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_html 0")
|
||||
" call Dret("s:NFH_html 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_html 1")
|
||||
" call Dret("s:NFH_html 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_htm: handles html when the user hits "x" when the {{{1
|
||||
" s:NFH_htm: handles html when the user hits "x" when the {{{1
|
||||
" cursor is atop a *.htm file
|
||||
fun! NetrwFileHandler_htm(pagefile)
|
||||
" call Dfunc("NetrwFileHandler_htm(".a:pagefile.")")
|
||||
fun! s:NFH_htm(pagefile)
|
||||
" call Dfunc("s:NFH_htm(".a:pagefile.")")
|
||||
|
||||
let page= substitute(a:pagefile,'^','file://','')
|
||||
|
||||
@@ -49,18 +76,18 @@ fun! NetrwFileHandler_htm(pagefile)
|
||||
" call Decho("executing !netscape ".page)
|
||||
exe "!netscape \"".page.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_htm 0")
|
||||
" call Dret("s:NFH_htm 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_htm 1")
|
||||
" call Dret("s:NFH_htm 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_jpg: {{{1
|
||||
fun! NetrwFileHandler_jpg(jpgfile)
|
||||
" call Dfunc("NetrwFileHandler_jpg(jpgfile<".a:jpgfile.">)")
|
||||
" s:NFH_jpg: {{{1
|
||||
fun! s:NFH_jpg(jpgfile)
|
||||
" call Dfunc("s:NFH_jpg(jpgfile<".a:jpgfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:jpgfile
|
||||
@@ -68,196 +95,181 @@ fun! NetrwFileHandler_jpg(jpgfile)
|
||||
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
|
||||
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:jpgfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_jpg 0")
|
||||
" call Dret("s:NFH_jpg 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_jpg 1")
|
||||
" call Dret("s:NFH_jpg 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_gif: {{{1
|
||||
fun! NetrwFileHandler_gif(giffile)
|
||||
" call Dfunc("NetrwFileHandler_gif(giffile<".a:giffile.">)")
|
||||
" s:NFH_gif: {{{1
|
||||
fun! s:NFH_gif(giffile)
|
||||
" call Dfunc("s:NFH_gif(giffile<".a:giffile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:giffile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:giffile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_gif 0")
|
||||
" call Dret("s:NFH_gif 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_gif 1")
|
||||
" call Dret("s:NFH_gif 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_png: {{{1
|
||||
fun! NetrwFileHandler_png(pngfile)
|
||||
" call Dfunc("NetrwFileHandler_png(pngfile<".a:pngfile.">)")
|
||||
" s:NFH_png: {{{1
|
||||
fun! s:NFH_png(pngfile)
|
||||
" call Dfunc("s:NFH_png(pngfile<".a:pngfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:pngfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pngfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_png 0")
|
||||
" call Dret("s:NFH_png 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_png 1")
|
||||
" call Dret("s:NFH_png 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_pnm: {{{1
|
||||
fun! NetrwFileHandler_pnm(pnmfile)
|
||||
" call Dfunc("NetrwFileHandler_pnm(pnmfile<".a:pnmfile.">)")
|
||||
" s:NFH_pnm: {{{1
|
||||
fun! s:NFH_pnm(pnmfile)
|
||||
" call Dfunc("s:NFH_pnm(pnmfile<".a:pnmfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:pnmfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:pnmfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_pnm 0")
|
||||
" call Dret("s:NFH_pnm 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_pnm 1")
|
||||
" call Dret("s:NFH_pnm 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_bmp: visualize bmp files {{{1
|
||||
fun! NetrwFileHandler_bmp(bmpfile)
|
||||
" call Dfunc("NetrwFileHandler_bmp(bmpfile<".a:bmpfile.">)")
|
||||
" s:NFH_bmp: visualize bmp files {{{1
|
||||
fun! s:NFH_bmp(bmpfile)
|
||||
" call Dfunc("s:NFH_bmp(bmpfile<".a:bmpfile.">)")
|
||||
|
||||
if executable("gimp")
|
||||
exe "silent! !gimp -s ".a:bmpfile
|
||||
elseif executable(expand("$SystemRoot")."/SYSTEM32/MSPAINT.EXE")
|
||||
exe "silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:bmpfile.'"'
|
||||
else
|
||||
" call Dret("NetrwFileHandler_bmp 0")
|
||||
" call Dret("s:NFH_bmp 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_bmp 1")
|
||||
" call Dret("s:NFH_bmp 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_pdf: visualize pdf files {{{1
|
||||
fun! NetrwFileHandler_pdf(pdf)
|
||||
" " call Dfunc("NetrwFileHandler_pdf(pdf<".a:pdf.">)")
|
||||
" s:NFH_pdf: visualize pdf files {{{1
|
||||
fun! s:NFH_pdf(pdf)
|
||||
" call Dfunc("s:NFH_pdf(pdf<".a:pdf.">)")
|
||||
if executable("gs")
|
||||
exe 'silent! !gs "'.a:pdf.'"'
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_pdf 0")
|
||||
" call Dret("s:NFH_pdf 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_pdf 1")
|
||||
" call Dret("s:NFH_pdf 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_sxw: visualize sxw files {{{1
|
||||
fun! NetrwFileHandler_sxw(sxw)
|
||||
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
|
||||
if executable("gs")
|
||||
exe 'silent! !gs "'.a:sxw.'"'
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_sxw 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_sxw 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_doc: visualize doc files {{{1
|
||||
fun! NetrwFileHandler_doc(doc)
|
||||
" " call Dfunc("NetrwFileHandler_doc(doc<".a:doc.">)")
|
||||
" s:NFH_doc: visualize doc files {{{1
|
||||
fun! s:NFH_doc(doc)
|
||||
" call Dfunc("s:NFH_doc(doc<".a:doc.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter "'.a:doc.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_doc 0")
|
||||
" call Dret("s:NFH_doc 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_doc 1")
|
||||
" call Dret("s:NFH_doc 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_sxw: visualize sxw files {{{1
|
||||
fun! NetrwFileHandler_sxw(sxw)
|
||||
" " call Dfunc("NetrwFileHandler_sxw(sxw<".a:sxw.">)")
|
||||
" s:NFH_sxw: visualize sxw files {{{1
|
||||
fun! s:NFH_sxw(sxw)
|
||||
" call Dfunc("s:NFH_sxw(sxw<".a:sxw.">)")
|
||||
|
||||
if executable("oowriter")
|
||||
exe 'silent! !oowriter "'.a:sxw.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_sxw 0")
|
||||
" call Dret("s:NFH_sxw 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_sxw 1")
|
||||
" call Dret("s:NFH_sxw 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_xls: visualize xls files {{{1
|
||||
fun! NetrwFileHandler_xls(xls)
|
||||
" " call Dfunc("NetrwFileHandler_xls(xls<".a:xls.">)")
|
||||
" s:NFH_xls: visualize xls files {{{1
|
||||
fun! s:NFH_xls(xls)
|
||||
" call Dfunc("s:NFH_xls(xls<".a:xls.">)")
|
||||
|
||||
if executable("oocalc")
|
||||
exe 'silent! !oocalc "'.a:xls.'"'
|
||||
redraw!
|
||||
else
|
||||
" " call Dret("NetrwFileHandler_xls 0")
|
||||
" call Dret("s:NFH_xls 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" " call Dret("NetrwFileHandler_xls 1")
|
||||
" call Dret("s:NFH_xls 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_ps: handles PostScript files {{{1
|
||||
fun! NetrwFileHandler_ps(ps)
|
||||
" call Dfunc("NetrwFileHandler_ps()")
|
||||
" s:NFH_ps: handles PostScript files {{{1
|
||||
fun! s:NFH_ps(ps)
|
||||
" call Dfunc("s:NFH_ps(ps<".a:ps.">)")
|
||||
if executable("gs")
|
||||
" call Decho("exe silent! !gs ".a:ps)
|
||||
exe "silent! !gs ".a:ps
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
exe "silent! !ghostscript ".a:ps
|
||||
redraw!
|
||||
elseif executable("ghostscript")
|
||||
" call Decho("exe silent! !ghostscript ".a:ps)
|
||||
exe "silent! !ghostscript ".a:ps
|
||||
redraw!
|
||||
elseif executable("gswin32")
|
||||
" call Decho("exe silent! !gswin32 \"".a:ps.'"')
|
||||
exe "silent! !gswin32 \"".a:ps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
" call Dret("s:NFH_ps 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_ps 1")
|
||||
" call Dret("s:NFH_ps 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_eps: handles encapsulated PostScript files {{{1
|
||||
fun! NetrwFileHandler_eps(eps)
|
||||
" call Dfunc("NetrwFileHandler_ps()")
|
||||
" s:NFH_eps: handles encapsulated PostScript files {{{1
|
||||
fun! s:NFH_eps(eps)
|
||||
" call Dfunc("s:NFH_eps()")
|
||||
if executable("gs")
|
||||
exe "silent! !gs ".a:eps
|
||||
redraw!
|
||||
@@ -271,43 +283,46 @@ fun! NetrwFileHandler_eps(eps)
|
||||
exe "silent! !gswin32 \"".a:eps.'"'
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_ps 0")
|
||||
" call Dret("s:NFH_eps 0")
|
||||
return 0
|
||||
endif
|
||||
" call Dret("s:NFH_eps 0")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_fig: handles xfig files {{{1
|
||||
fun! NetrwFileHandler_fig(fig)
|
||||
" call Dfunc("NetrwFileHandler_fig()")
|
||||
" s:NFH_fig: handles xfig files {{{1
|
||||
fun! s:NFH_fig(fig)
|
||||
" call Dfunc("s:NFH_fig()")
|
||||
if executable("xfig")
|
||||
exe "silent! !xfig ".a:fig
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_fig 0")
|
||||
" call Dret("s:NFH_fig 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_fig 1")
|
||||
" call Dret("s:NFH_fig 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwFileHandler_obj: handles tgif's obj files {{{1
|
||||
fun! NetrwFileHandler_obj(obj)
|
||||
" call Dfunc("NetrwFileHandler_obj()")
|
||||
" s:NFH_obj: handles tgif's obj files {{{1
|
||||
fun! s:NFH_obj(obj)
|
||||
" call Dfunc("s:NFH_obj()")
|
||||
if has("unix") && executable("tgif")
|
||||
exe "silent! !tgif ".a:obj
|
||||
redraw!
|
||||
else
|
||||
" call Dret("NetrwFileHandler_obj 0")
|
||||
" call Dret("s:NFH_obj 0")
|
||||
return 0
|
||||
endif
|
||||
|
||||
" call Dret("NetrwFileHandler_obj 1")
|
||||
" call Dret("s:NFH_obj 1")
|
||||
return 1
|
||||
endfun
|
||||
|
||||
|
||||
let &cpo= s:keepcpo
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim: ts=4 fdm=marker
|
||||
168
runtime/autoload/netrwSettings.vim
Normal file
168
runtime/autoload/netrwSettings.vim
Normal file
@@ -0,0 +1,168 @@
|
||||
" netrwSettings.vim: makes netrw settings simpler
|
||||
" Date: Mar 22, 2006
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" Version: 6
|
||||
" Copyright: Copyright (C) 1999-2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" netrwSettings.vim is provided *as is* and comes with no
|
||||
" warranty of any kind, either expressed or implied. 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.
|
||||
"
|
||||
" Mat 4:23 (WEB) Jesus went about in all Galilee, teaching in their {{{1
|
||||
" synagogues, preaching the gospel of the kingdom, and healing
|
||||
" every disease and every sickness among the people.
|
||||
" Load Once: {{{1
|
||||
if exists("g:loaded_netrwSettings") || &cp
|
||||
finish
|
||||
endif
|
||||
let g:loaded_netrwSettings = "v6"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettings: {{{1
|
||||
fun! netrwSettings#NetrwSettings()
|
||||
" this call is here largely just to insure that netrw has been loaded
|
||||
call netrw#NetSavePosn()
|
||||
if !exists("g:loaded_netrw")
|
||||
echohl WarningMsg | echomsg "***sorry*** netrw needs to be loaded prior to using NetrwSettings" | echohl None
|
||||
return
|
||||
endif
|
||||
|
||||
above wincmd s
|
||||
enew
|
||||
setlocal noswapfile bh=wipe
|
||||
set ft=vim
|
||||
file Netrw\ Settings
|
||||
|
||||
" these variables have the following default effects when they don't
|
||||
" exist (ie. have not been set by the user in his/her .vimrc)
|
||||
if !exists("g:netrw_longlist")
|
||||
let g:netrw_longlist= 0
|
||||
let g:netrw_list_cmd= "ssh HOSTNAME ls -FLa"
|
||||
endif
|
||||
if !exists("g:netrw_silent")
|
||||
let g:netrw_silent= 0
|
||||
endif
|
||||
if !exists("g:netrw_use_nt_rcp")
|
||||
let g:netrw_use_nt_rcp= 0
|
||||
endif
|
||||
if !exists("g:netrw_ftp")
|
||||
let g:netrw_ftp= 0
|
||||
endif
|
||||
if !exists("g:netrw_ignorenetrc")
|
||||
let g:netrw_ignorenetrc= 0
|
||||
endif
|
||||
|
||||
put ='+ ---------------------------------------------'
|
||||
put ='+ NetrwSettings: by Charles E. Campbell, Jr.'
|
||||
put ='+ Press <F1> with cursor atop any line for help'
|
||||
put ='+ ---------------------------------------------'
|
||||
let s:netrw_settings_stop= line(".")
|
||||
|
||||
put =''
|
||||
put ='+ Netrw Protocol Commands'
|
||||
put = 'let g:netrw_dav_cmd = '.g:netrw_dav_cmd
|
||||
put = 'let g:netrw_fetch_cmd = '.g:netrw_fetch_cmd
|
||||
put = 'let g:netrw_ftp_cmd = '.g:netrw_ftp_cmd
|
||||
put = 'let g:netrw_http_cmd = '.g:netrw_http_cmd
|
||||
put = 'let g:netrw_rcp_cmd = '.g:netrw_rcp_cmd
|
||||
put = 'let g:netrw_rsync_cmd = '.g:netrw_rsync_cmd
|
||||
put = 'let g:netrw_scp_cmd = '.g:netrw_scp_cmd
|
||||
put = 'let g:netrw_sftp_cmd = '.g:netrw_sftp_cmd
|
||||
put = 'let g:netrw_ssh_cmd = '.g:netrw_ssh_cmd
|
||||
let s:netrw_protocol_stop= line(".")
|
||||
put = ''
|
||||
|
||||
put ='+Netrw Transfer Control'
|
||||
put = 'let g:netrw_cygwin = '.g:netrw_cygwin
|
||||
put = 'let g:netrw_ftp = '.g:netrw_ftp
|
||||
put = 'let g:netrw_ftpmode = '.g:netrw_ftpmode
|
||||
put = 'let g:netrw_ignorenetrc = '.g:netrw_ignorenetrc
|
||||
put = 'let g:netrw_use_nt_rcp = '.g:netrw_use_nt_rcp
|
||||
put = 'let g:netrw_win95ftp = '.g:netrw_win95ftp
|
||||
let s:netrw_xfer_stop= line(".")
|
||||
|
||||
put = ''
|
||||
put ='+ Netrw Browser Control'
|
||||
put = 'let g:netrw_alto = '.g:netrw_alto
|
||||
put = 'let g:netrw_altv = '.g:netrw_altv
|
||||
put = 'let g:netrw_browse_split = '.g:netrw_browse_split
|
||||
if exists("g:netrw_browsex_viewer")
|
||||
put = 'let g:netrw_browsex_viewer = '.g:netrw_browsex_viewer
|
||||
else
|
||||
put = 'let g:netrw_browsex_viewer = (not defined)'
|
||||
endif
|
||||
put = 'let g:netrw_dirhistmax = '.g:netrw_dirhistmax
|
||||
put = 'let g:netrw_fastbrowse = '.g:netrw_fastbrowse
|
||||
put = 'let g:netrw_ftp_browse_reject = '.g:netrw_ftp_browse_reject
|
||||
put = 'let g:netrw_ftp_list_cmd = '.g:netrw_ftp_list_cmd
|
||||
put = 'let g:netrw_hide = '.g:netrw_hide
|
||||
put = 'let g:netrw_keepdir = '.g:netrw_keepdir
|
||||
put = 'let g:netrw_list_cmd = '.g:netrw_list_cmd
|
||||
put = 'let g:netrw_list_hide = '.g:netrw_list_hide
|
||||
put = 'let g:netrw_local_mkdir = '.g:netrw_local_mkdir
|
||||
put = 'let g:netrw_local_rmdir = '.g:netrw_local_rmdir
|
||||
put = 'let g:netrw_longlist = '.g:netrw_longlist
|
||||
put = 'let g:netrw_maxfilenamelen = '.g:netrw_maxfilenamelen
|
||||
put = 'let g:netrw_mkdir_cmd = '.g:netrw_mkdir_cmd
|
||||
put = 'let g:netrw_rename_cmd = '.g:netrw_rename_cmd
|
||||
put = 'let g:netrw_rm_cmd = '.g:netrw_rm_cmd
|
||||
put = 'let g:netrw_rmdir_cmd = '.g:netrw_rmdir_cmd
|
||||
put = 'let g:netrw_rmf_cmd = '.g:netrw_rmf_cmd
|
||||
put = 'let g:netrw_silent = '.g:netrw_silent
|
||||
put = 'let g:netrw_sort_by = '.g:netrw_sort_by
|
||||
put = 'let g:netrw_sort_direction = '.g:netrw_sort_direction
|
||||
put = 'let g:netrw_sort_sequence = '.g:netrw_sort_sequence
|
||||
put = 'let g:netrw_ssh_browse_reject = '.g:netrw_ssh_browse_reject
|
||||
put = 'let g:netrw_timefmt = '.g:netrw_timefmt
|
||||
put = 'let g:netrw_winsize = '.g:netrw_winsize
|
||||
|
||||
put =''
|
||||
put ='+ For help, place cursor on line and press ?'
|
||||
|
||||
1d
|
||||
silent %s/^+/"/e
|
||||
res 99
|
||||
silent %s/= \([^0-9].*\)$/= '\1'/e
|
||||
silent %s/= $/= ''/e
|
||||
1
|
||||
|
||||
set nomod
|
||||
|
||||
map <buffer> <silent> <F1> :call NetrwSettingHelp()<cr>
|
||||
let tmpfile= tempname()
|
||||
exe 'au BufWriteCmd Netrw\ Settings silent w! '.tmpfile.'|so '.tmpfile.'|call delete("'.tmpfile.'")|set nomod'
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" NetrwSettingHelp: {{{2
|
||||
fun! NetrwSettingHelp()
|
||||
" call Dfunc("NetrwSettingHelp()")
|
||||
let curline = getline(".")
|
||||
if curline =~ '='
|
||||
let varhelp = substitute(curline,'^\s*let ','','e')
|
||||
let varhelp = substitute(varhelp,'\s*=.*$','','e')
|
||||
" call Decho("trying help ".varhelp)
|
||||
try
|
||||
exe "he ".varhelp
|
||||
catch /^Vim\%((\a\+)\)\=:E149/
|
||||
echo "***sorry*** no help available for <".varhelp.">"
|
||||
endtry
|
||||
elseif line(".") < s:netrw_settings_stop
|
||||
he netrw-settings
|
||||
elseif line(".") < s:netrw_protocol_stop
|
||||
he netrw-externapp
|
||||
elseif line(".") < s:netrw_xfer_stop
|
||||
he netrw-variables
|
||||
else
|
||||
he netrw-browse-var
|
||||
endif
|
||||
" call Dret("NetrwSettingHelp")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Modelines: {{{1
|
||||
" vim:ts=8 fdm=marker
|
||||
39
runtime/autoload/paste.vim
Normal file
39
runtime/autoload/paste.vim
Normal file
@@ -0,0 +1,39 @@
|
||||
" Vim support file to help with paste mappings and menus
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Mar 09
|
||||
|
||||
" Define the string to use for items that are present both in Edit, Popup and
|
||||
" Toolbar menu. Also used in mswin.vim and macmap.vim.
|
||||
|
||||
" Pasting blockwise and linewise selections is not possible in Insert and
|
||||
" Visual mode without the +virtualedit feature. They are pasted as if they
|
||||
" were characterwise instead. Add to that some tricks to leave the cursor in
|
||||
" the right position, also for "gi".
|
||||
if has("virtualedit")
|
||||
let paste#paste_cmd = {'n': ":call paste#Paste()<CR>"}
|
||||
let paste#paste_cmd['v'] = '"-c<Esc>' . paste#paste_cmd['n']
|
||||
let paste#paste_cmd['i'] = '<Esc>' . paste#paste_cmd['n'] . 'gi'
|
||||
|
||||
func! paste#Paste()
|
||||
let ove = &ve
|
||||
set ve=all
|
||||
normal! `^
|
||||
if @+ != ''
|
||||
normal! "+gP
|
||||
endif
|
||||
let c = col(".")
|
||||
normal! i
|
||||
if col(".") < c " compensate for i<ESC> moving the cursor left
|
||||
normal! l
|
||||
endif
|
||||
let &ve = ove
|
||||
endfunc
|
||||
else
|
||||
let paste#paste_cmd = {'n': "\"=@+.'xy'<CR>gPFx\"_2x"}
|
||||
let paste#paste_cmd['v'] = '"-c<Esc>gix<Esc>' . paste#paste_cmd['n'] . '"_x'
|
||||
let paste#paste_cmd['i'] = 'x<Esc>' . paste#paste_cmd['n'] . '"_s'
|
||||
endif
|
||||
|
||||
if has("virtualedit")
|
||||
else
|
||||
endif
|
||||
4905
runtime/autoload/phpcomplete.vim
Normal file
4905
runtime/autoload/phpcomplete.vim
Normal file
File diff suppressed because it is too large
Load Diff
351
runtime/autoload/pycomplete.vim
Normal file
351
runtime/autoload/pycomplete.vim
Normal file
@@ -0,0 +1,351 @@
|
||||
"pycomplete.vim - Omni Completion for python
|
||||
" Maintainer: Aaron Griffin
|
||||
" Version: 0.3
|
||||
" Last Updated: 23 January 2006
|
||||
"
|
||||
" v0.3 Changes:
|
||||
" added top level def parsing
|
||||
" for safety, call returns are not evaluated
|
||||
" handful of parsing changes
|
||||
" trailing ( and . characters
|
||||
" argument completion on open parens
|
||||
" stop parsing at current line - ++performance, local var resolution
|
||||
"
|
||||
" TODO
|
||||
" RExec subclass
|
||||
" Code cleanup + make class
|
||||
" use internal dict, not globals()
|
||||
|
||||
if !has('python')
|
||||
echo "Error: Required vim compiled with +python"
|
||||
finish
|
||||
endif
|
||||
|
||||
function! pycomplete#Complete(findstart, base)
|
||||
"findstart = 1 when we need to get the text length
|
||||
if a:findstart
|
||||
let line = getline('.')
|
||||
let idx = col('.')
|
||||
while idx > 0
|
||||
let idx -= 1
|
||||
let c = line[idx-1]
|
||||
if c =~ '\w'
|
||||
continue
|
||||
elseif ! c =~ '\.'
|
||||
idx = -1
|
||||
break
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
return idx
|
||||
"findstart = 0 when we need to return the list of completions
|
||||
else
|
||||
execute "python get_completions('" . a:base . "')"
|
||||
return g:pycomplete_completions
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:DefPython()
|
||||
python << PYTHONEOF
|
||||
import vim, sys, types
|
||||
import __builtin__
|
||||
import tokenize, keyword, cStringIO
|
||||
|
||||
LOCALDEFS = \
|
||||
['LOCALDEFS', 'clean_up','eval_source_code', \
|
||||
'get_completions', '__builtin__', '__builtins__', \
|
||||
'dbg', '__name__', 'vim', 'sys', 'parse_to_end', \
|
||||
'parse_statement', 'tokenize', 'keyword', 'cStringIO', \
|
||||
'debug_level', 'safe_eval', '_ctor', 'get_arguments', \
|
||||
'strip_calls', 'types', 'parse_block']
|
||||
|
||||
def dbg(level,msg):
|
||||
debug_level = 1
|
||||
try:
|
||||
debug_level = vim.eval("g:pycomplete_debug_level")
|
||||
except:
|
||||
pass
|
||||
if level <= debug_level: print(msg)
|
||||
|
||||
def strip_calls(stmt):
|
||||
parsed=''
|
||||
level = 0
|
||||
for c in stmt:
|
||||
if c in ['[','(']:
|
||||
level += 1
|
||||
elif c in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
parsed += c
|
||||
##dbg(10,"stripped: %s" % parsed)
|
||||
return parsed
|
||||
|
||||
def get_completions(base):
|
||||
stmt = vim.eval('expand("<cWORD>")')
|
||||
#dbg(1,"statement: %s - %s" % (stmt, base))
|
||||
stmt = stmt+base
|
||||
eval_source_code()
|
||||
|
||||
try:
|
||||
ridx = stmt.rfind('.')
|
||||
if stmt[-1] == '(':
|
||||
match = ""
|
||||
stmt = strip_calls(stmt[:len(stmt)-1])
|
||||
all = get_arguments(eval(stmt))
|
||||
elif ridx == -1:
|
||||
match = stmt
|
||||
all = globals() + __builtin__.__dict__
|
||||
else:
|
||||
match = stmt[ridx+1:]
|
||||
stmt = strip_calls(stmt[:ridx])
|
||||
all = eval(stmt).__dict__
|
||||
|
||||
#dbg(15,"completions for: %s, match=%s" % (stmt,match))
|
||||
completions = []
|
||||
if type(all) == types.DictType:
|
||||
for m in all:
|
||||
if m.find('_') != 0 and m.find(match) == 0 and \
|
||||
m not in LOCALDEFS:
|
||||
#dbg(25,"matched... %s, %s" % (m, m.find(match)))
|
||||
typestr = str(all[m])
|
||||
if "function" in typestr: m += '('
|
||||
elif "method" in typestr: m += '('
|
||||
elif "module" in typestr: m += '.'
|
||||
elif "class" in typestr: m += '('
|
||||
completions.append(m)
|
||||
completions.sort()
|
||||
else:
|
||||
completions.append(all)
|
||||
#dbg(10,"all completions: %s" % completions)
|
||||
vim.command("let g:pycomplete_completions = %s" % completions)
|
||||
except:
|
||||
vim.command("let g:pycomplete_completions = []")
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
clean_up()
|
||||
|
||||
def get_arguments(func_obj):
|
||||
def _ctor(obj):
|
||||
try:
|
||||
return class_ob.__init__.im_func
|
||||
except AttributeError:
|
||||
for base in class_ob.__bases__:
|
||||
rc = _find_constructor(base)
|
||||
if rc is not None: return rc
|
||||
return None
|
||||
|
||||
arg_offset = 1
|
||||
if type(func_obj) == types.ClassType: func_obj = _ctor(func_obj)
|
||||
elif type(func_obj) == types.MethodType: func_obj = func_obj.im_func
|
||||
else: arg_offset = 0
|
||||
|
||||
#dbg(20,"%s, offset=%s" % (str(func_obj), arg_offset))
|
||||
|
||||
arg_text = ''
|
||||
if type(func_obj) in [types.FunctionType, types.LambdaType]:
|
||||
try:
|
||||
cd = func_obj.func_code
|
||||
real_args = cd.co_varnames[arg_offset:cd.co_argcount]
|
||||
defaults = func_obj.func_defaults or []
|
||||
defaults = list(map(lambda name: "=%s" % name, defaults))
|
||||
defaults = [""] * (len(real_args)-len(defaults)) + defaults
|
||||
items = map(lambda a,d: a+d, real_args, defaults)
|
||||
if func_obj.func_code.co_flags & 0x4:
|
||||
items.append("...")
|
||||
if func_obj.func_code.co_flags & 0x8:
|
||||
items.append("***")
|
||||
arg_text = ", ".join(items) + ')'
|
||||
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
if len(arg_text) == 0:
|
||||
# The doc string sometimes contains the function signature
|
||||
# this works for alot of C modules that are part of the
|
||||
# standard library
|
||||
doc = getattr(func_obj, '__doc__', '')
|
||||
if doc:
|
||||
doc = doc.lstrip()
|
||||
pos = doc.find('\n')
|
||||
if pos > 0:
|
||||
sigline = doc[:pos]
|
||||
lidx = sigline.find('(')
|
||||
ridx = sigline.find(')')
|
||||
retidx = sigline.find('->')
|
||||
ret = sigline[retidx+2:].strip()
|
||||
if lidx > 0 and ridx > 0:
|
||||
arg_text = sigline[lidx+1:ridx] + ')'
|
||||
if len(ret) > 0: arg_text += ' #returns %s' % ret
|
||||
#dbg(15,"argument completion: %s" % arg_text)
|
||||
return arg_text
|
||||
|
||||
def parse_to_end(gen):
|
||||
stmt=''
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line == vim.eval('getline(\'.\')'): break
|
||||
elif str == '\\': continue
|
||||
elif str == ';':
|
||||
break
|
||||
elif type == tokenize.NEWLINE and level == 0:
|
||||
break
|
||||
elif str in ['[','(']:
|
||||
level += 1
|
||||
elif str in [')',']']:
|
||||
level -= 1
|
||||
elif level == 0:
|
||||
stmt += str
|
||||
#dbg(10,"current statement: %s" % stmt)
|
||||
return stmt
|
||||
|
||||
def parse_block(gen):
|
||||
lines = []
|
||||
level = 0
|
||||
for type, str, begin, end, line in gen:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
else:
|
||||
stmt = parse_statement(gen,str)
|
||||
if len(stmt) > 0: lines.append(stmt)
|
||||
return lines
|
||||
|
||||
def parse_statement(gen,curstr=''):
|
||||
var = curstr
|
||||
type, str, begin, end, line = gen.next()
|
||||
if str == '=':
|
||||
type, str, begin, end, line = gen.next()
|
||||
if type == tokenize.NEWLINE:
|
||||
return ''
|
||||
elif type == tokenize.STRING or str == 'str':
|
||||
return '%s = str' % var
|
||||
elif str == '[' or str == 'list':
|
||||
return '%s= list' % var
|
||||
elif str == '{' or str == 'dict':
|
||||
return '%s = dict' % var
|
||||
elif type == tokenize.NUMBER:
|
||||
return '%s = 0' % var
|
||||
elif str == 'Set':
|
||||
return '%s = Set' % var
|
||||
elif str == 'open' or str == 'file':
|
||||
return '%s = file' % var
|
||||
else:
|
||||
inst = str + parse_to_end(gen)
|
||||
if len(inst) > 0:
|
||||
#dbg(5,"found [%s = %s]" % (var, inst))
|
||||
return '%s = %s' % (var, inst)
|
||||
return ''
|
||||
|
||||
def eval_source_code():
|
||||
LINE=vim.eval('getline(\'.\')')
|
||||
s = cStringIO.StringIO('\n'.join(vim.current.buffer[:]) + '\n')
|
||||
g = tokenize.generate_tokens(s.readline)
|
||||
|
||||
stmts = []
|
||||
lineNo = 0
|
||||
try:
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif begin[0] == lineNo: continue
|
||||
#junk
|
||||
elif type == tokenize.INDENT or \
|
||||
type == tokenize.DEDENT or \
|
||||
type == tokenize.ERRORTOKEN or \
|
||||
type == tokenize.ENDMARKER or \
|
||||
type == tokenize.NEWLINE or \
|
||||
type == tokenize.COMMENT:
|
||||
continue
|
||||
#import statement
|
||||
elif str == 'import':
|
||||
import_stmt=parse_to_end(g)
|
||||
if len(import_stmt) > 0:
|
||||
#dbg(5,"found [import %s]" % import_stmt)
|
||||
stmts.append("import %s" % import_stmt)
|
||||
#import from statement
|
||||
elif str == 'from':
|
||||
type, str, begin, end, line = g.next()
|
||||
mod = str
|
||||
|
||||
type, str, begin, end, line = g.next()
|
||||
if str != "import": break
|
||||
from_stmt=parse_to_end(g)
|
||||
if len(from_stmt) > 0:
|
||||
#dbg(5,"found [from %s import %s]" % (mod, from_stmt))
|
||||
stmts.append("from %s import %s" % (mod, from_stmt))
|
||||
#def statement
|
||||
elif str == 'def':
|
||||
funcstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
funcstr += str
|
||||
if len(funcstr) > 0:
|
||||
#dbg(5,"found [def %s]" % funcstr)
|
||||
stmts.append("def %s:\n pass" % funcstr)
|
||||
#class declaration
|
||||
elif str == 'class':
|
||||
type, str, begin, end, line = g.next()
|
||||
classname = str
|
||||
#dbg(5,"found [class %s]" % classname)
|
||||
|
||||
level = 0
|
||||
members = []
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif type == tokenize.INDENT:
|
||||
level += 1
|
||||
elif type == tokenize.DEDENT:
|
||||
level -= 1
|
||||
if level == 0: break;
|
||||
elif str == 'def':
|
||||
memberstr = ''
|
||||
for type, str, begin, end, line in g:
|
||||
if line.replace('\n','') == vim.eval('getline(\'.\')'): break
|
||||
elif str == ':':
|
||||
stmts += parse_block(g)
|
||||
break
|
||||
memberstr += str
|
||||
#dbg(5," member [%s]" % memberstr)
|
||||
members.append(memberstr)
|
||||
classstr = 'class %s:' % classname
|
||||
for m in members:
|
||||
classstr += ("\n def %s:\n pass" % m)
|
||||
stmts.append("%s\n" % classstr)
|
||||
elif keyword.iskeyword(str) or str in globals():
|
||||
#dbg(5,"keyword = %s" % str)
|
||||
lineNo = begin[0]
|
||||
else:
|
||||
assign = parse_statement(g,str)
|
||||
if len(assign) > 0: stmts.append(assign)
|
||||
|
||||
for s in stmts:
|
||||
try:
|
||||
#dbg(15,"evaluating: %s\n" % s)
|
||||
exec(s) in globals()
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
except:
|
||||
#dbg(1,"exception: %s" % sys.exc_info()[1])
|
||||
pass
|
||||
|
||||
def clean_up():
|
||||
for o in globals().keys():
|
||||
if o not in LOCALDEFS:
|
||||
try:
|
||||
exec('del %s' % o) in globals()
|
||||
except: pass
|
||||
|
||||
sys.path.extend(['.','..'])
|
||||
PYTHONEOF
|
||||
endfunction
|
||||
|
||||
let g:pycomplete_debug_level = 0
|
||||
call s:DefPython()
|
||||
" vim: set et ts=4:
|
||||
111
runtime/autoload/spellfile.vim
Normal file
111
runtime/autoload/spellfile.vim
Normal file
@@ -0,0 +1,111 @@
|
||||
" Vim script to download a missing spell file
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2006 Feb 01
|
||||
|
||||
if !exists('g:spellfile_URL')
|
||||
let g:spellfile_URL = 'ftp://ftp.vim.org/pub/vim/unstable/runtime/spell'
|
||||
endif
|
||||
let s:spellfile_URL = '' " Start with nothing so that s:donedict is reset.
|
||||
|
||||
" This function is used for the spellfile plugin.
|
||||
function! spellfile#LoadFile(lang)
|
||||
" If the netrw plugin isn't loaded we silently skip everything.
|
||||
if !exists(":Nread")
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): Nread command is not available.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
" If the URL changes we try all files again.
|
||||
if s:spellfile_URL != g:spellfile_URL
|
||||
let s:donedict = {}
|
||||
let s:spellfile_URL = g:spellfile_URL
|
||||
endif
|
||||
|
||||
" I will say this only once!
|
||||
if has_key(s:donedict, a:lang . &enc)
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): Tried this language/encoding before.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
let s:donedict[a:lang . &enc] = 1
|
||||
|
||||
" Find spell directories we can write in.
|
||||
let dirlist = []
|
||||
let dirchoices = '&Cancel'
|
||||
for dir in split(globpath(&rtp, 'spell'), "\n")
|
||||
if filewritable(dir) == 2
|
||||
call add(dirlist, dir)
|
||||
let dirchoices .= "\n&" . len(dirlist)
|
||||
endif
|
||||
endfor
|
||||
if len(dirlist) == 0
|
||||
if &verbose
|
||||
echomsg 'spellfile#LoadFile(): There is no writable spell directory.'
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
let msg = 'Cannot find spell file for "' . a:lang . '" in ' . &enc
|
||||
let msg .= "\nDo you want me to try downloading it?"
|
||||
if confirm(msg, "&Yes\n&No", 2) == 1
|
||||
let enc = &encoding
|
||||
if enc == 'iso-8859-15'
|
||||
let enc = 'latin1'
|
||||
endif
|
||||
let fname = a:lang . '.' . enc . '.spl'
|
||||
|
||||
" Split the window, read the file into a new buffer.
|
||||
new
|
||||
setlocal bin
|
||||
echo 'Downloading ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMspell'
|
||||
" Didn't work, perhaps there is an ASCII one.
|
||||
g/^/d
|
||||
let fname = a:lang . '.ascii.spl'
|
||||
echo 'Could not find it, trying ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMspell'
|
||||
echo 'Sorry, downloading failed'
|
||||
bwipe!
|
||||
return
|
||||
endif
|
||||
endif
|
||||
|
||||
" Delete the empty first line and mark the file unmodified.
|
||||
1d
|
||||
set nomod
|
||||
|
||||
let msg = "In which directory do you want to write the file:"
|
||||
for i in range(len(dirlist))
|
||||
let msg .= "\n" . (i + 1) . '. ' . dirlist[i]
|
||||
endfor
|
||||
let dirchoice = confirm(msg, dirchoices) - 2
|
||||
if dirchoice >= 0
|
||||
exe "write " . escape(dirlist[dirchoice], ' ') . '/' . fname
|
||||
|
||||
" Also download the .sug file, if the user wants to.
|
||||
let msg = "Do you want me to try getting the .sug file?\n"
|
||||
let msg .= "This will improve making suggestions for spelling mistakes,\n"
|
||||
let msg .= "but it uses quite a bit of memory."
|
||||
if confirm(msg, "&No\n&Yes") == 2
|
||||
g/^/d
|
||||
let fname = substitute(fname, '\.spl$', '.sug', '')
|
||||
echo 'Downloading ' . fname . '...'
|
||||
exe 'Nread ' g:spellfile_URL . '/' . fname
|
||||
if getline(2) !~ 'VIMsug'
|
||||
echo 'Sorry, downloading failed'
|
||||
else
|
||||
1d
|
||||
exe "write " . escape(dirlist[dirchoice], ' ') . '/' . fname
|
||||
endif
|
||||
set nomod
|
||||
endif
|
||||
endif
|
||||
|
||||
bwipe
|
||||
endif
|
||||
endfunc
|
||||
267
runtime/autoload/syntaxcomplete.vim
Normal file
267
runtime/autoload/syntaxcomplete.vim
Normal file
@@ -0,0 +1,267 @@
|
||||
" Vim completion script
|
||||
" Language: All languages, uses existing syntax highlighting rules
|
||||
" Maintainer: David Fishburn <fishburn@ianywhere.com>
|
||||
" Version: 1.2
|
||||
" Last Change: Sat Mar 18 2006 8:25:30 PM
|
||||
|
||||
" Set completion with CTRL-X CTRL-O to autoloaded function.
|
||||
" This check is in place in case this script is
|
||||
" sourced directly instead of using the autoload feature.
|
||||
if exists('+omnifunc')
|
||||
" Do not set the option if already set since this
|
||||
" results in an E117 warning.
|
||||
if &omnifunc == ""
|
||||
setlocal omnifunc=syntaxcomplete#Complete
|
||||
endif
|
||||
endif
|
||||
|
||||
if exists('g:loaded_syntax_completion')
|
||||
finish
|
||||
endif
|
||||
let g:loaded_syntax_completion = 1
|
||||
|
||||
" This script will build a completion list based on the syntax
|
||||
" elements defined by the files in $VIMRUNTIME/syntax.
|
||||
|
||||
let s:syn_remove_words = 'match,matchgroup=,contains,'.
|
||||
\ 'links to,start=,end=,nextgroup='
|
||||
|
||||
let s:cache_name = []
|
||||
let s:cache_list = []
|
||||
let s:prepended = ''
|
||||
|
||||
" This function is used for the 'omnifunc' option.
|
||||
function! syntaxcomplete#Complete(findstart, base)
|
||||
|
||||
if a:findstart
|
||||
" Locate the start of the item, including "."
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let lastword = -1
|
||||
while start > 0
|
||||
if line[start - 1] =~ '\w'
|
||||
let start -= 1
|
||||
elseif line[start - 1] =~ '\.'
|
||||
" The user must be specifying a column name
|
||||
if lastword == -1
|
||||
let lastword = start
|
||||
endif
|
||||
let start -= 1
|
||||
let b:sql_compl_type = 'column'
|
||||
else
|
||||
break
|
||||
endif
|
||||
endwhile
|
||||
|
||||
" Return the column of the last word, which is going to be changed.
|
||||
" Remember the text that comes before it in s:prepended.
|
||||
if lastword == -1
|
||||
let s:prepended = ''
|
||||
return start
|
||||
endif
|
||||
let s:prepended = strpart(line, start, lastword - start)
|
||||
return lastword
|
||||
endif
|
||||
|
||||
let base = s:prepended . a:base
|
||||
|
||||
let list_idx = index(s:cache_name, &filetype, 0, &ignorecase)
|
||||
if list_idx > -1
|
||||
let compl_list = s:cache_list[list_idx]
|
||||
else
|
||||
let compl_list = OmniSyntaxList()
|
||||
let s:cache_name = add( s:cache_name, &filetype )
|
||||
let s:cache_list = add( s:cache_list, compl_list )
|
||||
endif
|
||||
|
||||
" Return list of matches.
|
||||
|
||||
if base =~ '\w'
|
||||
let compstr = join(compl_list, ' ')
|
||||
let compstr = substitute(compstr, '\<\%('.base.'\)\@!\w\+\s*', '', 'g')
|
||||
let compl_list = split(compstr, '\s\+')
|
||||
endif
|
||||
|
||||
return compl_list
|
||||
endfunc
|
||||
|
||||
function! OmniSyntaxList()
|
||||
let saveL = @l
|
||||
|
||||
" Loop through all the syntax groupnames, and build a
|
||||
" syntax file which contains these names. This can
|
||||
" work generically for any filetype that does not already
|
||||
" have a plugin defined.
|
||||
" This ASSUMES the syntax groupname BEGINS with the name
|
||||
" of the filetype. From my casual viewing of the vim7\syntax
|
||||
" directory.
|
||||
redir @l
|
||||
silent! exec 'syntax list '
|
||||
redir END
|
||||
|
||||
let syntax_full = "\n".@l
|
||||
let @l = saveL
|
||||
|
||||
if syntax_full =~ 'E28'
|
||||
\ || syntax_full =~ 'E411'
|
||||
\ || syntax_full =~ 'E415'
|
||||
\ || syntax_full =~ 'No Syntax items'
|
||||
return []
|
||||
endif
|
||||
|
||||
" Default the include group to include the requested syntax group
|
||||
let syntax_group_include_{&filetype} = ''
|
||||
" Check if there are any overrides specified for this filetype
|
||||
if exists('g:omni_syntax_group_include_'.&filetype)
|
||||
let syntax_group_include_{&filetype} =
|
||||
\ substitute( g:omni_syntax_group_include_{&filetype},'\s\+','','g')
|
||||
if syntax_group_include_{&filetype} =~ '\w'
|
||||
let syntax_group_include_{&filetype} =
|
||||
\ substitute( syntax_group_include_{&filetype},
|
||||
\ '\s*,\s*', '\\|', 'g'
|
||||
\ )
|
||||
endif
|
||||
endif
|
||||
|
||||
" Default the exclude group to nothing
|
||||
let syntax_group_exclude_{&filetype} = ''
|
||||
" Check if there are any overrides specified for this filetype
|
||||
if exists('g:omni_syntax_group_exclude_'.&filetype)
|
||||
let syntax_group_exclude_{&filetype} =
|
||||
\ substitute( g:omni_syntax_group_exclude_{&filetype},'\s\+','','g')
|
||||
if syntax_group_exclude_{&filetype} =~ '\w'
|
||||
let syntax_group_exclude_{&filetype} =
|
||||
\ substitute( syntax_group_exclude_{&filetype},
|
||||
\ '\s*,\s*', '\\|', 'g'
|
||||
\ )
|
||||
endif
|
||||
endif
|
||||
|
||||
" Syntax rules can contain items for more than just the current
|
||||
" filetype. They can contain additional items added by the user
|
||||
" via autocmds or their vimrc.
|
||||
" Some syntax files can be combined (html, php, jsp).
|
||||
" We want only items that begin with the filetype we are interested in.
|
||||
let next_group_regex = '\n' .
|
||||
\ '\zs'.&filetype.'\w\+\ze'.
|
||||
\ '\s\+xxx\s\+'
|
||||
let syn_list = ''
|
||||
let index = 0
|
||||
let index = match(syntax_full, next_group_regex, index)
|
||||
|
||||
while index > 0
|
||||
let group_name = matchstr( syntax_full, '\w\+', index )
|
||||
|
||||
let get_syn_list = 1
|
||||
" if syntax_group_include_{&filetype} == ''
|
||||
" if syntax_group_exclude_{&filetype} != ''
|
||||
" if '\<'.syntax_group_exclude_{&filetype}.'\>' =~ '\<'.group_name.'\>'
|
||||
" let get_syn_list = 0
|
||||
" endif
|
||||
" endif
|
||||
" else
|
||||
" if '\<'.syntax_group_include_{&filetype}.'\>' !~ '\<'.group_name.'\>'
|
||||
" let get_syn_list = 0
|
||||
" endif
|
||||
" endif
|
||||
if syntax_group_exclude_{&filetype} != ''
|
||||
if '\<'.syntax_group_exclude_{&filetype}.'\>' =~ '\<'.group_name.'\>'
|
||||
let get_syn_list = 0
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_syn_list == 1
|
||||
if syntax_group_include_{&filetype} != ''
|
||||
if '\<'.syntax_group_include_{&filetype}.'\>' !~ '\<'.group_name.'\>'
|
||||
let get_syn_list = 0
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
if get_syn_list == 1
|
||||
" Pass in the full syntax listing, plus the group name we
|
||||
" are interested in.
|
||||
let extra_syn_list = s:SyntaxGroupItems(group_name, syntax_full)
|
||||
|
||||
let syn_list = syn_list . extra_syn_list . "\n"
|
||||
endif
|
||||
|
||||
let index = index + strlen(group_name)
|
||||
let index = match(syntax_full, next_group_regex, index)
|
||||
endwhile
|
||||
|
||||
" Convert the string to a List and sort it.
|
||||
let compl_list = sort(split(syn_list))
|
||||
|
||||
if &filetype == 'vim'
|
||||
let short_compl_list = []
|
||||
for i in range(len(compl_list))
|
||||
if i == len(compl_list)-1
|
||||
let next = i
|
||||
else
|
||||
let next = i + 1
|
||||
endif
|
||||
if compl_list[next] !~ '^'.compl_list[i].'.$'
|
||||
let short_compl_list += [compl_list[i]]
|
||||
endif
|
||||
endfor
|
||||
|
||||
return short_compl_list
|
||||
else
|
||||
return compl_list
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:SyntaxGroupItems( group_name, syntax_full )
|
||||
|
||||
let syn_list = ""
|
||||
|
||||
" From the full syntax listing, strip out the portion for the
|
||||
" request group.
|
||||
" Query:
|
||||
" \n - must begin with a newline
|
||||
" a:group_name - the group name we are interested in
|
||||
" \s\+xxx\s\+ - group names are always followed by xxx
|
||||
" \zs - start the match
|
||||
" .\{-} - everything ...
|
||||
" \ze - end the match
|
||||
" \n\w - at the first newline starting with a character
|
||||
let syntax_group = matchstr(a:syntax_full,
|
||||
\ "\n".a:group_name.'\s\+xxx\s\+\zs.\{-}\ze'."\n".'\w'
|
||||
\)
|
||||
|
||||
if syntax_group != ""
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*\%(contained\s*\)\?', "", '' )
|
||||
" let syn_list = substitute( @l, '^.*xxx\s*', "", '' )
|
||||
|
||||
" We only want the words for the lines begining with
|
||||
" containedin, but there could be other items.
|
||||
|
||||
" Tried to remove all lines that do not begin with contained
|
||||
" but this does not work in all cases since you can have
|
||||
" contained nextgroup=...
|
||||
" So this will strip off the ending of lines with known
|
||||
" keywords.
|
||||
let syn_list = substitute( syntax_group, '\<\('.
|
||||
\ substitute(
|
||||
\ escape( s:syn_remove_words, '\\/.*$^~[]')
|
||||
\ , ',', '\\|', 'g').
|
||||
\ '\).\{-}\%($\|'."\n".'\)'
|
||||
\ , "\n", 'g' )
|
||||
|
||||
" Now strip off the newline + blank space + contained
|
||||
let syn_list = substitute( syn_list, '\%(^\|\n\)\@<=\s*\<\('.
|
||||
\ 'contained\)'
|
||||
\ , "", 'g' )
|
||||
|
||||
" There are a number of items which have non-word characters in
|
||||
" them, *'T_F1'*. vim.vim is one such file.
|
||||
" This will replace non-word characters with spaces.
|
||||
let syn_list = substitute( syn_list, '[^0-9A-Za-z_ ]', ' ', 'g' )
|
||||
else
|
||||
let syn_list = ''
|
||||
endif
|
||||
|
||||
return syn_list
|
||||
endfunction
|
||||
|
||||
333
runtime/autoload/tar.vim
Normal file
333
runtime/autoload/tar.vim
Normal file
@@ -0,0 +1,333 @@
|
||||
" tar.vim: Handles browsing tarfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Dec 24, 2005
|
||||
" Version: 7
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" License: Vim License (see vim's :help license)
|
||||
"
|
||||
" Contains many ideas from Michael Toren's <tar.vim>
|
||||
"
|
||||
" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" tarPlugin.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. 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.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
if exists("g:loaded_tar")
|
||||
finish
|
||||
endif
|
||||
let g:loaded_tar= "v7"
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Default Settings: {{{1
|
||||
if !exists("g:tar_browseoptions")
|
||||
let g:tar_browseoptions= "Ptf"
|
||||
endif
|
||||
if !exists("g:tar_readoptions")
|
||||
let g:tar_readoptions= "OPxf"
|
||||
endif
|
||||
if !exists("g:tar_writeoptions")
|
||||
let g:tar_writeoptions= "uf"
|
||||
endif
|
||||
|
||||
" ----------------
|
||||
" Functions: {{{1
|
||||
" ----------------
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Browse: {{{2
|
||||
fun! tar#Browse(tarfile)
|
||||
" call Dfunc("tar#Browse(tarfile<".a:tarfile.">)")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("tar")
|
||||
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system'
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse")
|
||||
return
|
||||
endif
|
||||
if !filereadable(a:tarfile)
|
||||
if a:tarfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
echohl Error | echo "***error*** (tar#Browse) File not readable<".a:tarfile.">" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
endif
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse : file<".a:tarfile."> not readable")
|
||||
return
|
||||
endif
|
||||
if &ma != 1
|
||||
set ma
|
||||
endif
|
||||
let w:tarfile= a:tarfile
|
||||
|
||||
setlocal noswapfile
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal nobuflisted
|
||||
setlocal nowrap
|
||||
set ft=tar
|
||||
|
||||
" give header
|
||||
exe "$put ='".'\"'." tar.vim version ".g:loaded_tar."'"
|
||||
exe "$put ='".'\"'." Browsing tarfile ".a:tarfile."'"
|
||||
exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'"
|
||||
0d
|
||||
$
|
||||
|
||||
if a:tarfile =~# '\.\(gz\|tgz\)$'
|
||||
exe "silent r! gzip -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - "
|
||||
elseif a:tarfile =~# '\.bz2$'
|
||||
exe "silent r! bzip2 -d -c '".a:tarfile."'| tar -".g:tar_browseoptions." - "
|
||||
else
|
||||
exe "silent r! tar -".g:tar_browseoptions." '".a:tarfile."'"
|
||||
endif
|
||||
silent %g@/$@d
|
||||
|
||||
setlocal noma nomod ro
|
||||
noremap <silent> <buffer> <cr> :call <SID>TarBrowseSelect()<cr>
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Browse : w:tarfile<".w:tarfile.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" TarBrowseSelect: {{{2
|
||||
fun! s:TarBrowseSelect()
|
||||
" call Dfunc("TarBrowseSelect() w:tarfile<".w:tarfile."> curfile<".expand("%").">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let fname= getline(".")
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
" sanity check
|
||||
if fname =~ '^"'
|
||||
let &report= repkeep
|
||||
" call Dret("TarBrowseSelect")
|
||||
return
|
||||
endif
|
||||
|
||||
" about to make a new window, need to use w:tarfile
|
||||
let tarfile= w:tarfile
|
||||
let curfile= expand("%")
|
||||
|
||||
new
|
||||
wincmd _
|
||||
let s:tblfile_{winnr()}= curfile
|
||||
" call Decho("exe e tarfile:".tarfile.':'.fname)
|
||||
exe "e tarfile:".tarfile.':'.fname
|
||||
filetype detect
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("TarBrowseSelect : s:tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Read: {{{2
|
||||
fun! tar#Read(fname,mode)
|
||||
" call Dfunc("tar#Read(fname<".a:fname.">,mode=".a:mode.")")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let tarfile = substitute(a:fname,'tarfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(a:fname,'tarfile:.\{-}:\(.*\)$','\1','')
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
if tarfile =~# '\.\(gz\|tgz\)$'
|
||||
" call Decho("exe silent r! gzip -d -c '".tarfile."'| tar -OPxf - '".fname."'")
|
||||
exe "silent r! gzip -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'"
|
||||
elseif tarfile =~# '\.bz2$'
|
||||
" call Decho("exe silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'")
|
||||
exe "silent r! bzip2 -d -c '".tarfile."'| tar -".g:tar_readoptions." - '".fname."'"
|
||||
else
|
||||
" call Decho("exe silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'")
|
||||
exe "silent r! tar -".g:tar_readoptions." '".tarfile."' '".fname."'"
|
||||
endif
|
||||
let w:tarfile= a:fname
|
||||
exe "file tarfile:".fname
|
||||
|
||||
" cleanup
|
||||
0d
|
||||
set nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Read : w:tarfile<".w:tarfile.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" tar#Write: {{{2
|
||||
fun! tar#Write(fname)
|
||||
" call Dfunc("tar#Write(fname<".a:fname.">) w:tarfile<".w:tarfile."> tblfile_".winnr()."<".s:tblfile_{winnr()}.">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("tar")
|
||||
echohl Error | echo '***error*** (tar#Browse) "tar" not available on your system'
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endif
|
||||
if !exists("*mkdir")
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, mkdir() doesn't work on your system" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endif
|
||||
|
||||
let curdir= getcwd()
|
||||
let tmpdir= tempname()
|
||||
" call Decho("orig tempname<".tmpdir.">")
|
||||
if tmpdir =~ '\.'
|
||||
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
|
||||
endif
|
||||
" call Decho("tmpdir<".tmpdir.">")
|
||||
call mkdir(tmpdir,"p")
|
||||
|
||||
" attempt to change to the indicated directory
|
||||
try
|
||||
exe "cd ".escape(tmpdir,' \')
|
||||
catch /^Vim\%((\a\+)\)\=:E344/
|
||||
echohl Error | echo "***error*** (tar#Write) cannot cd to temporary directory" | Echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
return
|
||||
endtry
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
" place temporary files under .../_ZIPVIM_/
|
||||
if isdirectory("_ZIPVIM_")
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
endif
|
||||
call mkdir("_ZIPVIM_")
|
||||
cd _ZIPVIM_
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
let tarfile = substitute(w:tarfile,'tarfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(w:tarfile,'tarfile:.\{-}:\(.*\)$','\1','')
|
||||
|
||||
" handle compressed archives
|
||||
if tarfile =~# '\.gz'
|
||||
call system("gzip -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.gz','','e')
|
||||
let compress= "gzip '".tarfile."'"
|
||||
elseif tarfile =~# '\.tgz'
|
||||
call system("gzip -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.tgz','.tar','e')
|
||||
let compress= "gzip '".tarfile."'"
|
||||
let tgz = 1
|
||||
elseif tarfile =~# '\.bz2'
|
||||
call system("bzip2 -d ".tarfile)
|
||||
let tarfile = substitute(tarfile,'\.bz2','','e')
|
||||
let compress= "bzip2 '".tarfile."'"
|
||||
endif
|
||||
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
if fname =~ '/'
|
||||
let dirpath = substitute(fname,'/[^/]\+$','','e')
|
||||
if executable("cygpath")
|
||||
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
|
||||
endif
|
||||
call mkdir(dirpath,"p")
|
||||
endif
|
||||
if tarfile !~ '/'
|
||||
let tarfile= curdir.'/'.tarfile
|
||||
endif
|
||||
" call Decho("tarfile<".tarfile."> fname<".fname.">")
|
||||
|
||||
exe "w! ".fname
|
||||
if executable("cygpath")
|
||||
let tarfile = substitute(system("cygpath ".tarfile),'\n','','e')
|
||||
endif
|
||||
|
||||
" delete old file from tarfile
|
||||
" call Decho("tar --delete -f '".tarfile."' '".fname."'")
|
||||
call system("tar --delete -f '".tarfile."' '".fname."'")
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
else
|
||||
|
||||
" update tarfile with new file
|
||||
" call Decho("tar -".g:tar_writeoptions." '".tarfile."' '".fname."'")
|
||||
call system("tar -".g:tar_writeoptions." '".tarfile."' '".fname."'")
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (tar#Write) sorry, unable to update ".tarfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
elseif exists("compress")
|
||||
" call Decho("call system(".compress.")")
|
||||
call system(compress)
|
||||
if exists("tgz")
|
||||
" call Decho("rename(".tarfile.".gz,".substitute(tarfile,'\.tar$','.tgz','e').")")
|
||||
call rename(tarfile.".gz",substitute(tarfile,'\.tar$','.tgz','e'))
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
" support writing tarfiles across a network
|
||||
if s:tblfile_{winnr()} =~ '^\a\+://'
|
||||
" call Decho("handle writing <".tarfile."> across network to <".s:tblfile_{winnr()}.">")
|
||||
let tblfile= s:tblfile_{winnr()}
|
||||
1split|enew
|
||||
let binkeep= &binary
|
||||
let eikeep = &ei
|
||||
set binary ei=all
|
||||
exe "e! ".tarfile
|
||||
call netrw#NetWrite(tblfile)
|
||||
let &ei = eikeep
|
||||
let &binary = binkeep
|
||||
q!
|
||||
unlet s:tblfile_{winnr()}
|
||||
endif
|
||||
endif
|
||||
|
||||
" cleanup and restore current directory
|
||||
cd ..
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
exe "cd ".escape(curdir,' \')
|
||||
setlocal nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("tar#Write")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Rmdir: {{{2
|
||||
fun! s:Rmdir(fname)
|
||||
" call Dfunc("Rmdir(fname<".a:fname.">)")
|
||||
if has("unix")
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~? "sh$"
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
else
|
||||
call system("del /S ".a:fname)
|
||||
endif
|
||||
endif
|
||||
" call Dret("Rmdir")
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" vim:ts=8 fdm=marker
|
||||
254
runtime/autoload/vimball.vim
Normal file
254
runtime/autoload/vimball.vim
Normal file
@@ -0,0 +1,254 @@
|
||||
" vimball : construct a file containing both paths and files
|
||||
" Author: Charles E. Campbell, Jr.
|
||||
" Date: Mar 22, 2006
|
||||
" Version: 5
|
||||
" GetLatestVimScripts: 1502 1 :AutoInstall: vimball.vim
|
||||
" Copyright: (c) 2004-2006 by Charles E. Campbell, Jr.
|
||||
" The VIM LICENSE applies to Vimball.vim, and Vimball.txt
|
||||
" (see |copyright|) except use "Vimball" instead of "Vim".
|
||||
" No warranty, express or implied.
|
||||
" *** *** Use At-Your-Own-Risk! *** ***
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Load Once: {{{1
|
||||
if &cp || exists("g:loaded_vimball")
|
||||
finish
|
||||
endif
|
||||
let s:keepcpo = &cpo
|
||||
let g:loaded_vimball = "v5"
|
||||
set cpo&vim
|
||||
|
||||
" =====================================================================
|
||||
" Functions: {{{1
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" MkVimball: creates a vimball given a list of paths to files {{{2
|
||||
" Vimball Format:
|
||||
" path
|
||||
" filesize
|
||||
" [file]
|
||||
" path
|
||||
" filesize
|
||||
" [file]
|
||||
fun! vimball#MkVimball(line1,line2,writelevel,vimballname) range
|
||||
" call Dfunc("MkVimball(line1=".a:line1." line2=".a:line2." writelevel=".a:writelevel." vimballname<".a:vimballname.">")
|
||||
let vbname= substitute(a:vimballname,'\.[^.]*$','','e').'.vba'
|
||||
if !a:writelevel && filereadable(vbname)
|
||||
echohl Error | echoerr "(MkVimball) file<".vbname."> exists; use ! to insist" | echohl None
|
||||
" call Dret("MkVimball : file<".vbname."> already exists; use ! to insist")
|
||||
return
|
||||
endif
|
||||
|
||||
" user option bypass
|
||||
let eikeep= &ei
|
||||
set ei=all
|
||||
|
||||
let home = substitute(&rtp,',.*$','','')
|
||||
let curdir = getcwd()
|
||||
exe "cd ".home
|
||||
|
||||
" record current tab, initialize while loop index
|
||||
let curtabnr = tabpagenr()
|
||||
let linenr = a:line1
|
||||
" call Decho("curtabnr=".curtabnr)
|
||||
|
||||
while linenr <= a:line2
|
||||
let svfile = getline(linenr)
|
||||
" call Decho("svfile<".svfile.">")
|
||||
|
||||
if !filereadable(svfile)
|
||||
echohl Error | echo "unable to read file<".svfile.">" | echohl None
|
||||
let &ei= eikeep
|
||||
exe "cd ".curdir
|
||||
" call Dret("MkVimball")
|
||||
return
|
||||
endif
|
||||
|
||||
" create/switch to mkvimball tab
|
||||
if !exists("vbtabnr")
|
||||
tabnew
|
||||
silent! file Vimball
|
||||
let vbtabnr= tabpagenr()
|
||||
else
|
||||
exe "tabn ".vbtabnr
|
||||
endif
|
||||
|
||||
let lastline= line("$") + 1
|
||||
if lastline == 2 && getline("$") == ""
|
||||
call setline(1,'" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.')
|
||||
call setline(2,'UseVimball')
|
||||
call setline(3,'finish')
|
||||
let lastline= 4
|
||||
endif
|
||||
call setline(lastline ,svfile)
|
||||
call setline(lastline+1,0)
|
||||
exe "$r ".svfile
|
||||
call setline(lastline+1,line("$") - lastline - 1)
|
||||
" call Decho("lastline=".lastline." line$=".line("$"))
|
||||
|
||||
" restore to normal tab
|
||||
exe "tabn ".curtabnr
|
||||
let linenr= linenr + 1
|
||||
endwhile
|
||||
|
||||
" write the vimball
|
||||
exe "tabn ".vbtabnr
|
||||
exe "cd ".curdir
|
||||
if a:writelevel
|
||||
exe "w! ".vbname
|
||||
else
|
||||
exe "w ".vbname
|
||||
endif
|
||||
" call Decho("Vimball<".vbname."> created")
|
||||
echo "Vimball<".vbname."> created"
|
||||
|
||||
" remove the evidence
|
||||
setlocal nomod bh=wipe
|
||||
exe "tabn ".curtabnr
|
||||
exe "tabc ".vbtabnr
|
||||
|
||||
" restore options
|
||||
let &ei= eikeep
|
||||
|
||||
" call Dret("MkVimball")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Vimball: {{{2
|
||||
fun! vimball#Vimball(really)
|
||||
" call Dfunc("Vimball(really=".a:really.")")
|
||||
|
||||
if getline(1) !~ '^" Vimball Archiver by Charles E. Campbell, Jr., Ph.D.$'
|
||||
echoerr "(Vimball) The current file does not appear to be a Vimball!"
|
||||
" call Dret("Vimball")
|
||||
return
|
||||
endif
|
||||
|
||||
" initialize
|
||||
let regakeep = @a
|
||||
let eikeep = &ei
|
||||
let vekeep = &ve
|
||||
let makeep = getpos("'a")
|
||||
let curtabnr = tabpagenr()
|
||||
set ei=all ve=all
|
||||
|
||||
" set up vimball tab
|
||||
tabnew
|
||||
silent! file Vimball
|
||||
let vbtabnr= tabpagenr()
|
||||
let didhelp= ""
|
||||
|
||||
" go to vim plugin home
|
||||
let home = substitute(&rtp,',.*$','','')
|
||||
let curdir = getcwd()
|
||||
" call Decho("exe cd ".home)
|
||||
exe "cd ".home
|
||||
let linenr = 4
|
||||
let filecnt = 0
|
||||
|
||||
" give title to listing of (extracted) files from Vimball Archive
|
||||
if a:really
|
||||
echohl Title | echomsg "Vimball Archive" | echohl None
|
||||
else
|
||||
echohl Title | echomsg "Vimball Archive Listing" | echohl None
|
||||
endif
|
||||
|
||||
" apportion vimball contents to various files
|
||||
" call Decho("exe tabn ".curtabnr)
|
||||
exe "tabn ".curtabnr
|
||||
" call Decho("linenr=".linenr." line$=".line("$"))
|
||||
while 1 < linenr && linenr < line("$")
|
||||
let fname = getline(linenr)
|
||||
let fsize = getline(linenr+1)
|
||||
let filecnt = filecnt + 1
|
||||
if a:really
|
||||
echomsg "extracted <".fname.">: ".fsize." lines"
|
||||
else
|
||||
echomsg "would extract <".fname.">: ".fsize." lines"
|
||||
endif
|
||||
" call Decho(linenr.": will extract file<".fname.">")
|
||||
" call Decho((linenr+1).": fsize=".fsize)
|
||||
|
||||
" make directories if they don't exist yet
|
||||
let fnamebuf= fname
|
||||
while fnamebuf =~ '/'
|
||||
let dirname = substitute(fnamebuf,'/.*$','','e')
|
||||
let fnamebuf = substitute(fnamebuf,'^.\{-}/\(.*\)$','\1','e')
|
||||
if !isdirectory(dirname)
|
||||
" call Decho("making <".dirname.">")
|
||||
call mkdir(dirname)
|
||||
endif
|
||||
exe "cd ".dirname
|
||||
endwhile
|
||||
exe "cd ".home
|
||||
|
||||
" grab specified qty of lines and place into "a" buffer
|
||||
exe linenr
|
||||
norm! jjma
|
||||
exe (linenr + fsize + 1)
|
||||
silent norm! "ay'a
|
||||
" call Decho("yanked ".fsize." lines into register-a")
|
||||
|
||||
" call Decho("didhelp<".didhelp."> fname<".fname.">")
|
||||
if didhelp == "" && fname =~ 'doc/[^/]\+\.txt$'
|
||||
let didhelp= substitute(fname,'^\(.*\<doc\)[/\\][^.]*\.txt$','\1','e')
|
||||
" call Decho("didhelp<".didhelp.">")
|
||||
endif
|
||||
|
||||
" copy "a" buffer into tab
|
||||
" call Decho('copy "a buffer into tab#'.vbtabnr)
|
||||
exe "tabn ".vbtabnr
|
||||
silent! %d
|
||||
silent norm! "aPGdd1G
|
||||
" call Decho("rega<".@a.">")
|
||||
|
||||
" write tab to file
|
||||
if a:really
|
||||
" call Decho("exe w! ".fname)
|
||||
exe "silent w! ".fname
|
||||
endif
|
||||
|
||||
" call Decho("exe tabn ".curtabnr)
|
||||
exe "tabn ".curtabnr
|
||||
" let oldlinenr = linenr " Decho
|
||||
let linenr = linenr + fsize + 2
|
||||
" call Decho("update linenr= [linenr=".oldlinenr."] + [fsize=".fsize."] + 2 = ".linenr)
|
||||
endwhile
|
||||
|
||||
" set up help
|
||||
" call Decho("about to set up help: didhelp<".didhelp.">")
|
||||
if didhelp != ""
|
||||
" call Decho("exe helptags ".home."/".didhelp)
|
||||
exe "helptags ".home."/".didhelp
|
||||
echomsg "did helptags"
|
||||
endif
|
||||
|
||||
" make sure a "Press ENTER..." prompt appears to keep the messages showing!
|
||||
while filecnt <= &ch
|
||||
echomsg " "
|
||||
let filecnt= filecnt + 1
|
||||
endwhile
|
||||
|
||||
" restore events, delete tab and buffer
|
||||
exe "tabn ".vbtabnr
|
||||
setlocal nomod bh=wipe
|
||||
exe "tabn ".curtabnr
|
||||
exe "tabc ".vbtabnr
|
||||
let &ei= eikeep
|
||||
let @a = regakeep
|
||||
if makeep[0] != 0
|
||||
" restore mark a
|
||||
" call Decho("restore mark-a: makeep=".string(makeep))
|
||||
call setpos("'a",makeep)
|
||||
ka
|
||||
endif
|
||||
exe "cd ".curdir
|
||||
|
||||
" call Dret("Vimball")
|
||||
endfun
|
||||
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" =====================================================================
|
||||
" Modelines: {{{1
|
||||
" vim: fdm=marker
|
||||
503
runtime/autoload/xmlcomplete.vim
Normal file
503
runtime/autoload/xmlcomplete.vim
Normal file
@@ -0,0 +1,503 @@
|
||||
" Vim completion script
|
||||
" Language: XML
|
||||
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
|
||||
" Last Change: 2006 Mar 19
|
||||
|
||||
" This function will create Dictionary with users namespace strings and values
|
||||
" canonical (system) names of data files. Names should be lowercase,
|
||||
" descriptive to avoid any future conflicts. For example 'xhtml10s' should be
|
||||
" name for data of XHTML 1.0 Strict and 'xhtml10t' for XHTML 1.0 Transitional
|
||||
" User interface will be provided by XMLns command defined ...
|
||||
" Currently supported canonicals are:
|
||||
" xhtml10s - XHTML 1.0 Strict
|
||||
" xsl - XSL
|
||||
function! xmlcomplete#CreateConnection(canonical, ...)
|
||||
|
||||
" When only one argument provided treat name as default namespace (without
|
||||
" 'prefix:').
|
||||
if exists("a:1")
|
||||
let users = a:1
|
||||
else
|
||||
let users = 'DEFAULT'
|
||||
endif
|
||||
|
||||
" Source data file. Due to suspected errors in autoload do it with
|
||||
" :runtime.
|
||||
" TODO: make it properly (using autoload, that is) later
|
||||
exe "runtime autoload/xml/".a:canonical.".vim"
|
||||
|
||||
" Remove all traces of unexisting files to return [] when trying
|
||||
" omnicomplete something
|
||||
" TODO: give warning about non-existing canonicals - should it be?
|
||||
if !exists("g:xmldata_".a:canonical)
|
||||
unlet! g:xmldata_connection
|
||||
return 0
|
||||
endif
|
||||
|
||||
" We need to initialize Dictionary to add key-value pair
|
||||
if !exists("g:xmldata_connection")
|
||||
let g:xmldata_connection = {}
|
||||
endif
|
||||
|
||||
let g:xmldata_connection[users] = a:canonical
|
||||
|
||||
endfunction
|
||||
|
||||
function! xmlcomplete#CreateEntConnection(...)
|
||||
if a:0 > 0
|
||||
let g:xmldata_entconnect = a:1
|
||||
else
|
||||
let g:xmldata_entconnect = 'DEFAULT'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! xmlcomplete#CompleteTags(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let curline = line('.')
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
let compl_begin = col('.') - 2
|
||||
|
||||
while start >= 0 && line[start - 1] =~ '\(\k\|[:.-]\)'
|
||||
let start -= 1
|
||||
endwhile
|
||||
|
||||
if start >= 0 && line[start - 1] =~ '&'
|
||||
let b:entitiescompl = 1
|
||||
let b:compl_context = ''
|
||||
return start
|
||||
endif
|
||||
|
||||
let b:compl_context = getline('.')[0:(compl_begin)]
|
||||
if b:compl_context !~ '<[^>]*$'
|
||||
" Look like we may have broken tag. Check previous lines. Up to
|
||||
" 10?
|
||||
let i = 1
|
||||
while 1
|
||||
let context_line = getline(curline-i)
|
||||
if context_line =~ '<[^>]*$'
|
||||
" Yep, this is this line
|
||||
let context_lines = getline(curline-i, curline)
|
||||
let b:compl_context = join(context_lines, ' ')
|
||||
break
|
||||
elseif context_line =~ '>[^<]*$' || i == curline
|
||||
" Normal tag line, no need for completion at all
|
||||
" OR reached first line without tag at all
|
||||
let b:compl_context = ''
|
||||
break
|
||||
endif
|
||||
let i += 1
|
||||
endwhile
|
||||
" Make sure we don't have counter
|
||||
unlet! i
|
||||
endif
|
||||
let b:compl_context = matchstr(b:compl_context, '.*\zs<.*')
|
||||
|
||||
" Make sure we will have only current namespace
|
||||
unlet! b:xml_namespace
|
||||
let b:xml_namespace = matchstr(b:compl_context, '^<\zs\k*\ze:')
|
||||
if b:xml_namespace == ''
|
||||
let b:xml_namespace = 'DEFAULT'
|
||||
endif
|
||||
|
||||
return start
|
||||
|
||||
else
|
||||
" There is no connction of namespace and data file. Abandon action
|
||||
if !exists("g:xmldata_connection") || g:xmldata_connection == {}
|
||||
return []
|
||||
endif
|
||||
" Initialize base return lists
|
||||
let res = []
|
||||
let res2 = []
|
||||
" a:base is very short - we need context
|
||||
if len(b:compl_context) == 0 && !exists("b:entitiescompl")
|
||||
return []
|
||||
endif
|
||||
let context = matchstr(b:compl_context, '^<\zs.*')
|
||||
unlet! b:compl_context
|
||||
|
||||
" Make entities completion
|
||||
if exists("b:entitiescompl")
|
||||
unlet! b:entitiescompl
|
||||
|
||||
if !exists("g:xmldata_entconnect") || g:xmldata_entconnect == 'DEFAULT'
|
||||
let values = g:xmldata{'_'.g:xmldata_connection['DEFAULT']}['vimxmlentities']
|
||||
else
|
||||
let values = g:xmldata{'_'.g:xmldata_entconnect}['vimxmlentities']
|
||||
endif
|
||||
|
||||
" Get only lines with entity declarations but throw out
|
||||
" parameter-entities - they may be completed in future
|
||||
let entdecl = filter(getline(1, "$"), 'v:val =~ "<!ENTITY\\s\\+[^%]"')
|
||||
|
||||
if len(entdecl) > 0
|
||||
let intent = map(copy(entdecl), 'matchstr(v:val, "<!ENTITY\\s\\+\\zs\\(\\k\\|[.-:]\\)\\+\\ze")')
|
||||
let values = intent + values
|
||||
endif
|
||||
|
||||
if len(a:base) == 1
|
||||
for m in values
|
||||
if m =~ '^'.a:base
|
||||
call add(res, m.';')
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
else
|
||||
for m in values
|
||||
if m =~? '^'.a:base
|
||||
call add(res, m.';')
|
||||
elseif m =~? a:base
|
||||
call add(res2, m.';')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
endif
|
||||
|
||||
endif
|
||||
if context =~ '>'
|
||||
" Generally if context contains > it means we are outside of tag and
|
||||
" should abandon action
|
||||
return []
|
||||
endif
|
||||
|
||||
" find tags matching with "a:base"
|
||||
" If a:base contains white space it is attribute.
|
||||
" It could be also value of attribute...
|
||||
" We have to get first word to offer
|
||||
" proper completions
|
||||
if context == ''
|
||||
let tag = ''
|
||||
else
|
||||
let tag = split(context)[0]
|
||||
endif
|
||||
" Get rid of namespace
|
||||
let tag = substitute(tag, '^'.b:xml_namespace.':', '', '')
|
||||
|
||||
|
||||
" Get last word, it should be attr name
|
||||
let attr = matchstr(context, '.*\s\zs.*')
|
||||
" Possible situations where any prediction would be difficult:
|
||||
" 1. Events attributes
|
||||
if context =~ '\s'
|
||||
|
||||
" If attr contains =\s*[\"'] we catched value of attribute
|
||||
if attr =~ "=\s*[\"']"
|
||||
" Let do attribute specific completion
|
||||
let attrname = matchstr(attr, '.*\ze\s*=')
|
||||
let entered_value = matchstr(attr, ".*=\\s*[\"']\\zs.*")
|
||||
|
||||
if tag =~ '^[?!]'
|
||||
" Return nothing if we are inside of ! or ? tag
|
||||
return []
|
||||
else
|
||||
let values = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][attrname]
|
||||
endif
|
||||
|
||||
if len(values) == 0
|
||||
return []
|
||||
endif
|
||||
|
||||
" We need special version of sbase
|
||||
let attrbase = matchstr(context, ".*[\"']")
|
||||
let attrquote = matchstr(attrbase, '.$')
|
||||
|
||||
for m in values
|
||||
" This if is needed to not offer all completions as-is
|
||||
" alphabetically but sort them. Those beginning with entered
|
||||
" part will be as first choices
|
||||
if m =~ '^'.entered_value
|
||||
call add(res, m . attrquote.' ')
|
||||
elseif m =~ entered_value
|
||||
call add(res2, m . attrquote.' ')
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
if tag =~ '?xml'
|
||||
" Two possible arguments for <?xml> plus variation
|
||||
let attrs = ['encoding', 'version="1.0"', 'version']
|
||||
elseif tag =~ '^!'
|
||||
" Don't make completion at all
|
||||
return []
|
||||
else
|
||||
let attrs = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1])
|
||||
endif
|
||||
|
||||
for m in sort(attrs)
|
||||
if m =~ '^'.attr
|
||||
call add(res, m)
|
||||
elseif m =~ attr
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
let menu = res + res2
|
||||
let final_menu = []
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmlattrinfo')
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'], item)
|
||||
let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][0]
|
||||
let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmlattrinfo'][item][1]
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
endif
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
|
||||
let item = item
|
||||
else
|
||||
let item .= '="'
|
||||
endif
|
||||
let final_menu += [{'word':item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][item][0] =~ '^\(BOOL\|'.item.'\)$'
|
||||
let item = item
|
||||
else
|
||||
let item .= '="'
|
||||
endif
|
||||
let final_menu += [item]
|
||||
endfor
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
endif
|
||||
" Close tag
|
||||
let b:unaryTagsStack = "base meta link hr br param img area input col"
|
||||
if context =~ '^\/'
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
return [opentag.">"]
|
||||
endif
|
||||
|
||||
" Complete elements of XML structure
|
||||
" TODO: #REQUIRED, #IMPLIED, #FIXED, #PCDATA - but these should be detected like
|
||||
" entities - in first run
|
||||
" keywords: CDATA, ID, IDREF, IDREFS, ENTITY, ENTITIES, NMTOKEN, NMTOKENS
|
||||
" are hardly recognizable but keep it in reserve
|
||||
" also: EMPTY ANY SYSTEM PUBLIC DATA
|
||||
if context =~ '^!'
|
||||
let tags = ['!ELEMENT', '!DOCTYPE', '!ATTLIST', '!ENTITY', '!NOTATION', '![CDATA[', '![INCLUDE[', '![IGNORE[']
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
let m = substitute(m, '^!\[\?', '', '')
|
||||
call add(res, m)
|
||||
elseif m =~ context
|
||||
let m = substitute(m, '^!\[\?', '', '')
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
" Complete text declaration
|
||||
let g:co = context
|
||||
if context =~ '^?'
|
||||
let tags = ['?xml']
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
call add(res, substitute(m, '^?', '', ''))
|
||||
elseif m =~ context
|
||||
call add(res, substitute(m, '^?', '', ''))
|
||||
endif
|
||||
endfor
|
||||
|
||||
return res + res2
|
||||
|
||||
endif
|
||||
|
||||
" Deal with tag completion.
|
||||
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
let opentag = substitute(opentag, '^\k*:', '', '')
|
||||
if opentag == ''
|
||||
"return []
|
||||
let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]})
|
||||
call filter(tags, 'v:val !~ "^vimxml"')
|
||||
else
|
||||
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
|
||||
endif
|
||||
|
||||
let context = substitute(context, '^\k*:', '', '')
|
||||
|
||||
for m in tags
|
||||
if m =~ '^'.context
|
||||
call add(res, m)
|
||||
elseif m =~ context
|
||||
call add(res2, m)
|
||||
endif
|
||||
endfor
|
||||
let menu = res + res2
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}, 'vimxmltaginfo')
|
||||
let final_menu = []
|
||||
for i in range(len(menu))
|
||||
let item = menu[i]
|
||||
if has_key(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'], item)
|
||||
let m_menu = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][0]
|
||||
let m_info = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}['vimxmltaginfo'][item][1]
|
||||
else
|
||||
let m_menu = ''
|
||||
let m_info = ''
|
||||
endif
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let xml_namespace = ''
|
||||
else
|
||||
let xml_namespace = b:xml_namespace.':'
|
||||
endif
|
||||
let final_menu += [{'word':xml_namespace.item, 'menu':m_menu, 'info':m_info}]
|
||||
endfor
|
||||
else
|
||||
let final_menu = menu
|
||||
endif
|
||||
return final_menu
|
||||
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" MM: This is greatly reduced closetag.vim used with kind permission of Steven
|
||||
" Mueller
|
||||
" Changes: strip all comments; delete error messages; add checking for
|
||||
" namespace
|
||||
" Author: Steven Mueller <diffusor@ugcs.caltech.edu>
|
||||
" Last Modified: Tue May 24 13:29:48 PDT 2005
|
||||
" Version: 0.9.1
|
||||
|
||||
function! xmlcomplete#GetLastOpenTag(unaryTagsStack)
|
||||
let linenum=line('.')
|
||||
let lineend=col('.') - 1 " start: cursor position
|
||||
let first=1 " flag for first line searched
|
||||
let b:TagStack='' " main stack of tags
|
||||
let startInComment=s:InComment()
|
||||
|
||||
if exists("b:xml_namespace")
|
||||
if b:xml_namespace == 'DEFAULT'
|
||||
let tagpat='</\=\(\k\|[.-]\)\+\|/>'
|
||||
else
|
||||
let tagpat='</\='.b:xml_namespace.':\(\k\|[.-]\)\+\|/>'
|
||||
endif
|
||||
else
|
||||
let tagpat='</\=\(\k\|[.-]\)\+\|/>'
|
||||
endif
|
||||
while (linenum>0)
|
||||
let line=getline(linenum)
|
||||
if first
|
||||
let line=strpart(line,0,lineend)
|
||||
else
|
||||
let lineend=strlen(line)
|
||||
endif
|
||||
let b:lineTagStack=''
|
||||
let mpos=0
|
||||
let b:TagCol=0
|
||||
while (mpos > -1)
|
||||
let mpos=matchend(line,tagpat)
|
||||
if mpos > -1
|
||||
let b:TagCol=b:TagCol+mpos
|
||||
let tag=matchstr(line,tagpat)
|
||||
|
||||
if exists('b:closetag_disable_synID') || startInComment==s:InCommentAt(linenum, b:TagCol)
|
||||
let b:TagLine=linenum
|
||||
call s:Push(matchstr(tag,'[^<>]\+'),'b:lineTagStack')
|
||||
endif
|
||||
let lineend=lineend-mpos
|
||||
let line=strpart(line,mpos,lineend)
|
||||
endif
|
||||
endwhile
|
||||
while (!s:EmptystackP('b:lineTagStack'))
|
||||
let tag=s:Pop('b:lineTagStack')
|
||||
if match(tag, '^/') == 0 "found end tag
|
||||
call s:Push(tag,'b:TagStack')
|
||||
elseif s:EmptystackP('b:TagStack') && !s:Instack(tag, a:unaryTagsStack) "found unclosed tag
|
||||
return tag
|
||||
else
|
||||
let endtag=s:Peekstack('b:TagStack')
|
||||
if endtag == '/'.tag || endtag == '/'
|
||||
call s:Pop('b:TagStack') "found a open/close tag pair
|
||||
elseif !s:Instack(tag, a:unaryTagsStack) "we have a mismatch error
|
||||
return ''
|
||||
endif
|
||||
endif
|
||||
endwhile
|
||||
let linenum=linenum-1 | let first=0
|
||||
endwhile
|
||||
return ''
|
||||
endfunction
|
||||
|
||||
function! s:InComment()
|
||||
return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment\|String'
|
||||
endfunction
|
||||
|
||||
function! s:InCommentAt(line, col)
|
||||
return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment\|String'
|
||||
endfunction
|
||||
|
||||
function! s:SetKeywords()
|
||||
let g:IsKeywordBak=&iskeyword
|
||||
let &iskeyword='33-255'
|
||||
endfunction
|
||||
|
||||
function! s:RestoreKeywords()
|
||||
let &iskeyword=g:IsKeywordBak
|
||||
endfunction
|
||||
|
||||
function! s:Push(el, sname)
|
||||
if !s:EmptystackP(a:sname)
|
||||
exe 'let '.a:sname."=a:el.' '.".a:sname
|
||||
else
|
||||
exe 'let '.a:sname.'=a:el'
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:EmptystackP(sname)
|
||||
exe 'let stack='.a:sname
|
||||
if match(stack,'^ *$') == 0
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Instack(el, sname)
|
||||
exe 'let stack='.a:sname
|
||||
call s:SetKeywords()
|
||||
let m=match(stack, '\<'.a:el.'\>')
|
||||
call s:RestoreKeywords()
|
||||
if m < 0
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
endif
|
||||
endfunction
|
||||
|
||||
function! s:Peekstack(sname)
|
||||
call s:SetKeywords()
|
||||
exe 'let stack='.a:sname
|
||||
let top=matchstr(stack, '\<.\{-1,}\>')
|
||||
call s:RestoreKeywords()
|
||||
return top
|
||||
endfunction
|
||||
|
||||
function! s:Pop(sname)
|
||||
if s:EmptystackP(a:sname)
|
||||
return ''
|
||||
endif
|
||||
exe 'let stack='.a:sname
|
||||
call s:SetKeywords()
|
||||
let loc=matchend(stack,'\<.\{-1,}\>')
|
||||
exe 'let '.a:sname.'=strpart(stack, loc+1, strlen(stack))'
|
||||
let top=strpart(stack, match(stack, '\<'), loc)
|
||||
call s:RestoreKeywords()
|
||||
return top
|
||||
endfunction
|
||||
|
||||
function! s:Clearstack(sname)
|
||||
exe 'let '.a:sname."=''"
|
||||
endfunction
|
||||
278
runtime/autoload/zip.vim
Normal file
278
runtime/autoload/zip.vim
Normal file
@@ -0,0 +1,278 @@
|
||||
" zip.vim: Handles browsing zipfiles
|
||||
" AUTOLOAD PORTION
|
||||
" Date: Mar 22, 2006
|
||||
" Version: 7
|
||||
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
|
||||
" License: Vim License (see vim's :help license)
|
||||
" Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1
|
||||
" Permission is hereby granted to use and distribute this code,
|
||||
" with or without modifications, provided that this copyright
|
||||
" notice is copied with it. Like anything else that's free,
|
||||
" zipPlugin.vim is provided *as is* and comes with no warranty
|
||||
" of any kind, either expressed or implied. 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.
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Initialization: {{{1
|
||||
let s:keepcpo= &cpo
|
||||
set cpo&vim
|
||||
if exists("g:loaded_zip")
|
||||
finish
|
||||
endif
|
||||
|
||||
let g:loaded_zip = "v7"
|
||||
let s:zipfile_escape = ' ?&;\'
|
||||
|
||||
" ----------------
|
||||
" Functions: {{{1
|
||||
" ----------------
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Browse: {{{2
|
||||
fun! zip#Browse(zipfile)
|
||||
" call Dfunc("zip#Browse(zipfile<".a:zipfile.">)")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("unzip")
|
||||
echohl Error | echo "***error*** (zip#Browse) unzip not available on your system"
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse")
|
||||
return
|
||||
endif
|
||||
if !filereadable(a:zipfile)
|
||||
if a:zipfile !~# '^\a\+://'
|
||||
" if its an url, don't complain, let url-handlers such as vim do its thing
|
||||
echohl Error | echo "***error*** (zip#Browse) File not readable<".a:zipfile.">" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
endif
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse : file<".a:zipfile."> not readable")
|
||||
return
|
||||
endif
|
||||
" call Decho("passed sanity checks")
|
||||
if &ma != 1
|
||||
set ma
|
||||
endif
|
||||
let w:zipfile= a:zipfile
|
||||
|
||||
setlocal noswapfile
|
||||
setlocal buftype=nofile
|
||||
setlocal bufhidden=hide
|
||||
setlocal nobuflisted
|
||||
setlocal nowrap
|
||||
set ft=tar
|
||||
|
||||
" give header
|
||||
exe "$put ='".'\"'." zip.vim version ".g:loaded_zip."'"
|
||||
exe "$put ='".'\"'." Browsing zipfile ".a:zipfile."'"
|
||||
exe "$put ='".'\"'." Select a file with cursor and press ENTER"."'"
|
||||
$put =''
|
||||
0d
|
||||
$
|
||||
|
||||
" call Decho("exe silent r! unzip -l '".escape(a:zipfile,s:zipfile_escape)."'")
|
||||
exe "silent r! unzip -l ".escape(a:zipfile,s:zipfile_escape)
|
||||
$d
|
||||
silent 4,$v/^\s\+\d\+\s\{0,5}\d/d
|
||||
silent 4,$s/^\%(.*\)\s\+\(\S\)/\1/
|
||||
|
||||
setlocal noma nomod ro
|
||||
noremap <silent> <buffer> <cr> :call <SID>ZipBrowseSelect()<cr>
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Browse")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" ZipBrowseSelect: {{{2
|
||||
fun! s:ZipBrowseSelect()
|
||||
" call Dfunc("ZipBrowseSelect() zipfile<".w:zipfile."> curfile<".expand("%").">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
let fname= getline(".")
|
||||
|
||||
" sanity check
|
||||
if fname =~ '^"'
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect")
|
||||
return
|
||||
endif
|
||||
if fname =~ '/$'
|
||||
echohl Error | echo "***error*** (zip#Browse) Please specify a file, not a directory" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect")
|
||||
return
|
||||
endif
|
||||
|
||||
" call Decho("fname<".fname.">")
|
||||
|
||||
" get zipfile to the new-window
|
||||
let zipfile= substitute(w:zipfile,'.zip$','','e')
|
||||
let curfile= escape(expand("%"),s:zipfile_escape)
|
||||
" call Decho("zipfile<".zipfile.">")
|
||||
" call Decho("curfile<".curfile.">")
|
||||
|
||||
new
|
||||
wincmd _
|
||||
let s:zipfile_{winnr()}= curfile
|
||||
" call Decho("exe e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname)
|
||||
exe "e zipfile:".escape(zipfile,s:zipfile_escape).':'.fname
|
||||
filetype detect
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("ZipBrowseSelect : s:zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Read: {{{2
|
||||
fun! zip#Read(fname,mode)
|
||||
" call Dfunc("zip#Read(fname<".a:fname.">,mode=".a:mode.")")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):[^\\].*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}:\([^\\].*\)$','\1','')
|
||||
" call Decho("zipfile<".zipfile."> fname<".fname.">")
|
||||
|
||||
" call Decho("exe r! unzip -p '".escape(zipfile,s:zipfile_escape)."' ".fname)
|
||||
exe "r! unzip -p ".escape(zipfile,s:zipfile_escape)." ".fname
|
||||
|
||||
" cleanup
|
||||
0d
|
||||
set nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Read")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" zip#Write: {{{2
|
||||
fun! zip#Write(fname)
|
||||
" call Dfunc("zip#Write(fname<".a:fname.") zipfile_".winnr()."<".s:zipfile_{winnr()}.">")
|
||||
let repkeep= &report
|
||||
set report=10
|
||||
|
||||
" sanity checks
|
||||
if !executable("zip")
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, your system doesn't appear to have the zip pgm" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endif
|
||||
if !exists("*mkdir")
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, mkdir() doesn't work on your system" | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endif
|
||||
|
||||
let curdir= getcwd()
|
||||
let tmpdir= tempname()
|
||||
" call Decho("orig tempname<".tmpdir.">")
|
||||
if tmpdir =~ '\.'
|
||||
let tmpdir= substitute(tmpdir,'\.[^.]*$','','e')
|
||||
endif
|
||||
" call Decho("tmpdir<".tmpdir.">")
|
||||
call mkdir(tmpdir,"p")
|
||||
|
||||
" attempt to change to the indicated directory
|
||||
try
|
||||
exe "cd ".escape(tmpdir,' \')
|
||||
catch /^Vim\%((\a\+)\)\=:E344/
|
||||
echohl Error | echo "***error*** (zip#Write) cannot cd to temporary directory" | Echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
return
|
||||
endtry
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
" place temporary files under .../_ZIPVIM_/
|
||||
if isdirectory("_ZIPVIM_")
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
endif
|
||||
call mkdir("_ZIPVIM_")
|
||||
cd _ZIPVIM_
|
||||
" call Decho("current directory now: ".getcwd())
|
||||
|
||||
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):.*$','\1','')
|
||||
let fname = substitute(a:fname,'zipfile:.\{-}:\(.*\)$','\1','')
|
||||
|
||||
if fname =~ '/'
|
||||
let dirpath = substitute(fname,'/[^/]\+$','','e')
|
||||
if executable("cygpath")
|
||||
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
|
||||
endif
|
||||
call mkdir(dirpath,"p")
|
||||
endif
|
||||
if zipfile !~ '/'
|
||||
let zipfile= curdir.'/'.zipfile
|
||||
endif
|
||||
" call Decho("zipfile<".zipfile."> fname<".fname.">")
|
||||
|
||||
exe "w! ".fname
|
||||
if executable("cygpath")
|
||||
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
|
||||
endif
|
||||
|
||||
" call Decho("zip -u ".zipfile.".zip ".fname)
|
||||
call system("zip -u ".zipfile.".zip ".fname)
|
||||
if v:shell_error != 0
|
||||
echohl Error | echo "***error*** (zip#Write) sorry, unable to update ".zipfile." with ".fname | echohl None
|
||||
call inputsave()|call input("Press <cr> to continue")|call inputrestore()
|
||||
|
||||
elseif s:zipfile_{winnr()} =~ '^\a\+://'
|
||||
" support writing zipfiles across a network
|
||||
let netzipfile= s:zipfile_{winnr()}
|
||||
" call Decho("handle writing <".zipfile.".zip> across network as <".netzipfile.">")
|
||||
1split|enew
|
||||
let binkeep= &binary
|
||||
let eikeep = &ei
|
||||
set binary ei=all
|
||||
exe "e! ".zipfile.".zip"
|
||||
call netrw#NetWrite(netzipfile)
|
||||
let &ei = eikeep
|
||||
let &binary = binkeep
|
||||
q!
|
||||
unlet s:zipfile_{winnr()}
|
||||
endif
|
||||
|
||||
" cleanup and restore current directory
|
||||
cd ..
|
||||
call s:Rmdir("_ZIPVIM_")
|
||||
exe "cd ".escape(curdir,' \')
|
||||
setlocal nomod
|
||||
|
||||
let &report= repkeep
|
||||
" call Dret("zip#Write")
|
||||
endfun
|
||||
|
||||
" ---------------------------------------------------------------------
|
||||
" Rmdir: {{{2
|
||||
fun! s:Rmdir(fname)
|
||||
" call Dfunc("Rmdir(fname<".a:fname.">)")
|
||||
if has("unix")
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
elseif has("win32") || has("win95") || has("win64") || has("win16")
|
||||
if &shell =~? "sh$"
|
||||
call system("/bin/rm -rf ".a:fname)
|
||||
else
|
||||
call system("del /S ".a:fname)
|
||||
endif
|
||||
endif
|
||||
" call Dret("Rmdir")
|
||||
endfun
|
||||
|
||||
" ------------------------------------------------------------------------
|
||||
" Modelines And Restoration: {{{1
|
||||
let &cpo= s:keepcpo
|
||||
unlet s:keepcpo
|
||||
" vim:ts=8 fdm=marker
|
||||
@@ -2,7 +2,7 @@
|
||||
:" information about the environment of a possible bug in Vim.
|
||||
:"
|
||||
:" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
:" Last change: 2001 Feb 02
|
||||
:" Last change: 2005 Jun 12
|
||||
:"
|
||||
:" To use inside Vim:
|
||||
:" :so $VIMRUNTIME/bugreport.vim
|
||||
@@ -49,6 +49,8 @@
|
||||
: call <SID>CheckFile($VIMRUNTIME . "/syntax/synload.vim")
|
||||
: delfun <SID>CheckDir
|
||||
: delfun <SID>CheckFile
|
||||
: echo "--- Scripts sourced ---"
|
||||
: scriptnames
|
||||
:endif
|
||||
:set all
|
||||
:set termcap
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" vim: tw=0 ts=4 sw=4
|
||||
" Vim color file
|
||||
" Maintainer: Ron Aaron <ron@ronware.org>
|
||||
" Last Change: 2003 May 02
|
||||
" Last Change: 2006 Mar 26
|
||||
|
||||
hi clear
|
||||
set background=dark
|
||||
@@ -37,6 +37,12 @@ hi PreProc term=underline ctermfg=darkblue guifg=#ff80ff
|
||||
hi Type term=underline cterm=bold ctermfg=lightgreen gui=bold guifg=#60ff60
|
||||
hi Error term=reverse ctermfg=darkcyan ctermbg=black guifg=Red guibg=Black
|
||||
hi Todo term=standout ctermfg=black ctermbg=darkcyan guifg=Blue guibg=Yellow
|
||||
hi CursorLine term=underline guibg=#555555
|
||||
hi CursorColumn term=underline guibg=#555555
|
||||
hi MatchParen term=reverse guibg=Blue
|
||||
hi TabLine term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guifg=blue guibg=white
|
||||
hi TabLineFill term=bold,reverse cterm=bold ctermfg=lightblue ctermbg=white gui=bold guifg=blue guibg=white
|
||||
hi TabLineSel term=reverse ctermfg=white ctermbg=lightblue guifg=white guibg=blue
|
||||
hi link IncSearch Visual
|
||||
hi link String Constant
|
||||
hi link Character Constant
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
" Vim Compiler File
|
||||
" Compiler: ant
|
||||
" Maintainer: Johannes Zellner <johannes@zellner.org>
|
||||
" Last Change: Tue, 27 Apr 2004 15:01:45 CEST
|
||||
" Last Change: Mi, 13 Apr 2005 22:50:07 CEST
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -21,15 +21,15 @@ CompilerSet makeprg=ant
|
||||
" ant with jikes +E, which assumes the following
|
||||
" two property lines in your 'build.xml':
|
||||
"
|
||||
" <property name = "build.compiler" value = "jikes"/>
|
||||
" <property name = "build.compiler.emacs" value = "true"/>
|
||||
" <property name = "build.compiler" value = "jikes"/>
|
||||
" <property name = "build.compiler.emacs" value = "true"/>
|
||||
"
|
||||
" second line:
|
||||
" ant with javac
|
||||
"
|
||||
" note that this will work also for tasks like [wtkbuild]
|
||||
"
|
||||
setlocal errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
|
||||
CompilerSet errorformat=\ %#[%.%#]\ %#%f:%l:%v:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
|
||||
\%A\ %#[%.%#]\ %f:%l:\ %m,%-Z\ %#[%.%#]\ %p^,%C\ %#[%.%#]\ %#%m
|
||||
|
||||
" ,%-C%.%#
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: BDF to PCF Conversion
|
||||
" Maintainer: Nikolai Weibull <sourc@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/compiler/pcp/bdf/
|
||||
" Latest Revision: 2004-05-22
|
||||
" arch-tag: 2e2f3a55-199b-468c-aa2e-d6b1a7b87806
|
||||
" Compiler: BDF to PCF Conversion
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "bdf"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
@@ -26,5 +20,3 @@ CompilerSet errorformat=%ABDF\ %trror\ on\ line\ %l:\ %m,
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
41
runtime/compiler/eruby.vim
Normal file
41
runtime/compiler/eruby.vim
Normal file
@@ -0,0 +1,41 @@
|
||||
" Vim compiler file
|
||||
" Language: eRuby
|
||||
" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "eruby"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
if exists("eruby_compiler") && eruby_compiler == "eruby"
|
||||
CompilerSet makeprg=eruby
|
||||
else
|
||||
CompilerSet makeprg=erb
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=
|
||||
\eruby:\ %f:%l:%m,
|
||||
\%+E%f:%l:\ parse\ error,
|
||||
\%W%f:%l:\ warning:\ %m,
|
||||
\%E%f:%l:in\ %*[^:]:\ %m,
|
||||
\%E%f:%l:\ %m,
|
||||
\%-C%\tfrom\ %f:%l:in\ %.%#,
|
||||
\%-Z%\tfrom\ %f:%l,
|
||||
\%-Z%p^,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
17
runtime/compiler/fpc.vim
Normal file
17
runtime/compiler/fpc.vim
Normal file
@@ -0,0 +1,17 @@
|
||||
" Vim compiler file
|
||||
" Compiler: FPC 2.1
|
||||
" Maintainer: Jaroslaw Blasiok <jaro3000@o2.pl>
|
||||
" Last Change: 2005 October 07
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "fpc"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" NOTE: compiler must be runned with -vb to write whole source path, not only file
|
||||
" name.
|
||||
CompilerSet errorformat=%f(%l\\,%c)\ %m
|
||||
26
runtime/compiler/gcc.vim
Normal file
26
runtime/compiler/gcc.vim
Normal file
@@ -0,0 +1,26 @@
|
||||
" Vim compiler file
|
||||
" Compiler: GNU C Compiler
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "gcc"
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
setlocal errorformat=
|
||||
\%*[^\"]\"%f\"%*\\D%l:\ %m,
|
||||
\\"%f\"%*\\D%l:\ %m,
|
||||
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\ once,
|
||||
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
|
||||
\%f:%l:\ %m,
|
||||
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
|
||||
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
|
||||
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
|
||||
\%DMaking\ %*\\a\ in\ %f
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
@@ -1,8 +1,8 @@
|
||||
" Vim compiler file
|
||||
" Compiler: HP aCC
|
||||
" Maintainer: Matthias Ulrich <matthias-ulrich@web.de>
|
||||
" URL: http://www.subhome.de/vim/hp_acc.vim
|
||||
" Last Change: 2004 Mar 27
|
||||
" URL: http://www.subhome.de/vim/hp_acc.vim
|
||||
" Last Change: 2005 Nov 19
|
||||
"
|
||||
" aCC --version says: "HP ANSI C++ B3910B A.03.13"
|
||||
" This compiler has been tested on:
|
||||
@@ -10,6 +10,10 @@
|
||||
"
|
||||
" Tim Brown's aCC is: "HP ANSI C++ B3910B A.03.33"
|
||||
" and it also works fine...
|
||||
"
|
||||
" Now suggestions by aCC are supported (compile flag aCC +w).
|
||||
" Thanks to Tim Brown again!!
|
||||
"
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -21,6 +25,7 @@ if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
endif
|
||||
|
||||
CompilerSet errorformat=%A%trror\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m,
|
||||
\%A%tarning\ (suggestion)\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#,
|
||||
\%A%tarning\ %n\:\ \"%f\"\\,\ line\ %l\ \#\ %m\ %#,
|
||||
\%Z\ \ \ \ %p^%.%#,
|
||||
\%-C%.%#
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Miscrosoft Visual C
|
||||
" Maintainer: Bram Moolenaar <Bram@vim.org>
|
||||
" Last Change: 2004 Mar 19
|
||||
" Last Change: 2005 Nov 30
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "msvc"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
" The errorformat for MSVC is the default.
|
||||
CompilerSet errorformat&
|
||||
CompilerSet makeprg=nmake
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
" Vim compiler file
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Maintainer: Nikolai Weibull <source@pcppopper.org>
|
||||
" URL: http://www.pcppopper.org/vim/compiler/pcp/rst/
|
||||
" Latest Revision: 2004-05-22
|
||||
" arch-tag: ac64a95a-5d45-493d-a9f9-f96fc8568657
|
||||
" Compiler: reStructuredText Documentation Format
|
||||
" Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
||||
" Latest Revision: 2005-06-29
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rst"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
@@ -29,5 +23,3 @@ CompilerSet errorformat=
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: set sts=2 sw=2:
|
||||
|
||||
@@ -1,12 +1,16 @@
|
||||
" Vim compiler file
|
||||
" Compiler: Ruby syntax check and/or error reporting
|
||||
" Maintainer: Tim Hammerquist <timmy@cpan.org>
|
||||
" Last Change: Tue Jul 16 00:38:00 PDT 2002
|
||||
" Language: Ruby
|
||||
" Function: Syntax check and/or error reporting
|
||||
" Maintainer: Tim Hammerquist <timh at rubyforge.org>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
"
|
||||
" Changelog:
|
||||
" 0.2: script saves and restores 'cpoptions' value to prevent problems with
|
||||
" line continuations
|
||||
" 0.1: initial release
|
||||
" 0.2: script saves and restores 'cpoptions' value to prevent problems with
|
||||
" line continuations
|
||||
" 0.1: initial release
|
||||
"
|
||||
" Contributors:
|
||||
" Hugh Sasse <hgs@dmu.ac.uk>
|
||||
@@ -22,6 +26,7 @@
|
||||
" This is my first experience with 'errorformat' and compiler plugins and
|
||||
" I welcome any input from more experienced (or clearer-thinking)
|
||||
" individuals.
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
@@ -59,4 +64,4 @@ CompilerSet errorformat=
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: ft=vim
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
|
||||
35
runtime/compiler/rubyunit.vim
Normal file
35
runtime/compiler/rubyunit.vim
Normal file
@@ -0,0 +1,35 @@
|
||||
" Vim compiler file
|
||||
" Language: Test::Unit - Ruby Unit Testing Framework
|
||||
" Maintainer: Doug Kearns <djkea2 at gus.gscit.monash.edu.au>
|
||||
" Info: $Id$
|
||||
" URL: http://vim-ruby.rubyforge.org
|
||||
" Anon CVS: See above site
|
||||
" ----------------------------------------------------------------------------
|
||||
|
||||
if exists("current_compiler")
|
||||
finish
|
||||
endif
|
||||
let current_compiler = "rubyunit"
|
||||
|
||||
if exists(":CompilerSet") != 2 " older Vim always used :setlocal
|
||||
command -nargs=* CompilerSet setlocal <args>
|
||||
endif
|
||||
|
||||
let s:cpo_save = &cpo
|
||||
set cpo-=C
|
||||
|
||||
CompilerSet makeprg=testrb
|
||||
|
||||
CompilerSet errorformat=\%W\ %\\+%\\d%\\+)\ Failure:,
|
||||
\%C%m\ [%f:%l]:,
|
||||
\%E\ %\\+%\\d%\\+)\ Error:,
|
||||
\%C%m:,
|
||||
\%C\ \ \ \ %f:%l:%.%#,
|
||||
\%C%m,
|
||||
\%Z\ %#,
|
||||
\%-G%.%#
|
||||
|
||||
let &cpo = s:cpo_save
|
||||
unlet s:cpo_save
|
||||
|
||||
" vim: nowrap sw=2 sts=2 ts=8 ff=unix:
|
||||
@@ -2,7 +2,7 @@
|
||||
" Compiler: splint/lclint (C source code checker)
|
||||
" Maintainer: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
|
||||
" Splint Home: http://www.splint.org/
|
||||
" Last Change: 2004 Oct 02
|
||||
" Last Change: 2005 Apr 21
|
||||
" $Revision$
|
||||
|
||||
if exists("current_compiler")
|
||||
@@ -53,6 +53,7 @@ CompilerSet makeprg=splint\ %
|
||||
|
||||
CompilerSet errorformat=%OLCLint*m,
|
||||
\%OSplint*m,
|
||||
\%f(%l\\,%c):\ %m,
|
||||
\%*[\ ]%f:%l:%c:\ %m,
|
||||
\%*[\ ]%f:%l:\ %m,
|
||||
\%*[^\"]\"%f\"%*\\D%l:\ %m,
|
||||
|
||||
@@ -19,6 +19,7 @@ DOCS = \
|
||||
change.txt \
|
||||
cmdline.txt \
|
||||
debugger.txt \
|
||||
debug.txt \
|
||||
develop.txt \
|
||||
diff.txt \
|
||||
digraph.txt \
|
||||
@@ -27,6 +28,7 @@ DOCS = \
|
||||
farsi.txt \
|
||||
filetype.txt \
|
||||
fold.txt \
|
||||
getscript.txt \
|
||||
gui.txt \
|
||||
gui_w16.txt \
|
||||
gui_w32.txt \
|
||||
@@ -70,7 +72,10 @@ DOCS = \
|
||||
pattern.txt \
|
||||
pi_gzip.txt \
|
||||
pi_netrw.txt \
|
||||
pi_paren.txt \
|
||||
pi_spec.txt \
|
||||
pi_tar.txt \
|
||||
pi_zip.txt \
|
||||
print.txt \
|
||||
quickfix.txt \
|
||||
quickref.txt \
|
||||
@@ -85,7 +90,9 @@ DOCS = \
|
||||
sponsor.txt \
|
||||
starting.txt \
|
||||
spell.txt \
|
||||
sql.txt \
|
||||
syntax.txt \
|
||||
tabpage.txt \
|
||||
tagsrch.txt \
|
||||
term.txt \
|
||||
tips.txt \
|
||||
@@ -116,6 +123,7 @@ DOCS = \
|
||||
usr_29.txt \
|
||||
usr_30.txt \
|
||||
usr_31.txt \
|
||||
usr_32.txt \
|
||||
usr_40.txt \
|
||||
usr_41.txt \
|
||||
usr_42.txt \
|
||||
@@ -130,6 +138,7 @@ DOCS = \
|
||||
version6.txt \
|
||||
version7.txt \
|
||||
vi_diff.txt \
|
||||
vimball.txt \
|
||||
visual.txt \
|
||||
windows.txt \
|
||||
workshop.txt
|
||||
@@ -139,6 +148,7 @@ HTMLS = \
|
||||
autocmd.html \
|
||||
change.html \
|
||||
cmdline.html \
|
||||
debug.html \
|
||||
debugger.html \
|
||||
develop.html \
|
||||
diff.html \
|
||||
@@ -148,13 +158,13 @@ HTMLS = \
|
||||
farsi.html \
|
||||
filetype.html \
|
||||
fold.html \
|
||||
getscript.html \
|
||||
gui.html \
|
||||
gui_w16.html \
|
||||
gui_w32.html \
|
||||
gui_x11.html \
|
||||
hangulin.html \
|
||||
hebrew.html \
|
||||
help.html \
|
||||
howto.html \
|
||||
if_cscop.html \
|
||||
if_mzsch.html \
|
||||
@@ -166,6 +176,7 @@ HTMLS = \
|
||||
if_tcl.html \
|
||||
indent.html \
|
||||
index.html \
|
||||
vimindex.html \
|
||||
insert.html \
|
||||
intro.html \
|
||||
map.html \
|
||||
@@ -191,6 +202,7 @@ HTMLS = \
|
||||
pattern.html \
|
||||
pi_gzip.html \
|
||||
pi_netrw.html \
|
||||
pi_paren.html \
|
||||
pi_spec.html \
|
||||
print.html \
|
||||
quickfix.html \
|
||||
@@ -206,7 +218,9 @@ HTMLS = \
|
||||
sponsor.html \
|
||||
starting.html \
|
||||
spell.html \
|
||||
sql.html \
|
||||
syntax.html \
|
||||
tabpage.html \
|
||||
tagsrch.html \
|
||||
tags.html \
|
||||
term.html \
|
||||
@@ -238,6 +252,7 @@ HTMLS = \
|
||||
usr_29.html \
|
||||
usr_30.html \
|
||||
usr_31.html \
|
||||
usr_32.html \
|
||||
usr_40.html \
|
||||
usr_41.html \
|
||||
usr_42.html \
|
||||
@@ -252,11 +267,17 @@ HTMLS = \
|
||||
version6.html \
|
||||
version7.html \
|
||||
vi_diff.html \
|
||||
vimball.txt \
|
||||
visual.html \
|
||||
windows.html \
|
||||
workshop.html
|
||||
|
||||
CONVERTED = \
|
||||
vim-fr.UTF-8.1 \
|
||||
evim-fr.UTF-8.1 \
|
||||
vimdiff-fr.UTF-8.1 \
|
||||
vimtutor-fr.UTF-8.1 \
|
||||
xxd-fr.UTF-8.1 \
|
||||
vim-it.UTF-8.1 \
|
||||
evim-it.UTF-8.1 \
|
||||
vimdiff-it.UTF-8.1 \
|
||||
@@ -312,6 +333,14 @@ noerrors:
|
||||
.txt.html:
|
||||
$(AWK) -f makehtml.awk $< >$@
|
||||
|
||||
# index.html is the starting point for HTML, but for the help files it is
|
||||
# help.txt. Therefore use vimindex.html for index.txt.
|
||||
index.html: help.txt
|
||||
$(AWK) -f makehtml.awk help.txt >index.html
|
||||
|
||||
vimindex.html: index.txt
|
||||
$(AWK) -f makehtml.awk index.txt >vimindex.html
|
||||
|
||||
tags.ref tags.html: tags
|
||||
$(AWK) -f maketags.awk tags >tags.html
|
||||
|
||||
@@ -380,32 +409,48 @@ os_risc.txt:
|
||||
os_win32.txt:
|
||||
touch os_win32.txt
|
||||
|
||||
# Note that $< works with GNU make while $> works for BSD make.
|
||||
vim-fr.UTF-8.1: vim-fr.1
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
evim-fr.UTF-8.1: evim-fr.1
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vimdiff-fr.UTF-8.1: vimdiff-fr.1
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vimtutor-fr.UTF-8.1: vimtutor-fr.1
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
xxd-fr.UTF-8.1: xxd-fr.1
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vim-it.UTF-8.1: vim-it.1
|
||||
iconv -f latin1 -t utf-8 $> >$@
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
evim-it.UTF-8.1: evim-it.1
|
||||
iconv -f latin1 -t utf-8 $> >$@
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vimdiff-it.UTF-8.1: vimdiff-it.1
|
||||
iconv -f latin1 -t utf-8 $> >$@
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vimtutor-it.UTF-8.1: vimtutor-it.1
|
||||
iconv -f latin1 -t utf-8 $> >$@
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
xxd-it.UTF-8.1: xxd-it.1
|
||||
iconv -f latin1 -t utf-8 $> >$@
|
||||
iconv -f latin1 -t utf-8 $< >$@
|
||||
|
||||
vim-ru.UTF-8.1: vim-ru.1
|
||||
iconv -f KOI8-R -t utf-8 $> >$@
|
||||
iconv -f KOI8-R -t utf-8 $< >$@
|
||||
|
||||
evim-ru.UTF-8.1: evim-ru.1
|
||||
iconv -f KOI8-R -t utf-8 $> >$@
|
||||
iconv -f KOI8-R -t utf-8 $< >$@
|
||||
|
||||
vimdiff-ru.UTF-8.1: vimdiff-ru.1
|
||||
iconv -f KOI8-R -t utf-8 $> >$@
|
||||
iconv -f KOI8-R -t utf-8 $< >$@
|
||||
|
||||
vimtutor-ru.UTF-8.1: vimtutor-ru.1
|
||||
iconv -f KOI8-R -t utf-8 $> >$@
|
||||
iconv -f KOI8-R -t utf-8 $< >$@
|
||||
|
||||
xxd-ru.UTF-8.1: xxd-ru.1
|
||||
iconv -f KOI8-R -t utf-8 $> >$@
|
||||
iconv -f KOI8-R -t utf-8 $< >$@
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*arabic.txt* For Vim version 7.0aa. Last change: 2004 Jun 09
|
||||
*arabic.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Nadim Shaikli
|
||||
@@ -24,7 +24,7 @@ Introduction
|
||||
------------
|
||||
Arabic is a rather demanding language in which a number of special
|
||||
features are required. Characters are right-to-left oriented and
|
||||
ought to appear as such on the screen (ie. from right to left).
|
||||
ought to appear as such on the screen (i.e. from right to left).
|
||||
Arabic also requires shaping of its characters, meaning the same
|
||||
character has a different visual form based on its relative location
|
||||
within a word (initial, medial, final or stand-alone). Arabic also
|
||||
@@ -60,7 +60,7 @@ o Changing keyboard mapping and reverse insert modes using a single
|
||||
|
||||
o Toggling complete Arabic support via a single command.
|
||||
|
||||
o While in Arabic mode, numbers are entered from left to right. Upon
|
||||
o While in Arabic mode, numbers are entered from left to right. Upon
|
||||
entering a none number character, that character will be inserted
|
||||
just into the left of the last number.
|
||||
|
||||
@@ -101,14 +101,14 @@ need to be accounted for and invoked.
|
||||
|
||||
o Setting the Arabic fonts
|
||||
|
||||
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||
by entering the following command in the VIM window.
|
||||
>
|
||||
:set guifont=your_ARABIC_FONT
|
||||
<
|
||||
NOTE: the string 'your_ARABIC_FONT' is used to denote a complete
|
||||
font name akin to that used in linux/unix system.
|
||||
(eg. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1)
|
||||
font name akin to that used in Linux/Unix systems.
|
||||
(e.g. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1)
|
||||
|
||||
You can append the 'guifont' set command to your .vimrc file
|
||||
in order to get the same above noted results. In other words,
|
||||
@@ -179,11 +179,11 @@ o Enable Arabic settings [short-cut]
|
||||
|
||||
If, on the other hand, you'd like to be verbose and explicit and
|
||||
are opting not to use the 'arabic' short-cut command, here's what
|
||||
is needed (ie. if you use ':set arabic' you can skip this section) -
|
||||
is needed (i.e. if you use ':set arabic' you can skip this section) -
|
||||
|
||||
+ Arabic Keymapping Activation
|
||||
|
||||
To activate the Arabic keymap (ie. to remap your English/Latin
|
||||
To activate the Arabic keymap (i.e. to remap your English/Latin
|
||||
keyboard to look-n-feel like a standard Arabic one), set the
|
||||
'keymap' command to "arabic". This is done by entering
|
||||
>
|
||||
@@ -197,14 +197,14 @@ o Enable Arabic settings [short-cut]
|
||||
default mapping (English), it is advised that users use the 'CTRL-^'
|
||||
key press while in insert (or add/replace) mode. The command-line
|
||||
will display your current mapping by displaying an "Arabic" string
|
||||
next to your insertion mode (eg. -- INSERT Arabic --) indicating
|
||||
next to your insertion mode (e.g. -- INSERT Arabic --) indicating
|
||||
your current keymap.
|
||||
|
||||
+ Arabic deletion of a combined pair character
|
||||
|
||||
By default VIM has the 'delcombine' option disabled. This option
|
||||
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
|
||||
and still retain the LAM (ie. it reverts to treating the combined
|
||||
and still retain the LAM (i.e. it reverts to treating the combined
|
||||
character as its natural two characters form -- this also pertains
|
||||
to harakat and their combined forms). You can enable this option
|
||||
by entering
|
||||
@@ -227,7 +227,7 @@ o Enable Arabic settings [short-cut]
|
||||
- While in Left-to-right mode, enter ':set rl' in the command line
|
||||
('rl' is the abbreviation for rightleft).
|
||||
|
||||
- Put the ':set rl' line in your '.vimrc' file to start the VIM in
|
||||
- Put the ':set rl' line in your '.vimrc' file to start Vim in
|
||||
right-to-left mode permanently.
|
||||
|
||||
+ Arabic right-to-left command-line Mode
|
||||
@@ -295,7 +295,7 @@ Restrictions
|
||||
------------
|
||||
|
||||
o VIM in its GUI form does not currently support Bi-directionality
|
||||
(ie. the ability to see both Arabic and Latin intermixed within
|
||||
(i.e. the ability to see both Arabic and Latin intermixed within
|
||||
the same line).
|
||||
|
||||
|
||||
@@ -304,7 +304,7 @@ Known Bugs
|
||||
|
||||
There is one known minor bug,
|
||||
|
||||
1. If you insert a haraka (eg. Fatha (U+064E)) after a LAM (U+0644)
|
||||
1. If you insert a haraka (e.g. Fatha (U+064E)) after a LAM (U+0644)
|
||||
and then insert an ALEF (U+0627), the appropriate combining will
|
||||
not happen due to the sandwiched haraka resulting in something
|
||||
that will NOT be displayed correctly.
|
||||
@@ -320,4 +320,3 @@ There is one known minor bug,
|
||||
No other bugs are known to exist.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*autocmd.txt* For Vim version 7.0aa. Last change: 2005 Mar 04
|
||||
*autocmd.txt* For Vim version 7.0b. Last change: 2006 Mar 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -18,6 +18,7 @@ For a basic explanation, see section |40.3| in the user manual.
|
||||
8. Groups |autocmd-groups|
|
||||
9. Executing autocommands |autocmd-execute|
|
||||
10. Using autocommands |autocmd-use|
|
||||
11. Disabling autocommands |autocmd-disable|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
{only when the |+autocmd| feature has not been disabled at compile time}
|
||||
@@ -155,21 +156,221 @@ argument behavior differs from that for defining and removing autocommands.
|
||||
In order to list buffer-local autocommands, use a pattern in the form <buffer>
|
||||
or <buffer=N>. See |autocmd-buflocal|.
|
||||
|
||||
*:autocmd-verbose*
|
||||
When 'verbose' is non-zero, listing an autocommand will also display where it
|
||||
was last defined. Example: >
|
||||
|
||||
:verbose autocmd BufEnter
|
||||
FileExplorer BufEnter
|
||||
* call s:LocalBrowse(expand("<amatch>"))
|
||||
Last set from /usr/share/vim/vim-7.0/plugin/NetrwPlugin.vim
|
||||
<
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
==============================================================================
|
||||
5. Events *autocmd-events* *E215* *E216*
|
||||
|
||||
You can specify a comma-separated list of event names. No white space can be
|
||||
used in this list. The command applies to all the events in the list.
|
||||
|
||||
For READING FILES there are four kinds of events possible:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
Vim uses only one of these four kinds when reading a file. The "Pre" and
|
||||
"Post" events are both triggered, before and after reading the file.
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
*autocommand-events* *{event}*
|
||||
Vim recognizes the following events. Vim ignores the case of event names
|
||||
(e.g., you can use "BUFread" or "bufread" instead of "BufRead").
|
||||
|
||||
First an overview by function with a short explanation. Then the list
|
||||
alpabetically with full explanations |autocmd-events-abc|.
|
||||
|
||||
Name triggered by ~
|
||||
|
||||
Reading
|
||||
|BufNewFile| starting to edit a file that doesn't exist
|
||||
|BufReadPre| starting to edit a new buffer, before reading the file
|
||||
|BufRead| starting to edit a new buffer, after reading the file
|
||||
|BufReadPost| starting to edit a new buffer, after reading the file
|
||||
|BufReadCmd| before starting to edit a new buffer |Cmd-event|
|
||||
|
||||
|FileReadPre| before reading a file with a ":read" command
|
||||
|FileReadPost| after reading a file with a ":read" command
|
||||
|FileReadCmd| before reading a file with a ":read" comman |Cmd-event|
|
||||
|
||||
|FilterReadPre| before reading a file from a filter command
|
||||
|FilterReadPost| after reading a file from a filter command
|
||||
|
||||
|StdinReadPre| before reading from stdin into the buffer
|
||||
|StdinReadPost| After reading from the stdin into the buffer
|
||||
|
||||
Writing
|
||||
|BufWrite| starting to write the whole buffer to a file
|
||||
|BufWritePre| starting to write the whole buffer to a file
|
||||
|BufWritePost| after writing the whole buffer to a file
|
||||
|BufWriteCmd| before writing the whole buffer to a file |Cmd-event|
|
||||
|
||||
|FileWritePre| starting to write part of a buffer to a file
|
||||
|FileWritePost| after writing part of a buffer to a file
|
||||
|FileWriteCmd| before writing part of a buffer to a file |Cmd-event|
|
||||
|
||||
|FileAppendPre| starting to append to a file
|
||||
|FileAppendPost| after appending to a file
|
||||
|FileAppendCmd| before appending to a file |Cmd-event|
|
||||
|
||||
|FilterWritePre| starting to write a file for a filter command or diff
|
||||
|FilterWritePost| after writing a file for a filter command or diff
|
||||
|
||||
Buffers
|
||||
|BufAdd| just after adding a buffer to the buffer list
|
||||
|BufCreate| just after adding a buffer to the buffer list
|
||||
|BufDelete| before deleting a buffer from the buffer list
|
||||
|BufWipeout| before completely deleting a buffer
|
||||
|
||||
|BufFilePre| before changing the name of the current buffer
|
||||
|BufFilePost| after changing the name of the current buffer
|
||||
|
||||
|BufEnter| after entering a buffer
|
||||
|BufLeave| before leaving to another buffer
|
||||
|BufWinEnter| after a buffer is displayed in a window
|
||||
|BufWinLeave| before a buffer is removed from a window
|
||||
|
||||
|BufUnload| before unloading a buffer
|
||||
|BufHidden| just after a buffer has become hidden
|
||||
|BufNew| just after creating a new buffer
|
||||
|
||||
|SwapExists| detected an existing swap file
|
||||
|
||||
Options
|
||||
|FileType| when the 'filetype' option has been set
|
||||
|Syntax| when the 'syntax' option has been set
|
||||
|EncodingChanged| after the 'encoding' option has been changed
|
||||
|TermChanged| after the value of 'term' has changed
|
||||
|
||||
Startup and exit
|
||||
|VimEnter| after doing all the startup stuff
|
||||
|GUIEnter| after starting the GUI successfully
|
||||
|TermResponse| after the termainal response to |t_RV| is received
|
||||
|
||||
|VimLeavePre| before exiting Vim, before writing the viminfo file
|
||||
|VimLeave| before exiting Vim, after writing the viminfo file
|
||||
|
||||
Various
|
||||
|FileChangedShell| Vim notices that a file changed since editing started
|
||||
|FileChangedShellPost| After handling a file changed since editing started
|
||||
|FileChangedRO| before making the first change to a read-only file
|
||||
|
||||
|ShellCmdPost| after executing a shell command
|
||||
|ShellFilterPost| after filtering with a shell command
|
||||
|
||||
|FuncUndefined| a user function is used but it isn't defined
|
||||
|SpellFileMissing| a spell file is used but it can't be found
|
||||
|SourcePre| before sourcing a Vim script
|
||||
|
||||
|VimResized| after the Vim window size changed
|
||||
|FocusGained| Vim got input focus
|
||||
|FocusLost| Vim lost input focus
|
||||
|CursorHold| the user doesn't press a key for a while
|
||||
|CursorHoldI| the user doesn't press a key for a while in Insert mode
|
||||
|CursorMoved| the cursor was moved in Normal mode
|
||||
|CursorMovedI| the cursor was moved in Insert mode
|
||||
|
||||
|WinEnter| after entering another window
|
||||
|WinLeave| before leaving a window
|
||||
|TabEnter| after entering another tab page
|
||||
|TabLeave| before leaving a tab page
|
||||
|CmdwinEnter| after entering the command-line window
|
||||
|CmdwinLeave| before leaving the command-line window
|
||||
|
||||
|InsertEnter| starting Insert mode
|
||||
|InsertChange| when typing <Insert> while in Insert or Replace mode
|
||||
|InsertLeave| when leaving Insert mode
|
||||
|
||||
|ColorScheme| after loading a color scheme
|
||||
|
||||
|RemoteReply| a reply from a server Vim was received
|
||||
|
||||
|QuickFixCmdPre| before a quickfix command is run
|
||||
|QuickFixCmdPost| after a quickfix command is run
|
||||
|
||||
|SessionLoadPost| after loading a session file
|
||||
|
||||
|MenuPopup| just before showing the popup menu
|
||||
|
||||
|User| to be used in combination with ":doautocmd"
|
||||
|
||||
|
||||
The alphabetical list of autocommand events: *autocmd-events-abc*
|
||||
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufNewFile*
|
||||
BufNewFile When starting to edit a file that doesn't
|
||||
exist. Can be used to read in a skeleton
|
||||
file.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufRead* *BufReadPost*
|
||||
BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
reading the file into the buffer, before
|
||||
@@ -182,60 +383,46 @@ BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
*BufReadCmd*
|
||||
BufReadCmd Before starting to edit a new buffer. Should
|
||||
read the file into the buffer. |Cmd-event|
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWrite* *BufWritePre*
|
||||
BufWrite or BufWritePre Before writing the whole buffer to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*BufWriteCmd*
|
||||
BufWriteCmd Before writing the whole buffer to a file.
|
||||
Should do the writing of the file and reset
|
||||
@@ -243,42 +430,86 @@ BufWriteCmd Before writing the whole buffer to a file.
|
||||
'cpo' and writing to another file |cpo-+|.
|
||||
The buffer contents should not be changed.
|
||||
|Cmd-event|
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer. Use the '[ and '] marks for the
|
||||
range of lines.
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer. Use the
|
||||
'[ and '] marks for the range of lines.
|
||||
|Cmd-event|
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file. Use the '[ and ']
|
||||
marks for the range of lines.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*ColorScheme*
|
||||
ColorScheme After loading a color scheme. |:colorscheme|
|
||||
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
This event is only triggered in Normal mode.
|
||||
While recording the CursorHold event is not
|
||||
triggered. |q|
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*CursorHoldI*
|
||||
CursorHoldI Just like CursorHold, but in Insert mode.
|
||||
|
||||
*CursorMoved*
|
||||
CursorMoved After the cursor was moved in Normal mode.
|
||||
Also when the text of the cursor line has been
|
||||
changed, e.g., with "x", "rx" or "p".
|
||||
Not triggered when there is typeahead or when
|
||||
an operator is pending.
|
||||
For an example see |match-parens|.
|
||||
Careful: Don't do anything that the user does
|
||||
not expect or that is slow.
|
||||
*CursorMovedI*
|
||||
CursorMovedI After the cursor was moved in Insert mode.
|
||||
Otherwise the same as CursorMoved.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off after the 'encoding' option has been
|
||||
changed. Useful to set up fonts, for example.
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. Use the '[ and ']
|
||||
marks for the range of lines.|Cmd-event|
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file. Use the '[ and ']
|
||||
marks for the range of lines.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
This event is triggered when making the first
|
||||
change in a buffer or the first change after
|
||||
'readonly' was set,
|
||||
just before the change is applied to the text.
|
||||
WARNING: If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FileChangedShell*
|
||||
FileChangedShell When Vim notices that the modification time of
|
||||
a file has changed since editing started.
|
||||
@@ -308,15 +539,67 @@ FileChangedShell When Vim notices that the modification time of
|
||||
commands for the FileChangedShell event no
|
||||
other FileChangedShell event will be
|
||||
triggered.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
WARNING: This event is triggered when making a
|
||||
change, just before the change is applied to
|
||||
the text. If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FileChangedShellPost*
|
||||
FileChangedShellPost After handling a file that was changed outside
|
||||
of Vim. Can be used to update the statusline.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer. Use the
|
||||
'[ and '] marks for the range of lines.
|
||||
|Cmd-event|
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer. Use the '[ and '] marks for the
|
||||
range of lines.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
Not triggered when 'shelltemp' is off.
|
||||
*FocusGained*
|
||||
FocusGained When Vim got input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
@@ -332,104 +615,164 @@ FuncUndefined When a user function is used but it isn't
|
||||
when it's used. Both <amatch> and <afile> are
|
||||
set to the name of the function.
|
||||
See |autoload-functions|.
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
This event is only triggered in Normal mode.
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *InsertChange*
|
||||
InsertChange When typing <Insert> while in Insert or
|
||||
Replace mode. The |v:insertmode| variable
|
||||
indicates the new mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertEnter*
|
||||
InsertEnter When starting Insert mode. Also for Replace
|
||||
mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
*MenuPopup*
|
||||
MenuPopup Just before showing the popup menu (under the
|
||||
right mouse button). Useful for adjusting the
|
||||
menu for what is under the cursor or mouse
|
||||
pointer.
|
||||
The pattern is matched against a single
|
||||
character representing the mode:
|
||||
n Normal
|
||||
v Visual
|
||||
o Operator-pending
|
||||
i Insert
|
||||
c Commmand line
|
||||
*QuickFixCmdPre*
|
||||
QuickFixCmdPre Before a quickfix command is run (|:make|,
|
||||
|:lmake|, |:grep|, |:lgrep|, |:grepadd|,
|
||||
|:lgrepadd|, |:vimgrep|, |:lvimgrep|,
|
||||
|:vimgrepadd|, |:vimgrepadd|). The pattern is
|
||||
matched against the command being run. When
|
||||
|:grep| is used but 'grepprg' is set to
|
||||
"internal" it still matches "grep".
|
||||
This command cannot be used to set the
|
||||
'makeprg' and 'grepprg' variables.
|
||||
If this command causes an error, the quickfix
|
||||
command is not executed.
|
||||
*QuickFixCmdPost*
|
||||
QuickFixCmdPost Like QuickFixCmdPre, but after a quickfix
|
||||
command is run.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an autocommand is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*SessionLoadPost*
|
||||
SessionLoadPost After loading the session file created using
|
||||
the |:mksession| command.
|
||||
*ShellCmdPost*
|
||||
ShellCmdPost After executing a shell command with |:!cmd|,
|
||||
|:shell|, |:make| and |:grep|. Can be used to
|
||||
check for any changed files.
|
||||
*ShellFilterPost*
|
||||
ShellFilterPost After executing a shell command with
|
||||
":{range}!cmd", ":w !cmd" or ":r !cmd".
|
||||
Can be used to check for any changed files.
|
||||
*SourcePre*
|
||||
SourcePre Before sourcing a Vim script. |:source|
|
||||
*SpellFileMissing*
|
||||
SpellFileMissing When trying to load a spell checking file and
|
||||
it can't be found. <amatch> is the language,
|
||||
'encoding' also matters. See
|
||||
|spell-SpellFileMissing|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*SwapExists*
|
||||
SwapExists Detected an existing swap file when starting
|
||||
to edit a file. Only when it is possible to
|
||||
select a way to handle the situation, when Vim
|
||||
would ask the user what to do.
|
||||
The |v:swapname| variable holds the name of
|
||||
the swap file found, <afile> the file being
|
||||
edited. |v:swapcommand| may contain a command
|
||||
to be executed in the opened file.
|
||||
The commands should set the |v:swapchoice|
|
||||
variable to a string with one character to
|
||||
tell Vim what should be done next:
|
||||
'o' open read-only
|
||||
'e' edit the file anyway
|
||||
'r' recover
|
||||
'd' delete the swap file
|
||||
'q' quit, don't edit the file
|
||||
'a' abort, like hitting CTRL-C
|
||||
When set to an empty string the user will be
|
||||
asked, as if there was no SwapExists autocmd.
|
||||
Note: Do not try to change the buffer, the
|
||||
results are unpredictable.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*TabEnter*
|
||||
TabEnter Just after entering a tab page. |tab-page|
|
||||
Before triggering the WinEnter and BufEnter
|
||||
events.
|
||||
*TabLeave*
|
||||
TabLeave Just before leaving a tab page. |tab-page|
|
||||
A WinLeave event will have been triggered
|
||||
first.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*VimResized*
|
||||
VimResized After the Vim window was resized, thus 'lines'
|
||||
and/or 'columns' changed. Not when starting
|
||||
up though.
|
||||
*WinEnter*
|
||||
WinEnter After entering another window. Not done for
|
||||
the first window, when Vim has just started.
|
||||
@@ -446,130 +789,6 @@ WinLeave Before leaving a window. If the window to be
|
||||
executes the BufLeave autocommands before the
|
||||
WinLeave autocommands (but not for ":new").
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off when the 'encoding' option is
|
||||
changed. Useful to set up fonts, for example.
|
||||
*InsertEnter*
|
||||
InsertEnter When starting Insert mode. Also for Replace
|
||||
mode and Virtual Replace mode. The
|
||||
|v:insertmode| variable indicates the mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertChange*
|
||||
InsertChange When typing <Insert> while in Insert or
|
||||
Replace mode. The |v:insertmode| variable
|
||||
indicates the new mode.
|
||||
Be careful not to move the cursor or do
|
||||
anything else that the user does not expect.
|
||||
*InsertLeave*
|
||||
InsertLeave When leaving Insert mode. Also when using
|
||||
CTRL-O |i_CTRL-O|. But not for |i_CTRL-C|.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*ColorScheme*
|
||||
ColorScheme After loading a color scheme. |:colorscheme|
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an autocommand is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
QuickFixCmdPre *QuickFixCmdPre*
|
||||
Before a quickfix command is run (|:make|,
|
||||
|:grep|, |:grepadd|, |:vimgrep|,
|
||||
|:vimgrepadd|). The pattern is matched against
|
||||
the command being run. When |:grep| is used
|
||||
but 'grepprg' is set to "internal" it still
|
||||
matches "grep".
|
||||
This command cannot be used to set the
|
||||
'makeprg' and 'grepprg' variables.
|
||||
If this command causes an error, the quickfix
|
||||
command is not executed.
|
||||
QuickFixCmdPost *QuickFixCmdPost*
|
||||
like QuickFixCmdPre, but after a quickfix
|
||||
command is run.
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
|
||||
You can specify a comma-separated list of event names. No white space can be
|
||||
used in this list. The command applies to all the events in the list.
|
||||
|
||||
For READING FILES there are four kinds of events possible:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
Vim uses only one of these four kinds when reading a file. The "Pre" and
|
||||
"Post" events are both triggered, before and after reading the file.
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
|
||||
==============================================================================
|
||||
6. Patterns *autocmd-patterns* *{pat}*
|
||||
@@ -787,6 +1006,10 @@ option will not cause any commands to be executed.
|
||||
autocommands for that group. Note: if you use an
|
||||
undefined group name, Vim gives you an error message.
|
||||
|
||||
After applying the autocommands the modelines are
|
||||
processed, so that their overrule the settings from
|
||||
autocommands, like what happens when editing a file.
|
||||
|
||||
*:doautoa* *:doautoall*
|
||||
:doautoa[ll] [group] {event} [fname]
|
||||
Like ":doautocmd", but apply the autocommands to each
|
||||
@@ -893,10 +1116,8 @@ It's possible to use the ":au" command in an autocommand. This can be a
|
||||
self-modifying command! This can be useful for an autocommand that should
|
||||
execute only once.
|
||||
|
||||
There is currently no way to disable the autocommands. If you want to write a
|
||||
file without executing the autocommands for that type of file, write it under
|
||||
another name and rename it with a shell command. In some situations you can
|
||||
use the 'eventignore' option.
|
||||
If you want to skip autocommands for one command, use the |:noautocmd| command
|
||||
modifier or the 'eventignore' option.
|
||||
|
||||
Note: When reading a file (with ":read file" or with a filter command) and the
|
||||
last line in the file does not have an <EOL>, Vim remembers this. At the next
|
||||
@@ -1013,5 +1234,22 @@ The |v:cmdbang| variable is one when "!" was used, zero otherwise.
|
||||
|
||||
See the $VIMRUNTIME/plugin/netrw.vim for examples.
|
||||
|
||||
==============================================================================
|
||||
11. Disabling autocommands *autocmd-disable*
|
||||
|
||||
To disable autocommands for some time use the 'eventignore' option. Note that
|
||||
this may cause unexpected behavior, make sure you restore 'eventignore'
|
||||
afterwards, using a |:try| block with |:finally|.
|
||||
|
||||
*:noautocmd* *:noa*
|
||||
To disable autocommands for just one command use the ":noautocmd" command
|
||||
modifier. This will set 'eventignore' to "all" for the duration of the
|
||||
following command. Example: >
|
||||
|
||||
:noautocmd w fname.gz
|
||||
|
||||
This will write the file without triggering the autocommands defined by the
|
||||
gzip plugin.
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*change.txt* For Vim version 7.0aa. Last change: 2005 Mar 16
|
||||
*change.txt* For Vim version 7.0b. Last change: 2006 Mar 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -19,6 +19,7 @@ commands with the "." command.
|
||||
4.4 Changing tabs |change-tabs|
|
||||
5. Copying and moving text |copy-move|
|
||||
6. Formatting text |formatting|
|
||||
7. Sorting text |sorting|
|
||||
|
||||
For inserting text see |insert.txt|.
|
||||
|
||||
@@ -502,6 +503,8 @@ comment (starting with '"') after the ":!" command.
|
||||
temporary file and then reads the file into the
|
||||
buffer. Vim uses the 'shellredir' option to redirect
|
||||
the filter output to the temporary file.
|
||||
However, if the 'shelltemp' option is off then pipes
|
||||
are used when possible (on Unix).
|
||||
When the 'R' flag is included in 'cpoptions' marks in
|
||||
the filtered lines are deleted, unless the
|
||||
|:keepmarks| command is used. Example: >
|
||||
@@ -681,8 +684,8 @@ For the definition of a pattern, see |pattern|.
|
||||
|
||||
*sub-replace-special* *:s\=*
|
||||
When the {string} starts with "\=" it is evaluated as an expression, see
|
||||
|sub-replace-expression|. Otherwise these characters in {string} have a
|
||||
special meaning:
|
||||
|sub-replace-expression|. You can use that for any special characters.
|
||||
Otherwise these characters in {string} have a special meaning:
|
||||
*:s%*
|
||||
When {string} is equal to "%" and '/' is included with the 'cpotions' option,
|
||||
then the {string} of the previous substitute command is used. |cpo-/|
|
||||
@@ -725,6 +728,7 @@ Examples: >
|
||||
:s/\([abc]\)\([efg]\)/\2\1/g modifies "af fa bg" to "fa fa gb"
|
||||
:s/abcde/abc^Mde/ modifies "abcde" to "abc", "de" (two lines)
|
||||
:s/$/\^M/ modifies "abcde" to "abcde^M"
|
||||
:s/\w\+/\u\0/g modifies "bla bla" to "Bla Bla"
|
||||
|
||||
Note: In previous versions CTRL-V was handled in a special way. Since this is
|
||||
not Vi compatible, this was removed. Use a backslash instead.
|
||||
@@ -748,8 +752,8 @@ either the first or second pattern in parentheses did not match, so either
|
||||
<
|
||||
|
||||
Substitute with an expression *sub-replace-expression*
|
||||
|
||||
When the substitute string starts with "\=" the remainer is interpreted as an
|
||||
*sub-replace-\=*
|
||||
When the substitute string starts with "\=" the remainder is interpreted as an
|
||||
expression. This does not work recursively: a substitute() function inside
|
||||
the expression cannot use "\=" for the substitute string.
|
||||
|
||||
@@ -762,6 +766,10 @@ break the line.
|
||||
For convenience a <NL> character is also used as a line break. Prepend a
|
||||
backslash to get a real <NL> character (which will be a NUL in the file).
|
||||
|
||||
When the result is a |List| then the items are joined with separating line
|
||||
breaks. Thus each item becomes a line, except that they can contain line
|
||||
breaks themselves.
|
||||
|
||||
The whole matched text can be accessed with "submatch(0)". The text matched
|
||||
with the first pair of () with "submatch(1)". Likewise for further
|
||||
sub-matches in ().
|
||||
@@ -770,9 +778,12 @@ Be careful: The separation character must not appear in the expression!
|
||||
Consider using a character like "@" or ":". There is no problem if the result
|
||||
of the expression contains the separation character.
|
||||
|
||||
Example: >
|
||||
Examples: >
|
||||
:s@\n@\="\r" . expand("$HOME") . "\r"@
|
||||
This replaces an end-of-line with a new line containing the value of $HOME.
|
||||
This replaces an end-of-line with a new line containing the value of $HOME. >
|
||||
|
||||
s/E/\="\<Char-0x20ac>"/g
|
||||
This replaces 'E' characters with an euro sign. Read more in |<Char->|.
|
||||
|
||||
|
||||
4.3 Search and replace *search-replace*
|
||||
@@ -915,6 +926,8 @@ inside of strings can change! Also see 'softtabstop' option. >
|
||||
current line). This always works |linewise|, thus
|
||||
this command can be used to put a yanked block as new
|
||||
lines.
|
||||
The cursor is left on the first non-blank in the last
|
||||
new line.
|
||||
The register can also be '=' followed by an optional
|
||||
expression. The expression continues until the end of
|
||||
the command. You need to escape the '|' and '"'
|
||||
@@ -964,9 +977,9 @@ When using a put command like |p| or |P| in Visual mode, Vim will try to
|
||||
replace the selected text with the contents of the register. Whether this
|
||||
works well depends on the type of selection and the type of the text in the
|
||||
register. With blockwise selection it also depends on the size of the block
|
||||
and whether the corners are on an existing character. (implementation detail:
|
||||
and whether the corners are on an existing character. (Implementation detail:
|
||||
it actually works by first putting the register after the selection and then
|
||||
deleting the selection).
|
||||
deleting the selection.)
|
||||
|
||||
*blockwise-register*
|
||||
If you use a blockwise Visual mode command to get the text into the register,
|
||||
@@ -1071,14 +1084,18 @@ normal command-line editing commands are available, including a special
|
||||
history for expressions. When you end the command-line by typing <CR>, Vim
|
||||
computes the result of the expression. If you end it with <Esc>, Vim abandons
|
||||
the expression. If you do not enter an expression, Vim uses the previous
|
||||
expression (like with the "/" command). If the "= register is used for the
|
||||
"p" command, the string is split up at <NL> characters. If the string ends in
|
||||
a <NL>, it is regarded as a linewise register. {not in Vi}
|
||||
expression (like with the "/" command). The expression must evaluate to a
|
||||
string. If the result is a number it's turned into a string. A List,
|
||||
Dictionary or FuncRef results in an error message (use string() to convert).
|
||||
If the "= register is used for the "p" command, the string is split up at <NL>
|
||||
characters. If the string ends in a <NL>, it is regarded as a linewise
|
||||
register. {not in Vi}
|
||||
|
||||
7. Selection and drop registers "*, "+ and "~
|
||||
Use these register for storing and retrieving the selected text for the GUI.
|
||||
See |quotestar| and |quoteplus|. When the clipboard is not available or not
|
||||
working, the unnamed register is used instead. {not in Vi}
|
||||
working, the unnamed register is used instead. For Unix systems the clipboard
|
||||
is only available when the |+xterm_clipboard| feature is present. {not in Vi}
|
||||
|
||||
Note that there is only a distinction between "* and "+ for X11 systems. For
|
||||
an explanation of the difference, see |x11-selection|. Under MS-Windows, use
|
||||
@@ -1156,12 +1173,18 @@ The next three commands always work on whole lines.
|
||||
|
||||
*gq*
|
||||
gq{motion} Format the lines that {motion} moves over.
|
||||
If 'formatprg' is empty formatting is done internally
|
||||
and the 'textwidth' option controls the length of each
|
||||
formatted line (see below).
|
||||
Formatting is done with one of three methods:
|
||||
1. If 'formatexpr' is not empty the expression is
|
||||
evaluated. This can differ for each buffer.
|
||||
2. If 'formatprg' is not empty an external program
|
||||
is used.
|
||||
3. Otherise formatting is done internally.
|
||||
|
||||
In the third case the 'textwidth' option controls the
|
||||
length of each formatted line (see below).
|
||||
If the 'textwidth' option is 0, the formatted line
|
||||
length is the screen width (with a maximum width of
|
||||
79). {not in Vi}
|
||||
79).
|
||||
The 'formatoptions' option controls the type of
|
||||
formatting |fo-table|.
|
||||
The cursor is left on the first non-blank of the last
|
||||
@@ -1181,8 +1204,8 @@ gqq Format the current line. {not in Vi}
|
||||
*gw*
|
||||
gw{motion} Format the lines that {motion} moves over. Similar to
|
||||
|gq| but puts the cursor back at the same position in
|
||||
the text. However, 'formatprg' is not used.
|
||||
{not in Vi}
|
||||
the text. However, 'formatprg' and 'formatexpr' are
|
||||
not used. {not in Vi}
|
||||
|
||||
gwgw *gwgw* *gww*
|
||||
gww Format the current line as with "gw". {not in Vi}
|
||||
@@ -1213,9 +1236,10 @@ white space!).
|
||||
|
||||
The 'joinspaces' option is used when lines are joined together.
|
||||
|
||||
You can set the 'formatprg' option to the name of an external program for Vim
|
||||
to use for text formatting. The 'textwidth' and other options have no effect
|
||||
on formatting by an external program.
|
||||
You can set the 'formatexpr' option to an expression or the 'formatprg' option
|
||||
to the name of an external program for Vim to use for text formatting. The
|
||||
'textwidth' and other options have no effect on formatting by an external
|
||||
program.
|
||||
|
||||
*right-justify*
|
||||
There is no command in Vim to right justify text. You can do it with
|
||||
@@ -1417,7 +1441,7 @@ If the 'comments' option includes "/*", "*" and/or "*/", then Vim has some
|
||||
built in stuff to treat these types of comments a bit more cleverly.
|
||||
Opening a new line before or after "/*" or "*/" (with 'r' or 'o' present in
|
||||
'formatoptions') gives the correct start of the line automatically. The same
|
||||
happens with formatting and auto-wrapping. Opening a line after a line
|
||||
happens with formatting and auto-wrapping. Opening a line after a line
|
||||
starting with "/*" or "*" and containing "*/", will cause no comment leader to
|
||||
be inserted, and the indent of the new line is taken from the line containing
|
||||
the start of the comment.
|
||||
@@ -1477,5 +1501,57 @@ And a few warnings:
|
||||
|
||||
- Formatting a long paragraph and/or with complicated indenting may be slow.
|
||||
|
||||
==============================================================================
|
||||
7. Sorting text *sorting*
|
||||
|
||||
Vim has a sorting function and a sorting command. The sorting function can be
|
||||
found here: |sort()|.
|
||||
|
||||
*:sor* *:sort*
|
||||
:[range]sor[t][!] [i][u][n][x][o] [/{pattern}/]
|
||||
Sort lines in [range]. When no range is given all
|
||||
lines are sorted.
|
||||
|
||||
With [!] the order is reversed.
|
||||
|
||||
With [i] case is ignored.
|
||||
|
||||
With [n] sorting is done on the first decimal number
|
||||
in the line (after a {pattern} match).
|
||||
|
||||
With [x] sorting is done on the first hexadecimal
|
||||
number in the line (after a {pattern} match). A
|
||||
leading "0x" or "0X" is ignored.
|
||||
|
||||
With [o] sorting is done on the first octal number in
|
||||
the line (after a {pattern} match).
|
||||
|
||||
With [u] only keep the first of a sequence of
|
||||
identical lines (ignoring case when [i] is used).
|
||||
Note that leading and trailing white space may cause
|
||||
lines to be different.
|
||||
|
||||
When /{pattern}/ is specified the text matched with
|
||||
{pattern} is skipped, so that you sort on what comes
|
||||
after the match. For lines without a match sorting
|
||||
starts in the first column (e.g., for empty lines).
|
||||
Instead of the slash any non-letter can be used.
|
||||
For example, to sort on the second comma-separated
|
||||
field: >
|
||||
:sort /[^,]*,/
|
||||
< To sort on the text at virtual column 10 (thus
|
||||
ignoring the difference between tabs and spaces): >
|
||||
:sort /.*\%10v/
|
||||
<
|
||||
Note that using ":sort" with ":global" doesn't sort the matching lines, it's
|
||||
quite useless.
|
||||
|
||||
The details about sorting depend on the library function used. There is no
|
||||
guarantee that sorting is "stable" or obeys the current locale. You will have
|
||||
to try it out.
|
||||
|
||||
The sorting itself cannot be interrupted, because of using a system library
|
||||
function. You can interrupt the preparation (for undo) and putting the sorted
|
||||
lines into the buffer. In the last case you may end up with duplicated lines.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*cmdline.txt* For Vim version 7.0aa. Last change: 2005 Feb 14
|
||||
*cmdline.txt* For Vim version 7.0b. Last change: 2006 Mar 16
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -153,6 +153,9 @@ CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
|
||||
*c_CTRL-R_=*
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
(doesn't work at the expression prompt; some
|
||||
things such as changing the buffer or current
|
||||
window are not allowed to avoid side effects)
|
||||
See |registers| about registers. {not in Vi}
|
||||
Implementation detail: When using the |expression| register
|
||||
and invoking setcmdpos(), this sets the position before
|
||||
@@ -169,8 +172,11 @@ CTRL-R CTRL-A *c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
|
||||
'path' as in |gf|
|
||||
CTRL-W the Word under the cursor
|
||||
CTRL-A the WORD under the cursor; see |WORD|
|
||||
When 'incsearch' is set the cursor position of the currently
|
||||
displayed match is used.
|
||||
|
||||
When 'incsearch' is set the cursor position at the end of the
|
||||
currently displayed match is used. With CTRL-W the part of
|
||||
the word that was already typed is not inserted again.
|
||||
|
||||
{not in Vi}
|
||||
CTRL-F and CTRL-P: {only when +file_in_path feature is
|
||||
included}
|
||||
@@ -191,10 +197,13 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
to finish it. It's most useful in mappings though. See
|
||||
|expression|.
|
||||
See |c_CTRL-R_=| for inserting the result of an expression.
|
||||
Useful functions are |getcmdline()| and |getcmdpos()|.
|
||||
Useful functions are |getcmdtype()|, |getcmdline()| and
|
||||
|getcmdpos()|.
|
||||
The cursor position is unchanged, except when the cursor was
|
||||
at the end of the line, then it stays at the end.
|
||||
|setcmdpos()| can be used to set the cursor position.
|
||||
The |sandbox| is used for evaluating the expression to avoid
|
||||
nasty side effects.
|
||||
Example: >
|
||||
:cmap <F7> <C-\>eAppendSome()<CR>
|
||||
:func AppendSome()
|
||||
@@ -203,7 +212,9 @@ CTRL-\ e {expr} *c_CTRL-\_e*
|
||||
:call setcmdpos(strlen(cmd))
|
||||
:return cmd
|
||||
:endfunc
|
||||
<
|
||||
< This doesn't work recursively, thus not when already editing
|
||||
an expression.
|
||||
|
||||
*c_CTRL-Y*
|
||||
CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
@@ -346,6 +357,7 @@ word before the cursor. This is available for:
|
||||
- File names: Only after a command that accepts a file name or a setting for
|
||||
an option that can be set to a file name. This is called file name
|
||||
completion.
|
||||
- Shell command names: After ":!cmd", ":r !cmd" and ":w !cmd". $PATH is used.
|
||||
- Options: Only after the ":set" command.
|
||||
- Mappings: Only after a ":map" or similar command.
|
||||
- Variable and function names: Only after a ":if", ":call" or similar command.
|
||||
@@ -390,6 +402,9 @@ CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
If there are multiple matches the longest common part is
|
||||
inserted in place of the pattern. If the result is shorter
|
||||
than the pattern, no completion is done.
|
||||
When 'incsearch' is set, entering a search pattern for "/" or
|
||||
"?" and the current match is displayed then CTRL-L will add
|
||||
one character from the end of the current match.
|
||||
|
||||
The 'wildchar' option defaults to <Tab> (CTRL-E when in Vi compatible mode; in
|
||||
a previous version <Esc> was used). In the pattern standard wildcards '*' and
|
||||
@@ -471,6 +486,7 @@ followed by another command:
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:lcscope
|
||||
:make
|
||||
:normal
|
||||
:perl
|
||||
@@ -558,7 +574,7 @@ argument for the command, which has a different meaning. For example:
|
||||
"name"
|
||||
|
||||
==============================================================================
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* *E493*
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16*
|
||||
|
||||
Some Ex commands accept a line range in front of them. This is noted as
|
||||
[range]. It consists of one or more line specifiers, separated with ',' or
|
||||
@@ -644,11 +660,15 @@ When folds are active the line numbers are rounded off to include the whole
|
||||
closed fold. See |fold-behavior|.
|
||||
|
||||
|
||||
Reverse Range
|
||||
Reverse Range *E493*
|
||||
|
||||
A range should have the lower line number first. If this is not the case, Vim
|
||||
will ask you if it should swap the line numbers. This is not done within the
|
||||
global command ":g".
|
||||
will ask you if it should swap the line numbers.
|
||||
Backwards range given, OK to swap ~
|
||||
This is not done within the global command ":g".
|
||||
|
||||
You can use ":silent" before a command to avoid the question, the range will
|
||||
always be swapped then.
|
||||
|
||||
|
||||
Count and Range *N:*
|
||||
@@ -684,6 +704,12 @@ output.
|
||||
==============================================================================
|
||||
6. Ex special characters *cmdline-special*
|
||||
|
||||
Note: These are special characters in the executed command line. If you want
|
||||
to insert special things while typing you can use the CTRL-R command. For
|
||||
example, "%" stands for the current file name, while CTRL-R % inserts the
|
||||
current file name right away. See |c_CTRL-R|.
|
||||
|
||||
|
||||
In Ex commands, at places where a file name can be used, the following
|
||||
characters have a special meaning. These can also be used in the expression
|
||||
function expand() |expand()|.
|
||||
@@ -723,12 +749,13 @@ Note: these are typed literally, they are not special keys!
|
||||
<afile> when executing autocommands, is replaced with the file name
|
||||
for a file read or write
|
||||
<abuf> when executing autocommands, is replaced with the currently
|
||||
effective buffer number (for ":r file" it is the current
|
||||
buffer, the file being read is not in a buffer).
|
||||
effective buffer number (for ":r file" and ":so file" it is
|
||||
the current buffer, the file being read/sourced is not in a
|
||||
buffer).
|
||||
<amatch> when executing autocommands, is replaced with the match for
|
||||
which this autocommand was executed. It differs form
|
||||
which this autocommand was executed. It differs from
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType and Syntax events).
|
||||
(for FileType, Syntax and SpellFileMissing events).
|
||||
<sfile> when executing a ":source" command, is replaced with the
|
||||
file name of the sourced file;
|
||||
when executing a function, is replaced with
|
||||
@@ -951,6 +978,11 @@ that there will be an extra screen redraw.
|
||||
The buffer used for the command-line window is deleted. Any changes to lines
|
||||
other than the one that is executed with <CR> are lost.
|
||||
|
||||
If you would like to execute the command under the cursor and then have the
|
||||
command-line window open again, you may find this mapping useful: >
|
||||
|
||||
:map <F5> <CR>q:
|
||||
|
||||
|
||||
VARIOUS
|
||||
|
||||
|
||||
70
runtime/doc/debug.txt
Normal file
70
runtime/doc/debug.txt
Normal file
@@ -0,0 +1,70 @@
|
||||
*debug.txt* For Vim version 7.0b. Last change: 2005 Dec 17
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
|
||||
Debugging Vim *debug-vim*
|
||||
|
||||
This is for debugging Vim itself, when it doesn't work properly.
|
||||
For debugging Vim scripts, functions, etc. see |debug-scripts|
|
||||
|
||||
1. Location of a crash, using gcc and gdb |debug-gcc|
|
||||
2. Windows Bug Reporting |debug-win32|
|
||||
|
||||
==============================================================================
|
||||
|
||||
1. Location of a crash, using gcc and gdb *debug-gcc*
|
||||
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes.
|
||||
This also applies when using the MingW tools.
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
|
||||
==============================================================================
|
||||
|
||||
2. Windows Bug Reporting *debug-win32*
|
||||
|
||||
If the Windows version of Vim crashes in a reproducible manner,
|
||||
you can take some steps to provide a useful bug report.
|
||||
|
||||
First, you must obtain the debugger symbols (PDB) file for your executable:
|
||||
gvim.pdb for gvim.exe, or vim.pdb for vim.exe. It should be available
|
||||
from the same place that you obtained the executable. Be sure to use
|
||||
the PDB that matches the EXE.
|
||||
|
||||
If you built the executable yourself with the Microsoft Visual C++ compiler,
|
||||
then the PDB was built with the EXE.
|
||||
|
||||
You can download the Microsoft Visual C++ Toolkit from
|
||||
http://msdn.microsoft.com/visualc/vctoolkit2003/
|
||||
This contains the command-line tools, but not the Visual Studio IDE.
|
||||
|
||||
The Debugging Tools for Windows can be downloaded from
|
||||
http://www.microsoft.com/whdc/devtools/debugging/default.mspx
|
||||
This includes the WinDbg debugger.
|
||||
|
||||
If you have Visual Studio, use that instead of the VC Toolkit
|
||||
and WinDbg.
|
||||
|
||||
For other compilers, you should always use the corresponding debugger: TD for
|
||||
a Vim executable compiled with the Borland compiler; gdb (see above
|
||||
|debug-gcc|) for the Cygwin and MinGW compilers.
|
||||
|
||||
=========================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
@@ -1,4 +1,4 @@
|
||||
*debugger.txt* For Vim version 7.0aa. Last change: 2005 Mar 07
|
||||
*debugger.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Gordon Prieur
|
||||
@@ -27,19 +27,19 @@ Environment (IDE):
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
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
|
||||
@@ -49,15 +49,15 @@ 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
|
||||
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
|
||||
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
|
||||
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.
|
||||
|
||||
@@ -66,17 +66,17 @@ 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
|
||||
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
|
||||
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
|
||||
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'.
|
||||
@@ -85,7 +85,7 @@ 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
|
||||
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.
|
||||
@@ -111,7 +111,7 @@ completely user definable.
|
||||
2. Vim Compile Options *debugger-compilation*
|
||||
|
||||
The debugger features were added explicitly for use with Sun's Visual
|
||||
WorkShop Integrated Programming Environment (ipe). However, they were done
|
||||
WorkShop Integrated Programming Environment (ipe). However, they were done
|
||||
in as generic a manner as possible so that integration with other debuggers
|
||||
could also use some or all of the tools used with Sun's ipe.
|
||||
|
||||
@@ -123,7 +123,7 @@ The following compile time preprocessor variables control the features:
|
||||
Message Footer FEAT_FOOTER
|
||||
Balloon Evaluation FEAT_BEVAL
|
||||
|
||||
The first integration with a full IPE/IDE was with Sun Visual WorkShop. To
|
||||
The first integration with a full IPE/IDE was with Sun Visual WorkShop. To
|
||||
compile a gvim which interfaces with VWS set the following flag, which sets
|
||||
all the above flags:
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*develop.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
|
||||
*develop.txt* For Vim version 7.0b. Last change: 2006 Mar 09
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -123,7 +123,8 @@ VIM IS... MAINTAINABLE *design-maintain*
|
||||
|
||||
- The source code should not become a mess. It should be reliable code.
|
||||
- Use the same layout in all files to make it easy to read |coding-style|.
|
||||
- Use comments in a useful way!
|
||||
- Use comments in a useful way! Quoting the function name and argument names
|
||||
is NOT useful. Do explain what they are for.
|
||||
- Porting to another platform should be made easy, without having to change
|
||||
too much platform-independent code.
|
||||
- Use the object-oriented spirit: Put data and code together. Minimize the
|
||||
@@ -148,6 +149,7 @@ VIM IS... NOT *design-not*
|
||||
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.
|
||||
@@ -186,8 +188,8 @@ strchr() vim_strchr() Accepts special characters
|
||||
strrchr() vim_strrchr() Accepts special characters
|
||||
isspace() vim_isspace() Can handle characters > 128
|
||||
iswhite() vim_iswhite() Only TRUE for Tab and space
|
||||
memcpy() vim_memmove() Handles overlapped copies
|
||||
bcopy() vim_memmove() Handles overlapped copies
|
||||
memcpy() mch_memmove() Handles overlapped copies
|
||||
bcopy() mch_memmove() Handles overlapped copies
|
||||
memset() vim_memset() Uniform for all systems
|
||||
|
||||
|
||||
@@ -237,8 +239,8 @@ get_env_value() Linux system function
|
||||
|
||||
VARIOUS *style-various*
|
||||
|
||||
Typedef'ed names should end in "_t": >
|
||||
typedef int some_t;
|
||||
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_": >
|
||||
@@ -366,7 +368,111 @@ window View on a buffer. There can be several windows in Vim,
|
||||
fit in the shell.
|
||||
|
||||
|
||||
To be continued...
|
||||
Spell checking *develop-spell*
|
||||
|
||||
When spell checking was going to be added to Vim a survey was done over the
|
||||
available spell checking libraries and programs. Unfortunately, the result
|
||||
was that none of them provided sufficient capabilities to be used as the spell
|
||||
checking engine in Vim, for various reasons:
|
||||
|
||||
- Missing support for multi-byte encodings. At least UTF-8 must be supported,
|
||||
so that more than one language can be used in the same file.
|
||||
Doing on-the-fly conversion is not always possible (would require iconv
|
||||
support).
|
||||
- For the programs and libraries: Using them as-is would require installing
|
||||
them separately from Vim. That's mostly not impossible, but a drawback.
|
||||
- Performance: A few tests showed that it's possible to check spelling on the
|
||||
fly (while redrawing), just like syntax highlighting. But the mechanisms
|
||||
used by other code are much slower. Myspell uses a hashtable, for example.
|
||||
The affix compression that most spell checkers use makes it slower too.
|
||||
- For using an external program like aspell a communication mechanism would
|
||||
have to be setup. That's complicated to do in a portable way (Unix-only
|
||||
would be relatively simple, but that's not good enough). And performance
|
||||
will become a problem (lots of process switching involved).
|
||||
- Missing support for words with non-word characters, such as "Etten-Leur" and
|
||||
"et al.", would require marking the pieces of them OK, lowering the
|
||||
reliability.
|
||||
- Missing support for regions or dialects. Makes it difficult to accept
|
||||
all English words and highlight non-Canadian words differently.
|
||||
- Missing support for rare words. Many words are correct but hardly ever used
|
||||
and could be a misspelled often-used word.
|
||||
- For making suggestions the speed is less important and requiring to install
|
||||
another program or library would be acceptable. But the word lists probably
|
||||
differ, the suggestions may be wrong words.
|
||||
|
||||
|
||||
Spelling suggestions *develop-spell-suggestions*
|
||||
|
||||
For making suggestions there are two basic mechanisms:
|
||||
1. Try changing the bad word a little bit and check for a match with a good
|
||||
word. Or go through the list of good words, change them a little bit and
|
||||
check for a match with the bad word. The changes are deleting a character,
|
||||
inserting a character, swapping two characters, etc.
|
||||
2. Perform soundfolding on both the bad word and the good words and then find
|
||||
matches, possibly with a few changes like with the first mechanism.
|
||||
|
||||
The first is good for finding typing mistakes. After experimenting with
|
||||
hashtables and looking at solutions from other spell checkers the conclusion
|
||||
was that a trie (a kind of tree structure) is ideal for this. Both for
|
||||
reducing memory use and being able to try sensible changes. For example, when
|
||||
inserting a character only characters that lead to good words need to be
|
||||
tried. Other mechanisms (with hashtables) need to try all possible letters at
|
||||
every position in the word. Also, a hashtable has the requirement that word
|
||||
boundaries are identified separately, while a trie does not require this.
|
||||
That makes the mechanism a lot simpler.
|
||||
|
||||
Soundfolding is useful when someone knows how the words sounds but doesn't
|
||||
know how it is spelled. For example, the word "dictionary" might be written
|
||||
as "daktonerie". The number of changes that the first method would need to
|
||||
try is very big, it's hard to find the good word that way. After soundfolding
|
||||
the words become "tktnr" and "tkxnry", these differ by only two letters.
|
||||
|
||||
To find words by their soundfolded equivalent (soundalike word) we need a list
|
||||
of all soundfolded words. A few experiments have been done to find out what
|
||||
the best method is. Alternatives:
|
||||
1. Do the sound folding on the fly when looking for suggestions. This means
|
||||
walking through the trie of good words, soundfolding each word and
|
||||
checking how different it is from the bad word. This is very efficient for
|
||||
memory use, but takes a long time. On a fast PC it takes a couple of
|
||||
seconds for English, which can be acceptable for interactive use. But for
|
||||
some languages it takes more than ten seconds (e.g., German, Catalan),
|
||||
which is unacceptable slow. For batch processing (automatic corrections)
|
||||
it's to slow for all languages.
|
||||
2. Use a trie for the soundfolded words, so that searching can be done just
|
||||
like how it works without soundfolding. This requires remembering a list
|
||||
of good words for each soundfolded word. This makes finding matches very
|
||||
fast but requires quite a lot of memory, in the order of 1 to 10 Mbyte.
|
||||
For some languages more than the original word list.
|
||||
3. Like the second alternative, but reduce the amount of memory by using affix
|
||||
compression and store only the soundfolded basic word. This is what Aspell
|
||||
does. Disadvantage is that affixes need to be stripped from the bad word
|
||||
before soundfolding it, which means that mistakes at the start and/or end
|
||||
of the word will cause the mechanism to fail. Also, this becomes slow when
|
||||
the bad word is quite different from the good word.
|
||||
|
||||
The choice made is to use the second mechanism and use a separate file. This
|
||||
way a user with sufficient memory can get very good suggestions while a user
|
||||
who is short of memory or just wants the spell checking and no suggestions
|
||||
doesn't use so much memory.
|
||||
|
||||
|
||||
Word frequency
|
||||
|
||||
For sorting suggestions it helps to know which words are common. In theory we
|
||||
could store a word frequency with the word in the dictionary. However, this
|
||||
requires storing a count per word. That degrades word tree compression a lot.
|
||||
And maintaining the word frequency for all languages will be a heavy task.
|
||||
Also, it would be nice to prefer words that are already in the text. This way
|
||||
the words that appear in the specific text are preferred for suggestions.
|
||||
|
||||
What has been implemented is to count words that have been seen during
|
||||
displaying. A hashtable is used to quickly find the word count. The count is
|
||||
initialized from words listed in COMMON items in the affix file, so that it
|
||||
also works when starting a new file.
|
||||
|
||||
This isn't ideal, because the longer Vim is running the higher the counts
|
||||
become. But in practice it is a noticable improvement over not using the word
|
||||
count.
|
||||
|
||||
==============================================================================
|
||||
4. Assumptions *design-assumptions*
|
||||
@@ -374,8 +480,8 @@ To be continued...
|
||||
Size of variables:
|
||||
char 8 bit signed
|
||||
char_u 8 bit unsigned
|
||||
int 16, 32 or 64 bit signed
|
||||
unsigned 16, 32 or 64 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
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*diff.txt* For Vim version 7.0aa. Last change: 2005 Mar 08
|
||||
*diff.txt* For Vim version 7.0b. Last change: 2006 Mar 15
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -41,12 +41,18 @@ the file.
|
||||
|
||||
This only works when a standard "diff" command is available. See 'diffexpr'.
|
||||
|
||||
Diffs are local to the current tab page |tab-page|. You can't see diffs with
|
||||
a window in another tab page. This does make it possible to have several
|
||||
diffs at the same time, each in their own tab page.
|
||||
|
||||
What happens is that Vim opens a window for each of the files. This is like
|
||||
using the |-O| argument. This uses vertical splits. If you prefer horizontal
|
||||
splits add the |-o| argument: >
|
||||
|
||||
vimdiff -o file1 file2 [file3]
|
||||
|
||||
If you always prefer horizontal splits include "horizontal" in 'diffopt'.
|
||||
|
||||
In each of the edited files these options are set:
|
||||
|
||||
'diff' on
|
||||
@@ -54,7 +60,7 @@ In each of the edited files these options are set:
|
||||
'scrollopt' includes "hor"
|
||||
'wrap' off
|
||||
'foldmethod' "diff"
|
||||
'foldcolumn' 2
|
||||
'foldcolumn' value from 'diffopt', default is 2
|
||||
|
||||
These options are set local to the window. When editing another file they are
|
||||
reset to the global value.
|
||||
@@ -103,7 +109,9 @@ To make these commands use a vertical split, prepend |:vertical|. Examples: >
|
||||
|
||||
:vert diffsplit main.c~
|
||||
:vert diffpatch /tmp/diff
|
||||
<
|
||||
|
||||
If you always prefer a vertical split include "vertical" in 'diffopt'.
|
||||
|
||||
*E96*
|
||||
There can be up to four buffers with 'diff' set.
|
||||
|
||||
@@ -113,7 +121,7 @@ file for a moment and come back to the same file and be in diff mode again.
|
||||
*:diffo* *:diffoff*
|
||||
:diffoff Switch off diff mode for the current window.
|
||||
|
||||
:diffoff! Switch off diff mode for all windows.
|
||||
:diffoff! Switch off diff mode for all windows in the current tab page.
|
||||
|
||||
The ":diffoff" command resets the relevant options to their default value.
|
||||
This may be different from what the values were before diff mode was started,
|
||||
@@ -161,6 +169,8 @@ buffer. If you don't want a buffer to remain used for the diff do ":set
|
||||
nodiff" before hiding it.
|
||||
|
||||
*:diffu* *:diffupdate*
|
||||
:diffu[pdate] Update the diff highlighting and folds.
|
||||
|
||||
Vim attempts to keep the differences updated when you make changes to the
|
||||
text. This mostly takes care of inserted and deleted lines. Changes within a
|
||||
line and more complicated changes do not cause the differences to be updated.
|
||||
@@ -216,7 +226,7 @@ It is an error if there is no change for the cursor to move to.
|
||||
|
||||
==============================================================================
|
||||
4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103*
|
||||
|
||||
*merge*
|
||||
There are two commands to copy text from one buffer to another. The result is
|
||||
that the buffers will be equal within the specified range.
|
||||
|
||||
@@ -233,6 +243,8 @@ that the buffers will be equal within the specified range.
|
||||
Modify another buffer to undo difference with the current
|
||||
buffer. Just like ":diffget" but the other buffer is modified
|
||||
instead of the current one.
|
||||
When [bufspec] is omitted and there is more than one other
|
||||
buffer in diff mode where 'modifiable' is set this fails.
|
||||
See below for [range].
|
||||
|
||||
*do*
|
||||
@@ -341,8 +353,8 @@ get an error message. Possible causes:
|
||||
- The 'shell' and associated options are not set correctly. Try if filtering
|
||||
works with a command like ":!sort".
|
||||
- You are using 'diffexpr' and it doesn't work.
|
||||
If it's not clear what the problem is set the 'verbose' option to see more
|
||||
messages.
|
||||
If it's not clear what the problem is set the 'verbose' option to one or more
|
||||
to see more messages.
|
||||
|
||||
The self-installing Vim includes a diff program. If you don't have it you
|
||||
might want to download a diff.exe. For example from
|
||||
@@ -370,8 +382,8 @@ will have the same effect. These variables are set to the file names used:
|
||||
|
||||
Example (this does the same as 'patchexpr' being empty): >
|
||||
|
||||
let patchexpr=MyPatch
|
||||
function MyPatch
|
||||
set patchexpr=MyPatch()
|
||||
function MyPatch()
|
||||
:call system("patch -o " . v:fname_out . " " . v:fname_in .
|
||||
\ " < " . v:fname_diff)
|
||||
endfunction
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*digraph.txt* For Vim version 7.0aa. Last change: 2005 Mar 06
|
||||
*digraph.txt* For Vim version 7.0b. Last change: 2005 Sep 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -166,7 +166,8 @@ EURO
|
||||
Exception: RFC1345 doesn't specify the euro sign. In Vim the digraph =e was
|
||||
added for this. Note the difference between latin1, where the digraph Cu is
|
||||
used for the currency sign, and latin9 (iso-8859-15), where the digraph =e is
|
||||
used for the euro sign, while both of them are the character 164, 0xa4.
|
||||
used for the euro sign, while both of them are the character 164, 0xa4. For
|
||||
compatibility with zsh Eu can also be used for the euro sign.
|
||||
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*editing.txt* For Vim version 7.0aa. Last change: 2005 Feb 14
|
||||
*editing.txt* For Vim version 7.0b. Last change: 2006 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -46,7 +46,7 @@ However, the alternate file name is not changed when |:keepalt| is used.
|
||||
name. {not in Vi}
|
||||
|
||||
All file names are remembered in the buffer list. When you enter a file name,
|
||||
for editing (e.g., with ":e filename") or writing (e.g., with ":w file name"),
|
||||
for editing (e.g., with ":e filename") or writing (e.g., with ":w filename"),
|
||||
the file name is added to the list. You can use the buffer list to remember
|
||||
which files you edited and to quickly switch from one file to another (e.g.,
|
||||
to copy text) with the |CTRL-^| command. First type the number of the file
|
||||
@@ -54,12 +54,12 @@ and then hit CTRL-^. {Vi: only one alternate file name is remembered}
|
||||
|
||||
|
||||
CTRL-G or *CTRL-G* *:f* *:fi* *:file*
|
||||
:f[ile] Prints the current file name (as typed), the
|
||||
cursor position (unless the 'ruler' option is set),
|
||||
and the file status (readonly, modified, read errors,
|
||||
new file). See the 'shortmess' option about how tho
|
||||
make this message shorter. {Vi does not include
|
||||
column number}
|
||||
:f[ile] Prints the current file name (as typed, unless ":cd"
|
||||
was used), the cursor position (unless the 'ruler'
|
||||
option is set), and the file status (readonly,
|
||||
modified, read errors, new file). See the 'shortmess'
|
||||
option about how to make this message shorter.
|
||||
{Vi does not include column number}
|
||||
|
||||
:f[ile]! like |:file|, but don't truncate the name even when
|
||||
'shortmess' indicates this.
|
||||
@@ -155,11 +155,14 @@ Technical: On the Amiga you can use 30 characters for a file name. But on an
|
||||
When you started editing without giving a file name, "No File" is displayed in
|
||||
messages. If the ":write" command is used with a file name argument, the file
|
||||
name for the current file is set to that file name. This only happens when
|
||||
the 'F' flag is included in 'cpoptions' (by default it is included). This is
|
||||
useful when entering text in an empty buffer and then writing it to a file.
|
||||
If 'cpoptions' contains the 'f' flag (by default it is NOT included) the file
|
||||
name is set for the ":read file" command. This is useful when starting Vim
|
||||
without an argument and then doing ":read file" to start editing a file.
|
||||
the 'F' flag is included in 'cpoptions' (by default it is included) |cpo-F|.
|
||||
This is useful when entering text in an empty buffer and then writing it to a
|
||||
file. If 'cpoptions' contains the 'f' flag (by default it is NOT included)
|
||||
|cpo-f| the file name is set for the ":read file" command. This is useful
|
||||
when starting Vim without an argument and then doing ":read file" to start
|
||||
editing a file.
|
||||
When the file name was set and 'filetype' is empty the filetype detection
|
||||
autocommands will be triggered.
|
||||
*not-edited*
|
||||
Because the file name was set without really starting to edit that file, you
|
||||
are protected from overwriting that file. This is done by setting the
|
||||
@@ -331,6 +334,22 @@ CTRL-^ Edit the alternate file (equivalent to ":e #").
|
||||
(For {Visual} see |Visual-mode|.)
|
||||
{not in VI}
|
||||
|
||||
*gF*
|
||||
[count]gF Same as "gf", except if a number follows the file
|
||||
name, then the cursor is positioned on that line in
|
||||
the file. The file name and the number must be
|
||||
separated by a non-filename (see 'isfname') and
|
||||
non-numeric character. White space between the
|
||||
filename, the separator and the number are ignored.
|
||||
Examples: >
|
||||
eval.c:10
|
||||
eval.c @ 20
|
||||
eval.c (30)
|
||||
eval.c 40
|
||||
<
|
||||
*v_gF*
|
||||
{Visual}[count]gF Same as "v_gf".
|
||||
|
||||
These commands are used to start editing a single file. This means that the
|
||||
file is read into the buffer and the current file name is set. The file that
|
||||
is opened depends on the current directory, see |:cd|.
|
||||
@@ -354,14 +373,32 @@ file1 file2") embedded spaces must be escaped with a backslash.
|
||||
*wildcard*
|
||||
Wildcards in {file} are expanded. Which wildcards are supported depends on
|
||||
the system. These are the common ones:
|
||||
* matches anything, including nothing
|
||||
? matches one character
|
||||
* matches anything, including nothing
|
||||
** matches anything, including nothing, recurses into directories
|
||||
[abc] match 'a', 'b' or 'c'
|
||||
|
||||
To avoid the special meaning of the wildcards prepend a backslash. However,
|
||||
on MS-Windows the backslash is a path separator and "path\[abc]" is still seen
|
||||
as a wildcard when "[" is in the 'isfname' option. A simple way to avoid this
|
||||
is to use "path\[[]abc]". Then the file "path[abc]" literally.
|
||||
|
||||
*starstar-wildcard*
|
||||
Expanding "**" is possible on Unix, Win32, Mac OS/X and a few other systems.
|
||||
This allows searching a directory tree. This goes up to 100 directories deep.
|
||||
Example: >
|
||||
:n **/*.txt
|
||||
Finds files:
|
||||
ttt.txt
|
||||
subdir/ttt.txt
|
||||
a/b/c/d/ttt.txt
|
||||
When non-wildcard characters are used these are only matched in the first
|
||||
directory. Example: >
|
||||
:n /usr/inc**/*.h
|
||||
Finds files:
|
||||
/usr/include/types.h
|
||||
/usr/include/sys/types.h
|
||||
/usr/inc_old/types.h
|
||||
*backtick-expansion* *`-expansion*
|
||||
On Unix and a few other systems you can also use backticks in the file name,
|
||||
for example: >
|
||||
@@ -377,11 +414,14 @@ You can have the backticks expanded as a Vim expression, instead of an
|
||||
external command, by using the syntax `={expr}` e.g.: >
|
||||
:e `=tempname()`
|
||||
The expression can contain just about anything, thus this can also be used to
|
||||
avoid the special meaning of '"', '|', '%' and '#'.
|
||||
avoid the special meaning of '"', '|', '%' and '#'. Names are to be separated
|
||||
with line breaks. When the result is a |List| then each item is used as a
|
||||
name. Line breaks also separate names.
|
||||
|
||||
*++opt* *[++opt]*
|
||||
The [++opt] argument can be used to force the value of 'fileformat' or
|
||||
'fileencoding' to a value for one command. The form is: >
|
||||
The [++opt] argument can be used to force the value of 'fileformat',
|
||||
'fileencoding' or 'binary' to a value for one command, and to specify the
|
||||
behavior for bad characters. The form is: >
|
||||
++{optname}={value}
|
||||
|
||||
Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin*
|
||||
@@ -389,6 +429,7 @@ Where {optname} is one of: *++ff* *++enc* *++bin* *++nobin*
|
||||
enc or encoding overrides 'fileencoding'
|
||||
bin or binary sets 'binary'
|
||||
nobin or nobinary resets 'binary'
|
||||
bad specifies behavior for bad characters
|
||||
|
||||
{value} cannot contain white space. It can be any valid value for these
|
||||
options. Examples: >
|
||||
@@ -398,12 +439,24 @@ This edits the same file again with 'fileformat' set to "unix". >
|
||||
:w ++enc=latin1 newfile
|
||||
This writes the current buffer to "newfile" in latin1 format.
|
||||
|
||||
There may be several ++opt arguments, separated by white space. They must all
|
||||
appear before any |+cmd| argument.
|
||||
|
||||
*++bad*
|
||||
The argument of "++bad=" specifies what happens with characters that can't be
|
||||
converted and illegal bytes. It can be one of three things:
|
||||
++bad=X A single-byte character that replaces each bad character.
|
||||
++bad=keep Keep bad characters without conversion. Note that this may
|
||||
result in illegal bytes in your text!
|
||||
++bad=drop Remove the bad characters.
|
||||
|
||||
The default is like "++bad=?": Replace each bad character with a question
|
||||
mark.
|
||||
|
||||
Note that when reading, the 'fileformat' and 'fileencoding' options will be
|
||||
set to the used format. When writing this doesn't happen, thus a next write
|
||||
will use the old value of the option. Same for the 'binary' option.
|
||||
|
||||
There may be several ++opt arguments, separated by white space. They must all
|
||||
appear before any |+cmd| argument.
|
||||
|
||||
*+cmd* *[+cmd]*
|
||||
The [+cmd] argument can be used to position the cursor in the newly opened
|
||||
@@ -563,7 +616,9 @@ list of the current window.
|
||||
current entry.
|
||||
This command keeps the currently edited file, also
|
||||
when it's deleted from the argument list.
|
||||
{not in Vi} {not available when compiled without the
|
||||
Example: >
|
||||
:argdel *.obj
|
||||
< {not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
|
||||
:{range}argd[elete] Delete the {range} files from the argument list.
|
||||
@@ -766,7 +821,7 @@ USING THE ARGUMENT LIST
|
||||
each file.
|
||||
{not in Vi} {not available when compiled without the
|
||||
|+listcmds| feature}
|
||||
Also see |:windo| and |:bufdo|.
|
||||
Also see |:windo|, |:tabdo| and |:bufdo|.
|
||||
|
||||
Example: >
|
||||
:args *.c
|
||||
@@ -840,6 +895,8 @@ used, for example, when the write fails and you want to try again later with
|
||||
the filename of the current buffer to {file}. The
|
||||
previous name is used for the alternate file name.
|
||||
The [!] is needed to overwrite an existing file.
|
||||
When 'filetype' is empty filetype detection is done
|
||||
with the new name, before the file is written.
|
||||
{not in Vi}
|
||||
|
||||
*:up* *:update*
|
||||
@@ -910,8 +967,8 @@ if the system allows it (the directory must be writable).
|
||||
*write-fail*
|
||||
If the writing of the new file fails, you have to be careful not to lose
|
||||
your changes AND the original file. If there is no backup file and writing
|
||||
the new file failed, you have already lost the original file! DON'T EXIT VIM
|
||||
UNTIL YOU WRITE OUT THE FILE! If a backup was made, it is put back in place
|
||||
the new file failed, you have already lost the original file! DON'T EXIT VIM
|
||||
UNTIL YOU WRITE OUT THE FILE! If a backup was made, it is put back in place
|
||||
of the original file (if possible). If you exit Vim, and lose the changes
|
||||
you made, the original file will mostly still be there. If putting back the
|
||||
original file fails, there will be an error message telling you that you
|
||||
@@ -975,6 +1032,9 @@ The names can be in upper- or lowercase.
|
||||
Vim refuses to |abandon| the current buffer, and when
|
||||
the last file in the argument list has not been
|
||||
edited.
|
||||
If there are other tab pages and quitting the last
|
||||
window in the current tab page the current tab page is
|
||||
closed |tab-page|.
|
||||
|
||||
:conf[irm] q[uit] Quit, but give prompt when changes have been made, or
|
||||
the last file in the argument list has not been
|
||||
@@ -1391,6 +1451,11 @@ It is also possible that you modified the file yourself, from another edit
|
||||
session or with another command (e.g., a filter command). Then you will know
|
||||
which version of the file you want to keep.
|
||||
|
||||
There is one situation where you get the message while there is nothing wrong:
|
||||
On a Win32 system on the day daylight saving time starts. There is something
|
||||
in the Win32 libraries that confuses Vim about the hour time difference. The
|
||||
problem goes away the next day.
|
||||
|
||||
==============================================================================
|
||||
11. File Searching *file-searching*
|
||||
|
||||
@@ -1399,9 +1464,9 @@ which version of the file you want to keep.
|
||||
The file searching is currently used for the 'path', 'cdpath' and 'tags'
|
||||
options. There are three different types of searching:
|
||||
|
||||
1) Downward search:
|
||||
1) Downward search: *starstar*
|
||||
Downward search uses the wildcards '*', '**' and possibly others
|
||||
supported by your operating system. '*' and '**' are handled inside Vim, so
|
||||
supported by your operating system. '*' and '**' are handled inside Vim, so
|
||||
they work on all operating systems.
|
||||
|
||||
The usage of '*' is quite simple: It matches 0 or more characters.
|
||||
@@ -1435,10 +1500,10 @@ options. There are three different types of searching:
|
||||
|
||||
2) Upward search:
|
||||
Here you can give a directory and then search the directory tree upward for
|
||||
a file. You could give stop-directories to limit the upward search. The
|
||||
a file. You could give stop-directories to limit the upward search. The
|
||||
stop-directories are appended to the path (for the 'path' option) or to
|
||||
the filename (for the 'tags' option) with a ';'. If you want several
|
||||
stop-directories separate them with ';'. If you want no stop-directory
|
||||
the filename (for the 'tags' option) with a ';'. If you want several
|
||||
stop-directories separate them with ';'. If you want no stop-directory
|
||||
("search upward till the root directory) just use ';'. >
|
||||
/usr/include/sys;/usr
|
||||
< will search in: >
|
||||
@@ -1457,7 +1522,7 @@ options. There are three different types of searching:
|
||||
/u/user_x/work/include
|
||||
/u/user_x/include
|
||||
|
||||
3) Combined up/downward search
|
||||
3) Combined up/downward search:
|
||||
If Vim's current path is /u/user_x/work/release and you do >
|
||||
set path=**;/u/user_x
|
||||
< and then search for a file with |gf| the file is searched in: >
|
||||
@@ -1465,10 +1530,10 @@ options. There are three different types of searching:
|
||||
/u/user_x/work/**
|
||||
/u/user_x/**
|
||||
<
|
||||
BE CAREFUL! This might consume a lot of time, as the search of
|
||||
BE CAREFUL! This might consume a lot of time, as the search of
|
||||
'/u/user_x/**' includes '/u/user_x/work/**' and
|
||||
'/u/user_x/work/release/**'. So '/u/user_x/work/release/**' is searched
|
||||
three and '/u/user_x/work/**' is searched two times.
|
||||
three times and '/u/user_x/work/**' is searched twice.
|
||||
|
||||
In the above example you might want to set path to: >
|
||||
:set path=**,/u/user_x/**
|
||||
|
||||
1550
runtime/doc/eval.txt
1550
runtime/doc/eval.txt
File diff suppressed because it is too large
Load Diff
56
runtime/doc/evim-fr.1
Normal file
56
runtime/doc/evim-fr.1
Normal file
@@ -0,0 +1,56 @@
|
||||
.TH EVIM 1 "16 f<>vrier 2002 February 16"
|
||||
.SH NAME
|
||||
evim \- <20> Easy Vim <20>, <20>dite un fichier avec Vim sans utiliser les modes
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B evim
|
||||
[options] [fichier ...]
|
||||
.br
|
||||
.B eview
|
||||
.SH DESCRIPTION
|
||||
.B eVim
|
||||
lance
|
||||
.B Vim
|
||||
et configure ses options afin qu'il se comporte comme un <20>diteur sans mode.
|
||||
Cela reste Vim, mais vous pouvez l'utiliser comme un <20>diteur <20> cliquer-taper <20>.
|
||||
Cela ressemble beaucoup <20> l'<27>dition avec Notepad sur MS-Windows.
|
||||
.B eVim
|
||||
ne fonctionne qu'avec l'interface graphique, qui est n<>cessaire pour permettre
|
||||
l'utilisation des menus et de la barre d'outils.
|
||||
.PP
|
||||
Il n'est utile qu'aux personnes qui ne parviennent vraiment pas <20> utiliser Vim
|
||||
de fa<66>on traditionnelle. L'<27>dition est alors bien moins efficace.
|
||||
.PP
|
||||
.B eview
|
||||
fait la m<>me chose, mais d<>marre Vim en mode Lecture-seule.
|
||||
Cela revient <20> lancer evim \-R.
|
||||
.PP
|
||||
Voir vim(1) pour davantage d'informations sur Vim, les options, etc.
|
||||
.PP
|
||||
L'option 'insertmode' est activ<69>e pour permettre de taper directement du texte.
|
||||
.br
|
||||
Les mappages sont configur<75>s pour que Copier et Coller fonctionnent avec les
|
||||
raccourcis habituels de MS-Windows. CTRL-X coupe le texte, CTRL-C copie le
|
||||
texte et CTRL-V colle le texte.
|
||||
Vous pouvez utiliser CTRL-Q pour obtenir la fonction originale de CTRL-V.
|
||||
.SH OPTIONS
|
||||
Voir vim(1).
|
||||
.SH FICHIERS
|
||||
.TP 15
|
||||
/usr/local/lib/vim/evim.vim
|
||||
Le script charg<72> pour initialiser eVim.
|
||||
.SH AUSSI CONNU SOUS
|
||||
<EFBFBD>galement connu sous le nom <20> Vim pour gumbies <20> [N.D.T. : Flying Circus...].
|
||||
Quand vous utilisez eVim, vous <20>tes cens<6E> prendre un mouchoir de poche,
|
||||
faire un noeud <20> chaque coin et le porter sur votre t<>te.
|
||||
.SH VOIR AUSSI
|
||||
vim(1)
|
||||
.SH AUTEUR
|
||||
La majeure partie de
|
||||
.B Vim
|
||||
a <20>t<EFBFBD> <20>crite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs.
|
||||
Voir le menu Aide/Remerciements ou ":help credits" dans
|
||||
.B Vim.
|
||||
.SH TRADUCTION
|
||||
Cette page de manuel a <20>t<EFBFBD> traduite David Blanchet.
|
||||
<david.blanchet@free.fr> 2005-03-26.
|
||||
56
runtime/doc/evim-fr.UTF-8.1
Normal file
56
runtime/doc/evim-fr.UTF-8.1
Normal file
@@ -0,0 +1,56 @@
|
||||
.TH EVIM 1 "16 février 2002 February 16"
|
||||
.SH NAME
|
||||
evim \- « Easy Vim », édite un fichier avec Vim sans utiliser les modes
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B evim
|
||||
[options] [fichier ...]
|
||||
.br
|
||||
.B eview
|
||||
.SH DESCRIPTION
|
||||
.B eVim
|
||||
lance
|
||||
.B Vim
|
||||
et configure ses options afin qu'il se comporte comme un éditeur sans mode.
|
||||
Cela reste Vim, mais vous pouvez l'utiliser comme un éditeur « cliquer-taper ».
|
||||
Cela ressemble beaucoup à l'édition avec Notepad sur MS-Windows.
|
||||
.B eVim
|
||||
ne fonctionne qu'avec l'interface graphique, qui est nécessaire pour permettre
|
||||
l'utilisation des menus et de la barre d'outils.
|
||||
.PP
|
||||
Il n'est utile qu'aux personnes qui ne parviennent vraiment pas à utiliser Vim
|
||||
de façon traditionnelle. L'édition est alors bien moins efficace.
|
||||
.PP
|
||||
.B eview
|
||||
fait la même chose, mais démarre Vim en mode Lecture-seule.
|
||||
Cela revient à lancer evim \-R.
|
||||
.PP
|
||||
Voir vim(1) pour davantage d'informations sur Vim, les options, etc.
|
||||
.PP
|
||||
L'option 'insertmode' est activée pour permettre de taper directement du texte.
|
||||
.br
|
||||
Les mappages sont configurés pour que Copier et Coller fonctionnent avec les
|
||||
raccourcis habituels de MS-Windows. CTRL-X coupe le texte, CTRL-C copie le
|
||||
texte et CTRL-V colle le texte.
|
||||
Vous pouvez utiliser CTRL-Q pour obtenir la fonction originale de CTRL-V.
|
||||
.SH OPTIONS
|
||||
Voir vim(1).
|
||||
.SH FICHIERS
|
||||
.TP 15
|
||||
/usr/local/lib/vim/evim.vim
|
||||
Le script chargé pour initialiser eVim.
|
||||
.SH AUSSI CONNU SOUS
|
||||
Également connu sous le nom « Vim pour gumbies » [N.D.T. : Flying Circus...].
|
||||
Quand vous utilisez eVim, vous êtes censé prendre un mouchoir de poche,
|
||||
faire un noeud à chaque coin et le porter sur votre tête.
|
||||
.SH VOIR AUSSI
|
||||
vim(1)
|
||||
.SH AUTEUR
|
||||
La majeure partie de
|
||||
.B Vim
|
||||
a été écrite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs.
|
||||
Voir le menu Aide/Remerciements ou ":help credits" dans
|
||||
.B Vim.
|
||||
.SH TRADUCTION
|
||||
Cette page de manuel a été traduite David Blanchet.
|
||||
<david.blanchet@free.fr> 2005-03-26.
|
||||
53
runtime/doc/evim-pl.1
Normal file
53
runtime/doc/evim-pl.1
Normal file
@@ -0,0 +1,53 @@
|
||||
.TH EVIM 1 "2002 Lut 16"
|
||||
.SH NAZWA
|
||||
evim \- <20>atwy Vim, edytuj plik w Vimie z ustawieniami dla edycji bez
|
||||
tryb<EFBFBD>w
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B evim
|
||||
[opcje] [plik ...]
|
||||
.br
|
||||
.B eview
|
||||
.SH OPIS
|
||||
.B eVim
|
||||
uruchamia
|
||||
.B Vima
|
||||
i ustawia opcje tak by zachowywa<77> si<73> jak edytor bez tryb<79>w.
|
||||
To jest ca<63>y czas Vim ale u<>ywany jako edytor wska<6B>-i-kliknij.
|
||||
Zachowanie w stlu Notepada dla MS-Windows.
|
||||
.B eVim
|
||||
b<EFBFBD>dzie zawsze uruchomiony w GUI by w<><77>czy<7A> menu i pasek narz<72>dzi.
|
||||
.PP
|
||||
Przeznaczony tylko dla ludzi, kt<6B>rzy naprawd<77> nie potrafi<66> pracowa<77>
|
||||
z Vimem w normalny spos<6F>b. Edycja b<>dzie o wiele mniej efektywna.
|
||||
.PP
|
||||
.B eview
|
||||
dzia<EFBFBD>a tak samo, ale zaczyna w trybie tylko do odczytu. Dzia<69>a tak
|
||||
samo jak evim \-R.
|
||||
.PP
|
||||
Zobacz vim(1) by pozna<6E> wi<77>cej szczeg<65><67><EFBFBD>w o Vimie, opcjach, itd.
|
||||
.PP
|
||||
Opcja 'insertmode' jest ustawiona by mo<6D>na by<62>o od razu wpisywa<77>
|
||||
tekst.
|
||||
.br
|
||||
Mapowania s<> ustawione tak by Kopiowanie i Wklejanie dzia<69>a<EFBFBD>o
|
||||
z klawiszami MS-Windows. CTRL-X wycina tekst, CTRL-C kopiuje
|
||||
a CTRL-V wkleja. U<>yj CTRL-Q by uzyska<6B> oryginalne znaczenie
|
||||
CTRL-V.
|
||||
.SH OPCJE
|
||||
Zobacz vim(1).
|
||||
.SH PLIKI
|
||||
.TP 15
|
||||
/usr/local/lib/vim/evim.vim
|
||||
Skrypt uruchamiania dla eVima.
|
||||
.SH ZNANY JAKO
|
||||
Znany jako "Vim dla frajer<65>w".
|
||||
Je<EFBFBD>li u<>ywasz evima oczekuje si<73>, <20>e wyjmiesz chusteczk<7A> do nosa,
|
||||
zrobisz w<>z<EFBFBD><7A> w ka<6B>dym rogu i b<>dziesz to nosi<73> na g<>owie.
|
||||
.SH ZOBACZ TAK<EFBFBD>E
|
||||
vim(1)
|
||||
.SH AUTOR
|
||||
Wi<EFBFBD>kszo<EFBFBD><EFBFBD>
|
||||
.B Vima
|
||||
zosta<EFBFBD>a napisana przez Brama Moolenaara z du<64><75> pomoc<6F> innych os<6F>b.
|
||||
Zobacz menu Help/Credits.
|
||||
53
runtime/doc/evim-pl.UTF-8.1
Normal file
53
runtime/doc/evim-pl.UTF-8.1
Normal file
@@ -0,0 +1,53 @@
|
||||
.TH EVIM 1 "2002 Lut 16"
|
||||
.SH NAZWA
|
||||
evim \- łatwy Vim, edytuj plik w Vimie z ustawieniami dla edycji bez
|
||||
trybów
|
||||
.SH SYNOPSIS
|
||||
.br
|
||||
.B evim
|
||||
[opcje] [plik ...]
|
||||
.br
|
||||
.B eview
|
||||
.SH OPIS
|
||||
.B eVim
|
||||
uruchamia
|
||||
.B Vima
|
||||
i ustawia opcje tak by zachowywał się jak edytor bez trybów.
|
||||
To jest cały czas Vim ale używany jako edytor wskaż-i-kliknij.
|
||||
Zachowanie w stlu Notepada dla MS-Windows.
|
||||
.B eVim
|
||||
będzie zawsze uruchomiony w GUI by włączyć menu i pasek narzędzi.
|
||||
.PP
|
||||
Przeznaczony tylko dla ludzi, którzy naprawdę nie potrafią pracować
|
||||
z Vimem w normalny sposób. Edycja będzie o wiele mniej efektywna.
|
||||
.PP
|
||||
.B eview
|
||||
działa tak samo, ale zaczyna w trybie tylko do odczytu. Działa tak
|
||||
samo jak evim \-R.
|
||||
.PP
|
||||
Zobacz vim(1) by poznać więcej szczegółów o Vimie, opcjach, itd.
|
||||
.PP
|
||||
Opcja 'insertmode' jest ustawiona by można było od razu wpisywać
|
||||
tekst.
|
||||
.br
|
||||
Mapowania są ustawione tak by Kopiowanie i Wklejanie działało
|
||||
z klawiszami MS-Windows. CTRL-X wycina tekst, CTRL-C kopiuje
|
||||
a CTRL-V wkleja. Użyj CTRL-Q by uzyskać oryginalne znaczenie
|
||||
CTRL-V.
|
||||
.SH OPCJE
|
||||
Zobacz vim(1).
|
||||
.SH PLIKI
|
||||
.TP 15
|
||||
/usr/local/lib/vim/evim.vim
|
||||
Skrypt uruchamiania dla eVima.
|
||||
.SH ZNANY JAKO
|
||||
Znany jako "Vim dla frajerów".
|
||||
Jeśli używasz evima oczekuje się, że wyjmiesz chusteczkę do nosa,
|
||||
zrobisz węzęł w każdym rogu i będziesz to nosił na głowie.
|
||||
.SH ZOBACZ TAKŻE
|
||||
vim(1)
|
||||
.SH AUTOR
|
||||
Większość
|
||||
.B Vima
|
||||
została napisana przez Brama Moolenaara z dużą pomocą innych osób.
|
||||
Zobacz menu Help/Credits.
|
||||
@@ -1,4 +1,4 @@
|
||||
*farsi.txt* For Vim version 7.0aa. Last change: 2004 Jun 16
|
||||
*farsi.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Mortaza Ghassab Shiran
|
||||
@@ -42,7 +42,7 @@ o Changing keyboard mapping and reverse insert modes using a single
|
||||
o Backing from reverse insert mode to the correct place in the file
|
||||
(if possible).
|
||||
|
||||
o While in Farsi mode, numbers are entered from left to right. Upon entering
|
||||
o While in Farsi mode, numbers are entered from left to right. Upon entering
|
||||
a none number character, that character will be inserted just into the
|
||||
left of the last number.
|
||||
|
||||
@@ -54,8 +54,8 @@ o Farsi keymapping on the command line in reverse insert mode.
|
||||
|
||||
o Toggling between left-to-right and right-to-left via F8 function key.
|
||||
|
||||
o Toggling between Farsi ISIR-3342 standard encoding and VIM Farsi via F9
|
||||
function key. Since this makes sense only for the text written in
|
||||
o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9
|
||||
function key. Since this makes sense only for the text written in
|
||||
right-to-left mode, this function is also supported only in right-to-left
|
||||
mode.
|
||||
|
||||
@@ -77,8 +77,8 @@ 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
|
||||
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.
|
||||
@@ -104,19 +104,19 @@ o Installation of fonts for X Window systems (SunOS)
|
||||
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
|
||||
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
|
||||
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
|
||||
-----
|
||||
Prior to starting VIM, the environment in which VIM can run in Farsi mode,
|
||||
Prior to starting Vim, the environment in which Vim can run in Farsi mode,
|
||||
must be set. In addition to installation of Farsi fonts, following points
|
||||
refer to some of the system environments, which you may need to set:
|
||||
Key code mapping, loading graphic card in ASCII screen mode, setting the IO
|
||||
@@ -124,26 +124,26 @@ driver in 8 bit clean mode ... .
|
||||
|
||||
o Setting the Farsi fonts
|
||||
|
||||
+ For VIM GUI set the 'guifont' to far-a01. This is done by entering
|
||||
':set guifont=far-a01' in the VIM window.
|
||||
+ For Vim GUI set the 'guifont' to far-a01. This is done by entering
|
||||
':set guifont=far-a01' in the Vim window.
|
||||
|
||||
You can have 'guifont' set to far-a01 by VIM during the VIM startup
|
||||
You can have 'guifont' set to far-a01 by Vim during the Vim startup
|
||||
by appending the ':set guifont=far-a01' into your .vimrc file
|
||||
(in case of NT/95/98 platforms _vimrc).
|
||||
|
||||
Under the X Window environment, you can also start the VIM with
|
||||
Under the X Window environment, you can also start Vim with the
|
||||
'-fn far-a01' option.
|
||||
|
||||
+ For the VIM within a xterm, start a xterm with the Farsi fonts (e.g.
|
||||
kterm -fn far-a01). Then start the VIM inside the kterm.
|
||||
+ For Vim within a xterm, start a xterm with the Farsi fonts (e.g.
|
||||
kterm -fn far-a01). Then start Vim inside the kterm.
|
||||
|
||||
+ For VIM under DOS, prior to the first usage of VIM, upload the Farsi
|
||||
+ For Vim under DOS, prior to the first usage of Vim, upload the Farsi
|
||||
fonts by executing the far-a01.com fonts uploading program.
|
||||
|
||||
o Farsi Keymapping Activation
|
||||
|
||||
To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'.
|
||||
This is done by entering ':set akm' or ':set fk' in the VIM window.
|
||||
This is done by entering ':set akm' or ':set fk' in the Vim window.
|
||||
You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm'
|
||||
or ':set fk' in your .vimrc file or _vimrc in case of NT/95/98 platforms.
|
||||
|
||||
@@ -152,24 +152,24 @@ o Farsi Keymapping Activation
|
||||
|
||||
o right-to-left Farsi Mode
|
||||
|
||||
By default VIM starts in Left-to-right mode. Following are ways to change
|
||||
By default Vim starts in Left-to-right mode. Following are ways to change
|
||||
the window orientation:
|
||||
|
||||
+ Start the VIM with -F option (e.g. vim -F ... ).
|
||||
+ Start Vim with the -F option (e.g. vim -F ...).
|
||||
|
||||
+ Use F8 function key to toggle between left-to-right and right-to-left.
|
||||
+ Use the F8 function key to toggle between left-to-right and right-to-left.
|
||||
|
||||
+ While in Left-to-right mode, enter 'set rl' in the command line ('rl' is
|
||||
the abbreviation for rightleft).
|
||||
|
||||
+ Put the 'set rl' line in your '.vimrc' file to start the VIM in
|
||||
+ Put the 'set rl' line in your '.vimrc' file to start Vim in
|
||||
right-to-left mode permanently.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
|
||||
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.
|
||||
The letter encoding used is the Vim extended ISIR-3342 standard with a built
|
||||
in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard.
|
||||
|
||||
For document portability reasons, the letter encoding is kept the same across
|
||||
different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
|
||||
@@ -183,11 +183,11 @@ o Keyboard
|
||||
+ CTRL-_ moves the cursor to the end of the typed text in edit mode.
|
||||
|
||||
+ CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/
|
||||
Latin. The Farsi text is then entered in reverse insert mode.
|
||||
Latin. The Farsi text is then entered in reverse insert mode.
|
||||
|
||||
+ F8 - Toggles between left-to-right and right-to-left.
|
||||
|
||||
+ F9 - Toggles the encoding between ISIR-3342 standard and VIM extended
|
||||
+ F9 - Toggles the encoding between ISIR-3342 standard and Vim extended
|
||||
ISIR-3342 (supported only in right-to-left mode).
|
||||
|
||||
+ Keyboard mapping is based on the Iranian ISIRI-2901 standard.
|
||||
@@ -231,28 +231,28 @@ o In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not
|
||||
supported.
|
||||
|
||||
o If you change the character mapping between Latin/Farsi, the redo buffer
|
||||
will be reset (emptied). That is, redo is valid and will function (using
|
||||
will be reset (emptied). That is, redo is valid and will function (using
|
||||
'.') only within the mode you are in.
|
||||
|
||||
o While numbers are entered in Farsi mode, the redo buffer will be reset
|
||||
(emptied). That is, you can not redo the last changes (using '.') after
|
||||
(emptied). That is, you cannot redo the last changes (using '.') after
|
||||
entering numbers.
|
||||
|
||||
o While in left-to-right and Farsi mode set, CTRL-R is not supported.
|
||||
o While in left-to-right mode and Farsi mode set, CTRL-R is not supported.
|
||||
|
||||
o While in right-to-left mode, the search on 'Latin' pattern does not work,
|
||||
except if you enter the Latin search pattern in reverse.
|
||||
|
||||
o In the command mode, there is no support for entering the numbers from left
|
||||
to right and also for the sake of the flexibility the keymapping logic is
|
||||
o In command mode there is no support for entering numbers from left
|
||||
to right and also for the sake of flexibility the keymapping logic is
|
||||
restricted.
|
||||
|
||||
o Under X Window environment, if you want to run the VIM within a xterm
|
||||
o Under the X Window environment, if you want to run Vim within a xterm
|
||||
terminal emulator and Farsi mode set, you need to have an ANSI compatible
|
||||
xterm terminal emulator. This is because the letter codes above 128 decimal
|
||||
xterm terminal emulator. This is because the letter codes above 128 decimal
|
||||
have certain meanings in the standard xterm terminal emulator.
|
||||
|
||||
Note: Under X Window environment, VIM GUI works fine in Farsi mode.
|
||||
Note: Under X Window environment, Vim GUI works fine in Farsi mode.
|
||||
This eliminates the need of any xterm terminal emulator.
|
||||
|
||||
|
||||
@@ -261,7 +261,7 @@ Bugs
|
||||
While in insert/replace and Farsi mode set, if you repeatedly change the
|
||||
cursor position (via cursor movement) and enter new text and then try to undo
|
||||
the last change, the undo will lag one change behind. But as you continue to
|
||||
undo, you will reach the original line of text. You can also use U to undo all
|
||||
undo, you will reach the original line of text. You can also use U to undo all
|
||||
changes made in the current line.
|
||||
|
||||
For more information about the bugs refer to rileft.txt.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*filetype.txt* For Vim version 7.0aa. Last change: 2004 Aug 31
|
||||
*filetype.txt* For Vim version 7.0b. Last change: 2006 Mar 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -44,15 +44,21 @@ Detail: The ":filetype on" command will load one of these files:
|
||||
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||
contents of the file.
|
||||
|
||||
To add your own file types, see |new-filetype| below.
|
||||
To add your own file types, see |new-filetype| below. To search for help on a
|
||||
filetype prepend "ft-" and optionally append "-syntax", "-indent" or
|
||||
"-plugin". For example: >
|
||||
:help ft-vim-indent
|
||||
:help ft-vim-syntax
|
||||
:help ft-man-plugin
|
||||
|
||||
If the file type is not detected automatically, or it finds the wrong type,
|
||||
you can either set the 'filetype' option manually, or add a modeline to your
|
||||
file. Example, for in an IDL file use the command: >
|
||||
:set filetype=idl
|
||||
or add this |modeline| to the file: >
|
||||
/* vim: set filetype=idl : */
|
||||
<
|
||||
|
||||
or add this |modeline| to the file:
|
||||
/* vim: set filetype=idl : */ ~
|
||||
|
||||
*:filetype-plugin-on*
|
||||
You can enable loading the plugin files for specific file types with: >
|
||||
:filetype plugin on
|
||||
@@ -132,16 +138,17 @@ kind of file it is. This doesn't always work. A number of global variables
|
||||
can be used to overrule the filetype used for certain extensions:
|
||||
|
||||
file name variable ~
|
||||
*.asa g:filetype_asa |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asp g:filetype_asp |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asm g:asmsyntax |asm-syntax|
|
||||
*.asa g:filetype_asa |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.asp g:filetype_asp |ft-aspvbs-syntax| |ft-aspperl-syntax|
|
||||
*.asm g:asmsyntax |ft-asm-syntax|
|
||||
*.prg g:filetype_prg
|
||||
*.pl g:filetype_pl
|
||||
*.inc g:filetype_inc
|
||||
*.w g:filetype_w |cweb-syntax|
|
||||
*.i g:filetype_i |progress-syntax|
|
||||
*.p g:filetype_p |pascal-syntax|
|
||||
*.sh g:bash_is_sh |sh-syntax|
|
||||
*.w g:filetype_w |ft-cweb-syntax|
|
||||
*.i g:filetype_i |ft-progress-syntax|
|
||||
*.p g:filetype_p |ft-pascal-syntax|
|
||||
*.sh g:bash_is_sh |ft-sh-syntax|
|
||||
*.tex g:tex_flavor |ft-tex-plugin|
|
||||
|
||||
*filetype-ignore*
|
||||
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
||||
@@ -178,7 +185,8 @@ A. If you want to overrule all default file type checks.
|
||||
< 3. To use the new filetype detection you must restart Vim.
|
||||
|
||||
The files in the "ftdetect" directory are used after all the default
|
||||
checks, thus they can overrule a previously detected file type.
|
||||
checks, thus they can overrule a previously detected file type. But you
|
||||
can also use |:setfiletype| to keep a previously detected filetype.
|
||||
|
||||
B. If you want to detect your file after the default file type checks.
|
||||
|
||||
@@ -380,9 +388,9 @@ ways to change this:
|
||||
3. Docs for the default filetype plugins. *ftplugin-docs*
|
||||
|
||||
|
||||
CHANGELOG *changelog-plugin*
|
||||
CHANGELOG *ft-changelog-plugin*
|
||||
|
||||
Allows for easy entrance of Changelog entries in Changelog files. There are
|
||||
Allows for easy entrance of Changelog entries in Changelog files. There are
|
||||
some commands, mappings, and variables worth exploring:
|
||||
|
||||
Options:
|
||||
@@ -401,7 +409,7 @@ Local mappings:
|
||||
Global mappings:
|
||||
NOTE: The global mappings are accessed by sourcing the
|
||||
ftplugin/changelog.vim file first, e.g. with >
|
||||
runtime ftplugin/man.vim
|
||||
runtime ftplugin/changelog.vim
|
||||
< in your |.vimrc|.
|
||||
<Leader>o Switches to the ChangeLog buffer opened for the
|
||||
current directory, or opens it in a new buffer if it
|
||||
@@ -462,11 +470,11 @@ g:changelog_date_entry_search
|
||||
The Changelog entries are inserted where they add the least amount of text.
|
||||
After figuring out the current date and user, the file is searched for an
|
||||
entry beginning with the current date and user and if found adds another item
|
||||
under it. If not found, a new entry and item is prepended to the beginning of
|
||||
under it. If not found, a new entry and item is prepended to the beginning of
|
||||
the Changelog.
|
||||
|
||||
|
||||
FORTRAN *fortran-plugin*
|
||||
FORTRAN *ft-fortran-plugin*
|
||||
|
||||
Options:
|
||||
'expandtab' is switched on to avoid tabs as required by the Fortran
|
||||
@@ -474,12 +482,12 @@ Options:
|
||||
'textwidth' is set to 72 for fixed source format as required by the
|
||||
Fortran standards and to 80 for free source format.
|
||||
'formatoptions' is set to break code and comment lines and to preserve long
|
||||
lines. You can format comments with |gq|.
|
||||
lines. You can format comments with |gq|.
|
||||
For further discussion of fortran_have_tabs and the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
detection of source format see |ft-fortran-syntax|.
|
||||
|
||||
|
||||
MAIL *mail-plugin*
|
||||
MAIL *ft-mail-plugin*
|
||||
|
||||
Options:
|
||||
'modeline' is switched off to avoid the danger of trojan horses, and to
|
||||
@@ -496,7 +504,7 @@ Local mappings:
|
||||
to the end of the file in Normal mode. This means "> " is inserted in
|
||||
each line.
|
||||
|
||||
MAN *man-plugin* *:Man*
|
||||
MAN *ft-man-plugin* *:Man*
|
||||
|
||||
Displays a manual page in a nice way. Also see the user manual
|
||||
|find-manpage|.
|
||||
@@ -523,10 +531,28 @@ CTRL-] Jump to the manual page for the word under the cursor.
|
||||
CTRL-T Jump back to the previous manual page.
|
||||
|
||||
|
||||
RPM SPEC *spec-plugin*
|
||||
RPM SPEC *ft-spec-plugin*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
|
||||
|
||||
SQL *ft-sql*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |sql.txt|.
|
||||
|
||||
|
||||
TEX *ft-tex-plugin*
|
||||
|
||||
If the first line of a *.tex file has the form >
|
||||
%&<format>
|
||||
then this determined the file type: plaintex (for plain TeX), context (for
|
||||
ConTeXt), or tex (for LaTeX). Otherwise, the file is searched for keywords to
|
||||
choose context or tex. If no keywords are found, it defaults to plaintex.
|
||||
You can change the default by defining the variable g:tex_flavor to the format
|
||||
(not the file type) you use most: plain or context or latex. (Currently no
|
||||
other formats are recognized.)
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*fold.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
|
||||
*fold.txt* For Vim version 7.0b. Last change: 2005 Sep 10
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -330,7 +330,7 @@ zC Close all folds under the cursor recursively. Folds that
|
||||
'foldenable' will be set.
|
||||
|
||||
*za*
|
||||
za When on a closed fold: open it. When folds are nested, you
|
||||
za When on a closed fold: open it. When folds are nested, you
|
||||
may have to use "za" several times. When a count is given,
|
||||
that many closed folds are opened.
|
||||
When on an open fold: close it and set 'foldenable'. This
|
||||
@@ -512,7 +512,8 @@ FOLDCOLUMN *fold-foldcolumn*
|
||||
|
||||
'foldcolumn' is a number, which sets the width for a column on the side of the
|
||||
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
||||
value is 4 or 5. The minimal useful value is 2. The maximum is 12.
|
||||
value is 4 or 5. The minimal useful value is 2, although 1 still provides
|
||||
some information. The maximum is 12.
|
||||
|
||||
An open fold is indicated with a column that has a '-' at the top and '|'
|
||||
characters below it. This column stops where the open fold stops. When folds
|
||||
|
||||
303
runtime/doc/getscript.txt
Normal file
303
runtime/doc/getscript.txt
Normal file
@@ -0,0 +1,303 @@
|
||||
*getscript.txt* For Vim version 7.0b. Last change: 2006 Mar 24
|
||||
|
||||
Get the Latest VimScripts
|
||||
|
||||
Authors: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamilyA.Mbiz>
|
||||
(remove NOSPAM from the email address)
|
||||
*GetLatestVimScripts-copyright*
|
||||
Copyright: (c) 2004-2005 by Charles E. Campbell, Jr.
|
||||
The VIM LICENSE applies to GetLatestVimScripts.vim and
|
||||
GetLatestVimScripts.txt (see |copyright|) except use
|
||||
"GetLatestVimScripts" instead of "Vim".
|
||||
No warranty, express or implied. Use At-Your-Own-Risk.
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Contents *glvs-contents*
|
||||
|
||||
1. Contents.......................................: |glvs-contents|
|
||||
2. GetLatestVimScripts Usage......................: |glvs|
|
||||
3. GetLatestVimScripts Data File..................: |glvs-data|
|
||||
4. GetLatestVimScripts Plugins....................: |glvs-plugins|
|
||||
5. GetLatestVimScripts AutoInstall................: |glvs-autoinstall|
|
||||
6. GetLatestVimScripts Algorithm..................: |glvs-alg|
|
||||
7. GetLatestVimScripts History....................: |glvs-hist|
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. GetLatestVimScripts Usage *getlatestvimscripts* *getscript* *glvs*
|
||||
|
||||
While in vim, type
|
||||
>
|
||||
:GetLatestVimScripts
|
||||
<
|
||||
Unless its been defined elsewhere,
|
||||
>
|
||||
:GLVS
|
||||
<
|
||||
will also work.
|
||||
|
||||
The script will attempt to update and, if so directed, automatically
|
||||
install scripts from http://vim.sourceforge.net/. To do so it will
|
||||
peruse a file, [.vim|vimfiles]/GetLatest/GetLatestVimScripts.dat
|
||||
(see |glvs-data|), and examine plugins in your [.vim|vimfiles]/plugin
|
||||
directory (see |glvs-plugins|).
|
||||
|
||||
Scripts which have been downloaded will appear in the .../GetLatest
|
||||
subdirectory.
|
||||
|
||||
The <GetLatestVimScripts.dat> file will be automatically be updated to
|
||||
reflect the latest version of script(s) so downloaded.
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. GetLatestVimScripts Data File *getlatestvimscripts-data* *glvs-data*
|
||||
|
||||
The Data file has a header which should appear as:
|
||||
>
|
||||
ScriptID SourceID Filename
|
||||
--------------------------
|
||||
<
|
||||
Below that are three columns; the first two are numeric followed by a
|
||||
text column.
|
||||
|
||||
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.
|
||||
|
||||
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 its greater than the one stored in the
|
||||
GetLatestVimScripts.dat file, the script will be downloaded.
|
||||
|
||||
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.
|
||||
|
||||
If your comment field begins with :AutoInstall:, GetLatestVimScripts
|
||||
will attempt to automatically install the script. Thus,
|
||||
GetLatestVimScripts thus provides a comprehensive ability to keep your
|
||||
plugins up-to-date!
|
||||
|
||||
==============================================================================
|
||||
4. GetLatestVimScripts Plugins *getlatestvimscripts-plugins* *glvs-plugins*
|
||||
|
||||
|
||||
If a plugin author includes the following comment anywhere in their
|
||||
plugin, GetLatestVimScripts will find it and use it to build 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: at the start of
|
||||
"yourscriptname".
|
||||
|
||||
GetLatestVimScript commands for those scripts are then appended, if
|
||||
not already present, to the user's GetLatest/GetLatestVimScripts.dat
|
||||
file. Its 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 for you yourself, 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
|
||||
GetLatestVimScript 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 GetLatestVimScript
|
||||
comment!
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. GetLatestVimScripts AutoInstall *getlatestvimscripts-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 and untarred in [.vim|vimfiles] directory
|
||||
---.tar.gz : decompressed and untarred in [.vim|vimfiles] directory
|
||||
---.vim.bz2 : decompressed and moved to the .vim/plugin directory
|
||||
---.vim.gz : decompressed and moved to the .vim/plugin directory
|
||||
---.zip : unzipped in [.vim|vimfiles] directory
|
||||
---.vim : moved to [.vim|vimfiles]/plugin directory
|
||||
|
||||
and which merely need to have their components placed by the
|
||||
untar/gunzip or move-to-plugin-directory process should be
|
||||
auto-installable.
|
||||
|
||||
When is a script not auto-installable? Let me give an example:
|
||||
>
|
||||
[.vim|vimfiles]/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.
|
||||
|
||||
|
||||
==============================================================================
|
||||
6. GetLatestVimScripts Algorithm *getlatestvimscripts-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 its 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
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. GetLatestVimScripts History *getlatestvimscripts-history* *glvs-hist*
|
||||
|
||||
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
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui.txt* For Vim version 7.0aa. Last change: 2005 Jan 14
|
||||
*gui.txt* For Vim version 7.0b. Last change: 2006 Mar 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -24,9 +24,9 @@ Other GUI documentation:
|
||||
1. Starting the GUI *gui-start* *E229* *E233*
|
||||
|
||||
First you must make sure you actually have a version of Vim with the GUI code
|
||||
included. You can check this with the ":version" command, it should include
|
||||
"+GUI_Athena", "+GUI_BeOS", "+GUI_GTK", "+GUI_KDE", "+GUI_Motif" or
|
||||
"MS-Windows ... bit GUI version".
|
||||
included. You can check this with the ":version" command, it says "with xxx
|
||||
GUI", where "xxx" is X11-Motif, X11-Athena, Photon, GTK, GTK2, etc., or
|
||||
"MS-Windows 32 bit GUI version".
|
||||
|
||||
How to start the GUI depends on the system used. Mostly you can run the
|
||||
GUI version of Vim with:
|
||||
@@ -37,7 +37,8 @@ The X11 version of Vim can run both in GUI and in non-GUI mode. See
|
||||
|
||||
*gui-init* *gvimrc* *.gvimrc* *_gvimrc*
|
||||
When the GUI starts up initializations are carried out, in this order:
|
||||
- The termcap options are reset to their default value for the GUI.
|
||||
- The 'term' option is set to "builgin_gui" and terminal options are reset to
|
||||
their default value for the GUI |terminal-options|.
|
||||
- If the system menu file exists, it is sourced. The name of this file is
|
||||
normally "$VIMRUNTIME/menu.vim". You can check this with ":version". Also
|
||||
see |$VIMRUNTIME|. To skip loading the system menu include 'M' in
|
||||
@@ -79,7 +80,7 @@ All this happens AFTER the normal Vim initializations, like reading your
|
||||
But the GUI window is only opened after all the initializations have been
|
||||
carried out. If you want some commands to be executed just after opening the
|
||||
GUI window, use the |GUIEnter| autocommand event. Example: >
|
||||
:autocommand GUIEnter * winpos 100 50
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
|
||||
You can use the gvimrc files to set up your own customized menus (see |:menu|)
|
||||
and initialize other things that you may want to set up differently from the
|
||||
@@ -184,7 +185,7 @@ When the scrollbar is dragged all the way down, the last line of the file
|
||||
will appear in the top of the window.
|
||||
|
||||
If a window is shrunk to zero height (by the growth of another window) its
|
||||
scrollbar disappears. It reappears when the window is restored.
|
||||
scrollbar disappears. It reappears when the window is restored.
|
||||
|
||||
If a window is vertically split, it will get a scrollbar when it is the
|
||||
current window and when, taking the middle of the current window and drawing a
|
||||
@@ -408,7 +409,7 @@ used - you should read whichever of these is appropriate now).
|
||||
*clipboard*
|
||||
There is a special register for storing this selection, it is the "*
|
||||
register. Nothing is put in here unless the information about what text is
|
||||
selected is about to change (eg with a left mouse click somewhere), or when
|
||||
selected is about to change (e.g. with a left mouse click somewhere), or when
|
||||
another application wants to paste the selected text. Then the text is put
|
||||
in the "* register. For example, to cut a line and make it the current
|
||||
selection/put it on the clipboard: >
|
||||
@@ -498,13 +499,15 @@ floating menus that do not appear on the main menu bar.
|
||||
*:nme* *:nmenu* *:nnoreme* *:nnoremenu*
|
||||
*:ome* *:omenu* *:onoreme* *:onoremenu*
|
||||
*:vme* *:vmenu* *:vnoreme* *:vnoremenu*
|
||||
*:xme* *:xmenu* *:xnoreme* *:xnoremenu*
|
||||
*:sme* *:smenu* *:snoreme* *:snoremenu*
|
||||
*:ime* *:imenu* *:inoreme* *:inoremenu*
|
||||
*:cme* *:cmenu* *:cnoreme* *:cnoremenu*
|
||||
*E330* *E327* *E331* *E336* *E333*
|
||||
*E328* *E329* *E337*
|
||||
To create a new menu item, use the ":menu" commands. They are mostly like
|
||||
the ":map" set of commands but the first argument is a menu item name, given
|
||||
as a path of menus and submenus with a '.' between them. eg: >
|
||||
as a path of menus and submenus with a '.' between them, e.g.: >
|
||||
|
||||
:menu File.Save :w<CR>
|
||||
:inoremenu File.Save <C-O>:w<CR>
|
||||
@@ -648,9 +651,9 @@ simple.
|
||||
|
||||
*gui-toolbar*
|
||||
The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11),
|
||||
KDE and Photon GUI. It should turn up in other GUIs in due course. The default
|
||||
toolbar is setup in menu.vim.
|
||||
The display of the toolbar is controlled by the 'guioptions' letter 'T'. You
|
||||
KDE and Photon GUI. It should turn up in other GUIs in due course. The
|
||||
default toolbar is setup in menu.vim.
|
||||
The display of the toolbar is controlled by the 'guioptions' letter 'T'. You
|
||||
can thus have menu & toolbar together, or either on its own, or neither.
|
||||
The appearance is controlled by the 'toolbar' option. You can chose between
|
||||
an image, text or both.
|
||||
@@ -661,7 +664,7 @@ level. Vim interprets the items in this menu as follows:
|
||||
1) If an "icon=" argument was specified, the file with this name is used.
|
||||
The file can either be specified with the full path or with the base name.
|
||||
In the last case it is searched for in the "bitmaps" directory in
|
||||
'runtimepath', like in point 3). Examples: >
|
||||
'runtimepath', like in point 3. Examples: >
|
||||
:amenu icon=/usr/local/pixmaps/foo_icon.xpm ToolBar.Foo :echo "Foo"<CR>
|
||||
:amenu icon=FooIcon ToolBar.Foo :echo "Foo"<CR>
|
||||
< Note that in the first case the extension is included, while in the second
|
||||
@@ -671,7 +674,7 @@ level. Vim interprets the items in this menu as follows:
|
||||
A menu priority must come _after_ the icon argument: >
|
||||
:amenu icon=foo 1.42 ToolBar.Foo :echo "42!"<CR>
|
||||
2) An item called 'BuiltIn##', where ## is a number, is taken as number ## of
|
||||
the built-in bitmaps available in Vim. Currently there are 31 numbered
|
||||
the built-in bitmaps available in Vim. Currently there are 31 numbered
|
||||
from 0 to 30 which cover most common editing operations |builtin-tools|. >
|
||||
:amenu ToolBar.BuiltIn22 :call SearchNext("back")<CR>
|
||||
3) An item with another name is first searched for in the directory
|
||||
@@ -736,9 +739,9 @@ from the main menu bar. You must then use the |:popup| or |:tearoff| command
|
||||
to display it.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, KDE, GTK+, Motif, Athena and Photon GUI, you can define the special
|
||||
menu "PopUp". This is the menu that is displayed when the right mouse button
|
||||
is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
In the Win32, KDE, GTK+, Motif, Athena and Photon GUI, you can define the
|
||||
special menu "PopUp". This is the menu that is displayed when the right mouse
|
||||
button is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
|
||||
|
||||
5.3 Showing What Menus Are Mapped To *showing-menus*
|
||||
@@ -747,7 +750,7 @@ To see what an existing menu is mapped to, use just one argument after the
|
||||
menu commands (just like you would with the ":map" commands). If the menu
|
||||
specified is a submenu, then all menus under that hierarchy will be shown.
|
||||
If no argument is given after :menu at all, then ALL menu items are shown
|
||||
for the appropriate mode (eg, Command-line mode for :cmenu).
|
||||
for the appropriate mode (e.g., Command-line mode for :cmenu).
|
||||
|
||||
Special characters in the list, just before the rhs:
|
||||
* The menu was defined with "nore" to disallow remapping.
|
||||
@@ -786,6 +789,8 @@ using the last visual selection.
|
||||
*:nunme* *:nunmenu*
|
||||
*:ounme* *:ounmenu*
|
||||
*:vunme* *:vunmenu*
|
||||
*:xunme* *:xunmenu*
|
||||
*:sunme* *:sunmenu*
|
||||
*:iunme* *:iunmenu*
|
||||
*:cunme* *:cunmenu*
|
||||
To delete a menu item or a whole submenu, use the unmenu commands, which are
|
||||
@@ -856,7 +861,7 @@ See section |42.4| in the user manual.
|
||||
|
||||
When a tip is defined for a menu item, it appears in the command-line area
|
||||
when the mouse is over that item, much like a standard Windows menu hint in
|
||||
the status bar. (Except when Vim is in Command-line mode, when of course
|
||||
the status bar. (Except when Vim is in Command-line mode, when of course
|
||||
nothing is displayed.)
|
||||
When a tip is defined for a ToolBar item, it appears as a tooltip when the
|
||||
mouse pauses over that button, in the usual fashion. Use the |hl-Tooltip|
|
||||
@@ -870,7 +875,7 @@ The tip is defined like this: >
|
||||
And delete it with: >
|
||||
:tunmenu MyMenu.Hello
|
||||
|
||||
Tooltips are currently only supported for the X11 and Win32 GUI. However, they
|
||||
Tooltips are currently only supported for the X11 and Win32 GUI. However, they
|
||||
should appear for the other gui platforms in the not too distant future.
|
||||
|
||||
The ":tmenu" command works just like other menu commands, it uses the same
|
||||
@@ -897,9 +902,13 @@ it behaves in a strange way.
|
||||
appear on the menu-bar (see |hidden-menus|).
|
||||
{only available for Win32 and GTK GUI}
|
||||
|
||||
:popu[p]! {name} Like above, but use the position of the mouse
|
||||
pointer instead of the cursor.
|
||||
|
||||
Example: >
|
||||
:popup File
|
||||
will make the "File" menu (if there is one) appear at the text cursor. >
|
||||
will make the "File" menu (if there is one) appear at the text cursor (mouse
|
||||
pointer if ! was used). >
|
||||
|
||||
:amenu ]Toolbar.Make :make<CR>
|
||||
:popup ]Toolbar
|
||||
@@ -920,7 +929,7 @@ This section describes other features which are related to the GUI.
|
||||
get "<Modifiers-Key>".
|
||||
|
||||
- In the GUI, the modifiers SHIFT, CTRL, and ALT (or META) may be used within
|
||||
mappings of special keys and mouse events. eg: :map <M-LeftDrag> <LeftDrag>
|
||||
mappings of special keys and mouse events. E.g.: :map <M-LeftDrag> <LeftDrag>
|
||||
|
||||
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
||||
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
||||
@@ -950,6 +959,9 @@ This section describes other features which are related to the GUI.
|
||||
endif
|
||||
endif
|
||||
|
||||
A recommended Japanese font is MS Mincho. You can find info here:
|
||||
http://www.lexikan.com/mincho.htm
|
||||
|
||||
==============================================================================
|
||||
7. Shell Commands *gui-shell*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_w16.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
|
||||
*gui_w16.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -21,32 +21,32 @@ Other relevant documentation:
|
||||
|
||||
{Vi does not have a Windows GUI}
|
||||
|
||||
The Win16 version of Vim will run on Windows 3.1 or later. It has not been
|
||||
The Win16 version of Vim will run on Windows 3.1 or later. It has not been
|
||||
tested on 3.0, it probably won't work without being recompiled and
|
||||
modified. (but you really should upgrade to 3.11 anyway. :)
|
||||
modified. (But you really should upgrade to 3.11 anyway. :)
|
||||
|
||||
In most respects it behaves identically to the Win32 GUI version, including
|
||||
having a flat-style toolbar(!). The chief differences:
|
||||
having a flat-style toolbar(!). The chief differences:
|
||||
|
||||
1) Bold/Italic text is not available, to speed up repaint/reduce resource
|
||||
usage. (You can re-instate this by undefining MSWIN16_FASTTEXT.)
|
||||
usage. (You can re-instate this by undefining MSWIN16_FASTTEXT.)
|
||||
2) No tearoff menu emulation.
|
||||
3) No OLE interface.
|
||||
4) No long filename support (of course)
|
||||
4) No long filename support (of course).
|
||||
5) No tooltips on toolbar buttons - instead they produce command-line tips
|
||||
like menu items do.
|
||||
6) Line length limited to 32767 characters (like 16-bit DOS version)
|
||||
6) Line length limited to 32767 characters (like 16-bit DOS version).
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *win16-start*
|
||||
|
||||
The Win16 GUI version of Vim will always start the GUI, no matter how you
|
||||
start it or what it's called. There is no 'console' version as such, but you
|
||||
start it or what it's called. There is no 'console' version as such, but you
|
||||
can use one of the DOS versions in a DOS box.
|
||||
|
||||
The Win16 GUI has an extra menu item: "Window/Select Font". It brings up the
|
||||
standard Windows font selector. Note that bold and italic fonts are not
|
||||
standard Windows font selector. Note that bold and italic fonts are not
|
||||
supported in an attempt to maximize GDI drawing speed.
|
||||
|
||||
Setting the menu height doesn't work for the Win16 GUI.
|
||||
@@ -82,7 +82,7 @@ The clipboard works in the same way as the Win32 version: see |gui-clipboard|.
|
||||
4. Shell Commands *win16-shell*
|
||||
|
||||
Vim spawns a DOS window for external commands, to make it possible to run any
|
||||
DOS command. The window uses the _default.pif settings.
|
||||
DOS command. The window uses the _default.pif settings.
|
||||
|
||||
*win16-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
@@ -135,7 +135,7 @@ as the traditional interface shared with the console version.
|
||||
6.1 Dialogs
|
||||
|
||||
The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|
||||
|:confirm| command and |confirm()| function are GUI-based rather than the
|
||||
|:confirm| command and |confirm()| function) are GUI-based rather than the
|
||||
console-based ones used by other versions. There is no option to change this.
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ PrintFile. See $VIMRUNTIME/menu.vim for how it works by default.
|
||||
Using this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
Also see |:simalt|
|
||||
|
||||
@@ -176,11 +176,11 @@ names with any Ex command.
|
||||
|
||||
*win16-truetype*
|
||||
It is recommended that you use a raster font and not a TrueType
|
||||
fixed-pitch font. e.g. Use Courier, not Courier New. This is not just
|
||||
fixed-pitch font. E.g. use Courier, not Courier New. This is not just
|
||||
to use less resources but because there are subtle bugs in the
|
||||
handling of fixed-pitch TrueType in Win3.1x. In particular, when you move
|
||||
handling of fixed-pitch TrueType in Win3.1x. In particular, when you move
|
||||
a block cursor over a pipe character '|', the cursor is drawn in the wrong
|
||||
size and bits get left behind. This is a bug in the Win3.1x GDI, it doesn't
|
||||
size and bits get left behind. This is a bug in the Win3.1x GDI, it doesn't
|
||||
happen if you run the exe under 95/NT.
|
||||
|
||||
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_w32.txt* For Vim version 7.0aa. Last change: 2005 Feb 14
|
||||
*gui_w32.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -58,7 +58,7 @@ of Windows 3.1 or 3.11. See |win32s|.
|
||||
|
||||
To set Vim as the default editor for a file type:
|
||||
1. Start a Windows Explorer
|
||||
2. Chose View/Options -> File Types
|
||||
2. Choose View/Options -> File Types
|
||||
3. Select the path to gvim for every file type that you want to use it for.
|
||||
(you can also use three spaces in the file type field, for files without an
|
||||
extension).
|
||||
@@ -262,8 +262,8 @@ question if you really want to kill the application, Vim may be killed too!
|
||||
|
||||
In Windows 95, the window in which the commands are executed is always 25x80
|
||||
characters, to be as DOS compatible as possible (this matters!). The default
|
||||
system font is used. On NT, the window will be the default you have set up for
|
||||
"Console" in Control Panel. On Win32s, the properties of the DOS box are
|
||||
system font is used. On NT, the window will be the default you have set up for
|
||||
"Console" in Control Panel. On Win32s, the properties of the DOS box are
|
||||
determined by _default.pif in the windows directory.
|
||||
|
||||
*msdos-mode*
|
||||
@@ -283,7 +283,7 @@ sense for most shell commands which produce output for Vim to use). If you
|
||||
want Vim to start a program and return immediately, you can use the following
|
||||
syntax on W95 & NT: >
|
||||
:!start {command}
|
||||
On Win32s, you will have to go to another window instead. Don't forget that
|
||||
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.
|
||||
|
||||
@@ -295,7 +295,7 @@ On Win32, the normal DOS colors can be used. See |dos-colors|.
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored. note: On Win32s not all of these colors are supported.
|
||||
ignored. Note: On Win32s not all of these colors are supported.
|
||||
|
||||
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
||||
@@ -366,7 +366,7 @@ without having to go to the menu bar each time.
|
||||
This is most useful if you find yourself using a command buried in a sub-menu
|
||||
over and over again.
|
||||
The tearoff menus can be positioned where you like, and always stay just above
|
||||
the Main Vim window. You can get rid of them by closing them as usual; they
|
||||
the Main Vim window. You can get rid of them by closing them as usual; they
|
||||
also of course close when you exit Vim.
|
||||
|
||||
*:tearoff* *:te*
|
||||
@@ -400,7 +400,7 @@ The rules are:
|
||||
b) Parameters are separated by white space.
|
||||
c) A parameter can be enclosed in double quotes to include white space.
|
||||
d) A sequence of zero or more backslashes (\) and a double quote (")
|
||||
is special. The effective number of backslashes is halved, rounded
|
||||
is special. The effective number of backslashes is halved, rounded
|
||||
down. An even number of backslashes reverses the acceptability of
|
||||
spaces and tabs, an odd number of backslashes produces a literal
|
||||
double quote.
|
||||
@@ -429,7 +429,7 @@ The "File/Print" menu prints the text with syntax highlighting, see
|
||||
printer installed this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
|
||||
*drag-n-drop-win32*
|
||||
@@ -441,7 +441,7 @@ be opened as normal. See |drag-n-drop|.
|
||||
{not in Vi} {only for Win32 versions}
|
||||
|
||||
Normally, Vim takes control of all Alt-<Key> combinations, to increase the
|
||||
number of possible mappings. This clashes with the standard use of Alt as the
|
||||
number of possible mappings. This clashes with the standard use of Alt as the
|
||||
key for accessing menus.
|
||||
The quick way of getting standard behavior is to set the 'winaltkeys' option
|
||||
to "yes". This however prevents you from mapping Alt keys at all.
|
||||
@@ -449,18 +449,18 @@ Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
|
||||
handled by windows, other ALT keys can be mapped. This doesn't allow a
|
||||
dependency on the current state though.
|
||||
To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
|
||||
"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
|
||||
"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
|
||||
combinations (or anything else for that matter) to produce standard Windows
|
||||
actions. Here are some examples: >
|
||||
actions. Here are some examples: >
|
||||
|
||||
:map <M-f> :simalt f<CR>
|
||||
This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
|
||||
simulating the keystrokes Alt, F. >
|
||||
:map <M-Space> :simalt ~<CR>
|
||||
This maps Alt-Space to pop down the system menu for the Vim window. Note that
|
||||
This maps Alt-Space to pop down the system menu for the Vim window. Note that
|
||||
~ is used by simalt to represent the <Space> character. >
|
||||
:map <C-n> :simalt ~n<CR>
|
||||
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
|
||||
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
|
||||
Vim window via the system menu.
|
||||
|
||||
*intellimouse-wheel-problems*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*gui_x11.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
|
||||
*gui_x11.txt* For Vim version 7.0b. Last change: 2005 Dec 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -113,7 +113,7 @@ same. Note that some fonts that have the same point size don't have the same
|
||||
pixel size! Additionally, the positioning of the fonts must be the same
|
||||
(ascent and descent). You can check this with "xlsfonts -l {fontname}".
|
||||
|
||||
If any of these things are also set with Vim commands, eg with
|
||||
If any of these things are also set with Vim commands, e.g. with
|
||||
":set guifont=Screen15", then this will override the X resources (currently
|
||||
'guifont' is the only option that is supported).
|
||||
|
||||
@@ -437,59 +437,9 @@ command line argument).
|
||||
==============================================================================
|
||||
7. KDE version *gui-kde* *kde* *KDE* *KVim*
|
||||
|
||||
NOTE: The KDE version is still under development. It is not recommended for
|
||||
daily work.
|
||||
|
||||
The KDE version of Vim works with KDE 2.x and KDE 3.x.
|
||||
KVim (name code for gui-kde) does not use traditional X settings for its
|
||||
configuration.
|
||||
Most important difference is the font handling, KVim uses QFont to display the
|
||||
text. To set your font use the following syntax :
|
||||
>
|
||||
:set guifont=Fixed\ [Misc]/10/-1/5/50/0/0/0/1/0
|
||||
<
|
||||
the '10' value is the font size, other settings concerns more specific Qt
|
||||
options which you should not need to care with.
|
||||
The suggested way to choose your font is through the font selection dialog
|
||||
available with the command :
|
||||
:set guifont=*
|
||||
|
||||
Note: X Font names are not supported any more, so if you use GVim too, you'll
|
||||
have to set something like this in your ~/.gvimrc : >
|
||||
|
||||
if has("gui_kde")
|
||||
:set guifont=Fixed\ [Misc]/10/-1/5/50/0/0/0/1/0
|
||||
else if has("gui_gtk")
|
||||
:set guifont=-misc-fixed-medium-r-normal-*-*-100-*-*-c-*-iso10646-1
|
||||
endif
|
||||
<
|
||||
*antialias*
|
||||
KVim uses antialias for its font, so that the text looks better, to disable
|
||||
this you have to refer to Qt's documentation (export QT_XFT=0 for QT 2.x).
|
||||
|
||||
KDE provides some other features, like being able to move the menubar and the
|
||||
toolbar wherever you want around the text area.
|
||||
|
||||
*kde-toolbar*
|
||||
KVim can be used with a KDE-look toolbar instead of Vim's default toolbar. To
|
||||
enable this feature you have to run the configure script with the
|
||||
--enable-kde-toolbar switch. It may be moved to a runtime option in the
|
||||
future.
|
||||
|
||||
*DCOP*
|
||||
Since Vim 6.0, the new ClientServer feature has been added, it works fine in
|
||||
KVim too. KVim also provides its own communication scheme based on DCOP. This
|
||||
is mainly used by the |vimpart| but can freely be used by other applications
|
||||
or manually through KDE's DCOP tools. The DCOP servername is synchronized with
|
||||
the X11 servername so that it's easier to identify the same KVim through the
|
||||
two communication systems.
|
||||
|
||||
*vimpart* *vim-kpart*
|
||||
KVim developers are also working on a component to allow embedding of Vim into
|
||||
KDE's applications. As of this writing, the component is working and can be
|
||||
used in different KDE applications. New KDE applications should support it
|
||||
soon. To get more information about this component, refer to
|
||||
http://freehackers.org/kvim or to the KDE project.
|
||||
There is no KDE version of Vim. There has been some work on a port using the
|
||||
Qt toolkit, but it never worked properly and it has been abandoned. Work
|
||||
continues on Yzis: www.yzis.org.
|
||||
|
||||
==============================================================================
|
||||
8. Compiling *gui-x11-compiling*
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*hangulin.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
|
||||
*hangulin.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Chi-Deok Hwang and Sung-Hyun Nam
|
||||
@@ -7,17 +7,17 @@ Introduction *hangul*
|
||||
------------
|
||||
It is to input hangul, the Korean language, with VIM GUI version.
|
||||
If you have a XIM program, you can use another |+xim| feature.
|
||||
Basically, it is for whom has no XIM program.
|
||||
Basically, it is for anybody who has no XIM program.
|
||||
|
||||
Compile
|
||||
-------
|
||||
Next is a basic option. You can add any other configure option. >
|
||||
Next is a basic option. You can add any other configure option. >
|
||||
|
||||
./configure --with-x --enable-multibyte --enable-fontset --enable-hangulinput
|
||||
|
||||
And you should check the feature.h. If |+hangul_input| feature is enabled
|
||||
And you should check feature.h. If |+hangul_input| feature is enabled
|
||||
by configure, you can select more options such as keyboard type, 2 bulsik
|
||||
or 3 bulsik. You can find keywords like next in there. >
|
||||
or 3 bulsik. You can find keywords like next in there. >
|
||||
|
||||
#define HANGUL_DEFAULT_KEYBOARD 2
|
||||
#define ESC_CHG_TO_ENG_MODE
|
||||
@@ -38,7 +38,7 @@ You should add nexts to your global vimrc ($HOME/.vimrc). >
|
||||
Keyboard
|
||||
--------
|
||||
You can change keyboard type (2 bulsik or 3 bulsik) using VIM_KEYBOARD
|
||||
or HANGUL_KEYBOARD_TYPE environment variables. For sh, just do (2 bulsik): >
|
||||
or HANGUL_KEYBOARD_TYPE environment variables. For sh, just do (2 bulsik): >
|
||||
|
||||
export VIM_KEYBOARD="2"
|
||||
or >
|
||||
@@ -67,9 +67,9 @@ $HOME/.gvimrc: >
|
||||
|
||||
attention! the , (comma) or ; (semicolon)
|
||||
|
||||
And there should be no ':set guifont'. If it exists, then Gvim ignores
|
||||
':set guifontset'. It means VIM runs without fontset supporting.
|
||||
So, you can see only English. Hangul does not be correctly displayed.
|
||||
And there should be no ':set guifont'. If it exists, then Gvim ignores
|
||||
':set guifontset'. It means VIM runs without fontset supporting.
|
||||
So, you can see only English. Hangul does not be correctly displayed.
|
||||
|
||||
After 'fontset' feature is enabled, VIM does not allow using 'font'.
|
||||
For example, if you use >
|
||||
@@ -78,17 +78,17 @@ in your .gvimrc, then you should do for syntax >
|
||||
:hi Comment guifg=Cyan font=another_eng_font,another_your_font
|
||||
If you just do >
|
||||
:hi Comment font=another_eng_font
|
||||
then you can see a GOOD error message. Be careful!
|
||||
then you can see a GOOD error message. Be careful!
|
||||
|
||||
hangul_font width should be twice than english_font width.
|
||||
|
||||
Unsupported Feature
|
||||
-------------------
|
||||
Johab font not yet supported. And I don't have any plan.
|
||||
Johab font not yet supported. And I don't have any plan.
|
||||
If you really want to use johab font, you can use the
|
||||
hanguldraw.c in gau package.
|
||||
|
||||
Hanja input not yet supported. And I don't have any plan.
|
||||
Hanja input not yet supported. And I don't have any plan.
|
||||
If you really want to input hanja, just use VIM with hanterm.
|
||||
|
||||
Bug or Comment
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*hebrew.txt* For Vim version 7.0aa. Last change: 2003 May 11
|
||||
*hebrew.txt* For Vim version 7.0b. Last change: 2003 May 11
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Ron Aaron (and Avner Lottem)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*help.txt* For Vim version 7.0aa. Last change: 2005 Mar 19
|
||||
*help.txt* For Vim version 7.0b. Last change: 2006 Mar 24
|
||||
|
||||
VIM - main help file
|
||||
k
|
||||
@@ -17,13 +17,13 @@ Get specific help: It is possible to go directly to whatever you want help
|
||||
It is possible to further specify the context:
|
||||
*help-context*
|
||||
WHAT PREPEND EXAMPLE ~
|
||||
Normal mode commands (nothing) :help x
|
||||
Visual mode commands v_ :help v_u
|
||||
Insert mode commands i_ :help i_<Esc>
|
||||
Command-line commands : :help :quit
|
||||
Normal mode command (nothing) :help x
|
||||
Visual mode command v_ :help v_u
|
||||
Insert mode command i_ :help i_<Esc>
|
||||
Command-line command : :help :quit
|
||||
Command-line editing c_ :help c_<Del>
|
||||
Vim command arguments - :help -r
|
||||
Options ' :help 'textwidth'
|
||||
Vim command argument - :help -r
|
||||
Option ' :help 'textwidth'
|
||||
Search for help: Type ":help word", then hit CTRL-D to see matching
|
||||
help entries for "word".
|
||||
|
||||
@@ -71,6 +71,7 @@ Editing Effectively ~
|
||||
|usr_29.txt| Moving through programs
|
||||
|usr_30.txt| Editing programs
|
||||
|usr_31.txt| Exploiting the GUI
|
||||
|usr_32.txt| The undo tree
|
||||
|
||||
Tuning Vim ~
|
||||
|usr_40.txt| Make new commands
|
||||
@@ -84,7 +85,7 @@ Making Vim Run ~
|
||||
|usr_90.txt| Installing Vim
|
||||
|
||||
|
||||
REFERENCE MANUAL: These files explain every detail of Vim.
|
||||
REFERENCE MANUAL: These files explain every detail of Vim. *ref-toc*
|
||||
|
||||
General subjects ~
|
||||
|intro.txt| general introduction to Vim; notation used in help files
|
||||
@@ -97,6 +98,7 @@ General subjects ~
|
||||
|quotes.txt| remarks from users of Vim
|
||||
|todo.txt| known problems and desired extensions
|
||||
|develop.txt| development of Vim
|
||||
|debug.txt| debugging Vim itself
|
||||
|uganda.txt| Vim distribution conditions and what to do with your money
|
||||
|
||||
Basic editing ~
|
||||
@@ -121,6 +123,7 @@ Advanced editing ~
|
||||
|tagsrch.txt| tags and special searches
|
||||
|quickfix.txt| commands for a quick edit-compile-fix cycle
|
||||
|windows.txt| commands for using multiple windows and buffers
|
||||
|tabpage.txt| commands for using multiple tab pages
|
||||
|syntax.txt| syntax highlighting
|
||||
|spell.txt| spell checking
|
||||
|diff.txt| working with two or three versions of the same file
|
||||
@@ -185,9 +188,11 @@ Remarks about specific systems ~
|
||||
|os_win32.txt| MS-Windows 95/98/NT
|
||||
*standard-plugin-list*
|
||||
Standard plugins ~
|
||||
|pi_netrw.txt| Reading and writing files over a network
|
||||
|pi_gzip.txt| Reading and writing compressed files
|
||||
|pi_expl.txt| File explorer
|
||||
|pi_netrw.txt| Reading and writing files over a network
|
||||
|pi_paren.txt| Highlight matching parens
|
||||
|pi_tar.txt| Tar file explorer
|
||||
|pi_zip.txt| Zip archive explorer
|
||||
|
||||
LOCAL ADDITIONS: *local-additions*
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*howto.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
|
||||
*howto.txt* For Vim version 7.0b. Last change: 2001 Sep 03
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_cscop.txt* For Vim version 7.0aa. Last change: 2004 Oct 21
|
||||
*if_cscop.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Andy Kahn
|
||||
@@ -208,6 +208,11 @@ The available subcommands are:
|
||||
|
||||
USAGE :cs show
|
||||
|
||||
*:lcscope* *:lcs*
|
||||
This command is same as the ":cscope" command, except when the
|
||||
'cscopequickfix' option is set, the location list for the current window is
|
||||
used instead of the quickfix list to show the cscope results.
|
||||
|
||||
*:cstag* *E257* *E562*
|
||||
If you use cscope as well as ctags, |:cstag| allows you to search one or
|
||||
the other before making a jump. For example, you can choose to first
|
||||
@@ -239,12 +244,12 @@ started will have no effect!
|
||||
*cscopequickfix* *csqf* *E469*
|
||||
{not available when compiled without the |+quickfix| feature}
|
||||
'cscopequickfix' specifies whether to use quickfix window to show cscope
|
||||
results. This is a list of comma-separated values. Each item consists of
|
||||
results. This is a list of comma-separated values. Each item consists of
|
||||
|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
|
||||
'+' indicates that results must be appended to quickfix window,
|
||||
'-' implies previous results clearance, '0' or command absence - don't use
|
||||
quickfix. Search is performed from start until first command occurrence.
|
||||
The default value is "" (don't use quickfix anyway). The following value
|
||||
quickfix. Search is performed from start until first command occurrence.
|
||||
The default value is "" (don't use quickfix anyway). The following value
|
||||
seems to be useful: >
|
||||
:set cscopequickfix=s-,c-,d-,i-,t-,e-
|
||||
<
|
||||
@@ -472,7 +477,7 @@ cscope within Vim to him.
|
||||
*cscope-win32*
|
||||
For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
|
||||
|
||||
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
|
||||
Win32 support was added by Sergey Khorev <sergey.khorev@gmail.com>. Contact
|
||||
him if you have Win32-specific issues.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_mzsch.txt* For Vim version 7.0aa. Last change: 2005 Jan 23
|
||||
*if_mzsch.txt* For Vim version 7.0b. Last change: 2006 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sergey Khorev
|
||||
@@ -10,6 +10,7 @@ The MzScheme Interface to Vim *mzscheme* *MzScheme*
|
||||
2. Examples |mzscheme-examples|
|
||||
3. Threads |mzscheme-threads|
|
||||
4. The Vim access procedures |mzscheme-vim|
|
||||
5. Dynamic loading |mzscheme-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -110,6 +111,9 @@ something like this in your .vimrc (EOFs should not have indentation): >
|
||||
<
|
||||
|
||||
The global namespace just instantiated this module with the prefix "vimext:".
|
||||
*mzscheme-sandbox*
|
||||
When executed in the |sandbox|, access to some filesystem and Vim interface
|
||||
procedures is restricted.
|
||||
|
||||
==============================================================================
|
||||
2. Examples *mzscheme-examples*
|
||||
@@ -162,7 +166,10 @@ interface.
|
||||
Common
|
||||
------
|
||||
(command {command-string}) Perform the vim ":Ex" style command.
|
||||
(eval {expr-string}) Evaluate the vim command string.
|
||||
(eval {expr-string}) Evaluate the vim expression to a string.
|
||||
A |List| is turned into a string by
|
||||
joining the items and inserting line
|
||||
breaks.
|
||||
NOTE clashes with MzScheme eval
|
||||
(range-start) Start/End of the range passed with
|
||||
(range-end) the Scheme command.
|
||||
@@ -240,5 +247,23 @@ Windows *mzscheme-window*
|
||||
a pair (linenr . column).
|
||||
(set-cursor (line . col) [window]) Set cursor position.
|
||||
|
||||
==============================================================================
|
||||
5. Dynamic loading *mzscheme-dynamic*
|
||||
|
||||
On MS-Windows the MzScheme libraries can be loaded dynamically. The |:version|
|
||||
output then includes |+mzscheme/dyn|.
|
||||
|
||||
This means that Vim will search for the MzScheme DLL files only when needed.
|
||||
When you don't use the MzScheme interface you don't need them, thus you can
|
||||
use Vim without these DLL files.
|
||||
|
||||
To use the MzScheme interface the MzScheme DLLs must be in your search path.
|
||||
In a console window type "path" to see what directories are used.
|
||||
|
||||
The names of the DLLs must match the MzScheme version Vim was compiled with.
|
||||
For MzScheme version 209 they will be "libmzsch209_000.dll" and
|
||||
"libmzgc209_000.dll". To know for sure edit "gvim.exe" and search for
|
||||
"libmzsch\d\d\d_\d\d\d\.dll\c".
|
||||
|
||||
======================================================================
|
||||
vim:tw=78:ts=8:sts=4:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_ole.txt* For Vim version 7.0aa. Last change: 2004 Dec 09
|
||||
*if_ole.txt* For Vim version 7.0b. Last change: 2006 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@@ -22,7 +22,7 @@ An alternative is using the client-server communication |clientserver|.
|
||||
1. Activation *ole-activation*
|
||||
|
||||
Vim acts as an OLE automation server, accessible from any automation client,
|
||||
for example, Visual Basic, Python, or Perl. The Vim application "name" (its
|
||||
for example, Visual Basic, Python, or Perl. The Vim application "name" (its
|
||||
"ProgID", in OLE terminology) is "Vim.Application".
|
||||
|
||||
Hence, in order to start a Vim instance (or connect to an already running
|
||||
@@ -41,8 +41,8 @@ instance), code similar to the following should be used:
|
||||
$vim = new Win32::OLE 'Vim.Application';
|
||||
|
||||
Vim does not support acting as a "hidden" OLE server, like some other OLE
|
||||
Automation servers. When a client starts up an instance of Vim, that instance
|
||||
is immediately visible. Simply closing the OLE connection to the Vim instance
|
||||
Automation servers. When a client starts up an instance of Vim, that instance
|
||||
is immediately visible. Simply closing the OLE connection to the Vim instance
|
||||
is not enough to shut down the Vim instance - it is necessary to explicitly
|
||||
execute a quit command (for example, :qa!, :wqa).
|
||||
|
||||
@@ -54,17 +54,17 @@ Vim exposes four methods for use by clients.
|
||||
*ole-sendkeys*
|
||||
SendKeys(keys) Execute a series of keys.
|
||||
|
||||
This method takes a single parameter, which is a string of keystrokes. These
|
||||
This method takes a single parameter, which is a string of keystrokes. These
|
||||
keystrokes are executed exactly as if they had been types in at the keyboard.
|
||||
Special keys can be given using their <..> names, as for the right hand side
|
||||
of a mapping. Note: Execution of the Ex "normal" command is not supported -
|
||||
of a mapping. Note: Execution of the Ex "normal" command is not supported -
|
||||
see below |ole-normal|.
|
||||
|
||||
Examples (Visual Basic syntax) >
|
||||
Vim.SendKeys "ihello<Esc>"
|
||||
Vim.SendKeys "ma1GV4jy`a"
|
||||
|
||||
These examples assume that Vim starts in Normal mode. To force Normal mode,
|
||||
These examples assume that Vim starts in Normal mode. To force Normal mode,
|
||||
start the key sequence with CTRL-\ CTRL-N as in >
|
||||
|
||||
Vim.SendKeys "<C-\><C-N>ihello<Esc>"
|
||||
@@ -77,7 +77,8 @@ Eval(expr) Evaluate an expression.
|
||||
|
||||
This method takes a single parameter, which is an expression in Vim's normal
|
||||
format (see |expression|). It returns a string, which is the result of
|
||||
evaluating the expression.
|
||||
evaluating the expression. A |List| is turned into a string by joining the
|
||||
items and inserting line breaks.
|
||||
|
||||
Examples (Visual Basic syntax) >
|
||||
Line20 = Vim.Eval("getline(20)")
|
||||
@@ -109,7 +110,7 @@ Example (Visual Basic syntax) >
|
||||
|
||||
Due to the way Vim processes OLE Automation commands, combined with the method
|
||||
of implementation of the ex command :normal, it is not possible to execute the
|
||||
:normal command via OLE automation. Any attempt to do so will fail, probably
|
||||
:normal command via OLE automation. Any attempt to do so will fail, probably
|
||||
harmlessly, although possibly in unpredictable ways.
|
||||
|
||||
There is currently no practical way to trap this situation, and users must
|
||||
@@ -118,7 +119,7 @@ simply be aware of the limitation.
|
||||
4. Registration *ole-registration* *E243*
|
||||
|
||||
Before Vim will act as an OLE server, it must be registered in the system
|
||||
registry. In order to do this, Vim should be run with a single parameter of
|
||||
registry. In order to do this, Vim should be run with a single parameter of
|
||||
"-register".
|
||||
*-register* >
|
||||
gvim -register
|
||||
@@ -131,9 +132,9 @@ In some situations registering is not possible. This happens when the
|
||||
registry is not writable. If you run into this problem you need to run gvim
|
||||
as "Administrator".
|
||||
|
||||
Once vim is registered, the application path is stored in the registry. Before
|
||||
moving, deleting, or upgrading Vim, the registry entries should be removed
|
||||
using the "-unregister" switch.
|
||||
Once vim is registered, the application path is stored in the registry.
|
||||
Before moving, deleting, or upgrading Vim, the registry entries should be
|
||||
removed using the "-unregister" switch.
|
||||
*-unregister* >
|
||||
gvim -unregister
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_perl.txt* For Vim version 7.0aa. Last change: 2004 Aug 30
|
||||
*if_perl.txt* For Vim version 7.0b. Last change: 2006 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Sven Verdoolaege
|
||||
@@ -9,6 +9,7 @@ Perl and Vim *perl* *Perl*
|
||||
1. Editing Perl files |perl-editing|
|
||||
2. Compiling VIM with Perl interface |perl-compiling|
|
||||
3. Using the Perl interface |perl-using|
|
||||
4. Dynamic loading |perl-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -18,7 +19,7 @@ The Perl interface only works when Vim was compiled with the |+perl| feature.
|
||||
1. Editing Perl files *perl-editing*
|
||||
|
||||
Vim syntax highlighting supports Perl and POD files. Vim assumes a file is
|
||||
Perl code if the filename has a .pl or .pm suffix. Vim also examines the first
|
||||
Perl code if the filename has a .pl or .pm suffix. Vim also examines the first
|
||||
line of a file, regardless of the filename suffix, to check if a file is a
|
||||
Perl script (see scripts.vim in Vim's syntax directory). Vim assumes a file
|
||||
is POD text if the filename has a .POD suffix.
|
||||
@@ -50,7 +51,7 @@ http://www.perl.com/CPAN/ports/nt/Standard/x86/
|
||||
3. Using the Perl interface *perl-using*
|
||||
|
||||
*:perl* *:pe*
|
||||
:pe[rl] {cmd} Execute Perl command {cmd}. The current package
|
||||
:pe[rl] {cmd} Execute Perl command {cmd}. The current package
|
||||
is "main".
|
||||
|
||||
:pe[rl] << {endpattern}
|
||||
@@ -84,7 +85,7 @@ Example vim script: >
|
||||
*:perldo* *:perld*
|
||||
:[range]perld[o] {cmd} Execute Perl command {cmd} for each line in the
|
||||
[range], with $_ being set to the text of each line in
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
the text, but note that it is not possible to add or
|
||||
delete lines using this command.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
@@ -180,6 +181,8 @@ VIM::Eval({expr}) Evaluates {expr} and returns (success, val).
|
||||
value of internal |variables| x, and '$x' is equivalent
|
||||
to perl's $ENV{x}. All |functions| accessible from
|
||||
the command-line are valid for {expr}.
|
||||
A |List| is turned into a string by joining the items
|
||||
and inserting line breaks.
|
||||
|
||||
*perl-SetHeight*
|
||||
Window->SetHeight({height})
|
||||
@@ -211,7 +214,7 @@ Buffer->Count() Returns the number of lines in the Buffer.
|
||||
*perl-Get*
|
||||
Buffer->Get({lnum}, {lnum}?, ...)
|
||||
Returns a text string of line {lnum} in the Buffer
|
||||
for each {lnum} specified. An array can be passed
|
||||
for each {lnum} specified. An array can be passed
|
||||
with a list of {lnum}'s specified.
|
||||
|
||||
*perl-Delete*
|
||||
@@ -259,4 +262,22 @@ function: >
|
||||
endif
|
||||
Note that "EOF" must be at the start of the line.
|
||||
|
||||
==============================================================================
|
||||
4. Dynamic loading *perl-dynamic*
|
||||
|
||||
On MS-Windows the Perl library can be loaded dynamically. The |:version|
|
||||
output then includes |+perl/dyn|.
|
||||
|
||||
This means that Vim will search for the Perl DLL file only when needed. When
|
||||
you don't use the Perl interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Perl interface the Perl DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Perl version Vim was compiled with.
|
||||
Currently the name is "perl58.dll". That is for Perl 5.8. To know for
|
||||
sure edit "gvim.exe" and search for "perl\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_pyth.txt* For Vim version 7.0aa. Last change: 2004 Jul 25
|
||||
*if_pyth.txt* For Vim version 7.0b. Last change: 2006 Jan 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Paul Moore
|
||||
@@ -11,6 +11,7 @@ The Python Interface to Vim *python* *Python*
|
||||
3. Buffer objects |python-buffer|
|
||||
4. Range objects |python-range|
|
||||
5. Window objects |python-window|
|
||||
6. Dynamic loading |python-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
@@ -85,7 +86,7 @@ just like in the Python interpreter.)
|
||||
2. The vim module *python-vim*
|
||||
|
||||
Python code gets all of its access to vim (with one exception - see
|
||||
|python-output| below) via the "vim" module. The vim module implements two
|
||||
|python-output| below) via the "vim" module. The vim module implements two
|
||||
methods, three constants, and one error object. You need to import the vim
|
||||
module before using it: >
|
||||
:python import vim
|
||||
@@ -113,7 +114,7 @@ Overview >
|
||||
Methods of the "vim" module
|
||||
|
||||
vim.command(str) *python-command*
|
||||
Executes the vim (ex-mode) command str. Returns None.
|
||||
Executes the vim (ex-mode) command str. Returns None.
|
||||
Examples: >
|
||||
:py vim.command("set tw=72")
|
||||
:py vim.command("%s/aaa/bbb/g")
|
||||
@@ -130,14 +131,24 @@ vim.command(str) *python-command*
|
||||
|
||||
vim.eval(str) *python-eval*
|
||||
Evaluates the expression str using the vim internal expression
|
||||
evaluator (see |expression|). Returns the expression result as a
|
||||
string.
|
||||
evaluator (see |expression|). Returns the expression result as:
|
||||
- a string if the Vim expression evaluates to a string or number
|
||||
- a list if the Vim expression evaluates to a Vim list
|
||||
- a dictionary if the Vim expression evaluates to a Vim dictionary
|
||||
Dictionaries and lists are recursively expanded.
|
||||
Examples: >
|
||||
:py text_width = vim.eval("&tw")
|
||||
:py str = vim.eval("12+12") # NB result is a string! Use
|
||||
# string.atoi() to convert to
|
||||
# a number.
|
||||
|
||||
:py tagList = vim.eval('taglist("eval_expr")')
|
||||
< The latter will return a python list of python dicts, for instance:
|
||||
[{'cmd': '/^eval_expr(arg, nextcmd)$/', 'static': 0, 'name':
|
||||
'eval_expr', 'kind': 'f', 'filename': './src/eval.c'}]
|
||||
|
||||
|
||||
|
||||
Error object of the "vim" module
|
||||
|
||||
vim.error *python-error*
|
||||
@@ -156,7 +167,7 @@ Constants of the "vim" module
|
||||
to which the variables referred.
|
||||
|
||||
vim.buffers *python-buffers*
|
||||
A sequence object providing access to the list of vim buffers. The
|
||||
A sequence object providing access to the list of vim buffers. The
|
||||
object supports the following operations: >
|
||||
:py b = vim.buffers[i] # Indexing (read-only)
|
||||
:py b in vim.buffers # Membership test
|
||||
@@ -164,7 +175,7 @@ vim.buffers *python-buffers*
|
||||
:py for b in vim.buffers: # Sequential access
|
||||
<
|
||||
vim.windows *python-windows*
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
object supports the following operations: >
|
||||
:py w = vim.windows[i] # Indexing (read-only)
|
||||
:py w in vim.windows # Membership test
|
||||
@@ -179,10 +190,10 @@ vim.current *python-current*
|
||||
vim.current.window The current window (RO) Window
|
||||
vim.current.range The current line range (RO) Range
|
||||
|
||||
The last case deserves a little explanation. When the :python or
|
||||
The last case deserves a little explanation. When the :python or
|
||||
:pyfile command specifies a range, this range of lines becomes the
|
||||
"current range". A range is a bit like a buffer, but with all access
|
||||
restricted to a subset of lines. See |python-range| for more details.
|
||||
"current range". A range is a bit like a buffer, but with all access
|
||||
restricted to a subset of lines. See |python-range| for more details.
|
||||
|
||||
|
||||
Output from Python *python-output*
|
||||
@@ -197,31 +208,31 @@ Output from Python *python-output*
|
||||
|
||||
*python-input*
|
||||
Input (via sys.stdin, including input() and raw_input()) is not
|
||||
supported, and may cause the program to crash. This should probably be
|
||||
supported, and may cause the program to crash. This should probably be
|
||||
fixed.
|
||||
|
||||
==============================================================================
|
||||
3. Buffer objects *python-buffer*
|
||||
|
||||
Buffer objects represent vim buffers. You can obtain them in a number of ways:
|
||||
Buffer objects represent vim buffers. You can obtain them in a number of ways:
|
||||
- via vim.current.buffer (|python-current|)
|
||||
- from indexing vim.buffers (|python-buffers|)
|
||||
- from the "buffer" attribute of a window (|python-window|)
|
||||
|
||||
Buffer objects have one read-only attribute - name - the full file name for
|
||||
the buffer. They also have three methods (append, mark, and range; see below).
|
||||
the buffer. They also have three methods (append, mark, and range; see below).
|
||||
|
||||
You can also treat buffer objects as sequence objects. In this context, they
|
||||
You can also treat buffer objects as sequence objects. In this context, they
|
||||
act as if they were lists (yes, they are mutable) of strings, with each
|
||||
element being a line of the buffer. All of the usual sequence operations,
|
||||
element being a line of the buffer. All of the usual sequence operations,
|
||||
including indexing, index assignment, slicing and slice assignment, work as
|
||||
you would expect. Note that the result of indexing (slicing) a buffer is a
|
||||
string (list of strings). This has one unusual consequence - b[:] is different
|
||||
from b. In particular, "b[:] = None" deletes the whole of the buffer, whereas
|
||||
you would expect. Note that the result of indexing (slicing) a buffer is a
|
||||
string (list of strings). This has one unusual consequence - b[:] is different
|
||||
from b. In particular, "b[:] = None" deletes the whole of the buffer, whereas
|
||||
"b = None" merely updates the variable b, with no effect on the buffer.
|
||||
|
||||
Buffer indexes start at zero, as is normal in Python. This differs from vim
|
||||
line numbers, which start from 1. This is particularly relevant when dealing
|
||||
Buffer indexes start at zero, as is normal in Python. This differs from vim
|
||||
line numbers, which start from 1. This is particularly relevant when dealing
|
||||
with marks (see below) which use vim line numbers.
|
||||
|
||||
The buffer object methods are:
|
||||
@@ -255,12 +266,12 @@ Examples (assume b is the current buffer) >
|
||||
==============================================================================
|
||||
4. Range objects *python-range*
|
||||
|
||||
Range objects represent a part of a vim buffer. You can obtain them in a
|
||||
Range objects represent a part of a vim buffer. You can obtain them in a
|
||||
number of ways:
|
||||
- via vim.current.range (|python-current|)
|
||||
- from a buffer's range() method (|python-buffer|)
|
||||
|
||||
A range object is almost identical in operation to a buffer object. However,
|
||||
A range object is almost identical in operation to a buffer object. However,
|
||||
all operations are restricted to the lines within the range (this line range
|
||||
can, of course, change as a result of slice assignments, line deletions, or
|
||||
the range.append() method).
|
||||
@@ -283,11 +294,11 @@ Example (assume r is the current range):
|
||||
==============================================================================
|
||||
5. Window objects *python-window*
|
||||
|
||||
Window objects represent vim windows. You can obtain them in a number of ways:
|
||||
Window objects represent vim windows. You can obtain them in a number of ways:
|
||||
- via vim.current.window (|python-current|)
|
||||
- from indexing vim.windows (|python-windows|)
|
||||
|
||||
You can manipulate window objects only through their attributes. They have no
|
||||
You can manipulate window objects only through their attributes. They have no
|
||||
methods, and no sequence or other interface.
|
||||
|
||||
Window attributes are:
|
||||
@@ -299,5 +310,22 @@ Window attributes are:
|
||||
The height attribute is writable only if the screen is split horizontally.
|
||||
The width attribute is writable only if the screen is split vertically.
|
||||
|
||||
==============================================================================
|
||||
6. Dynamic loading *python-dynamic*
|
||||
|
||||
On MS-Windows the Python library can be loaded dynamically. The |:version|
|
||||
output then includes |+python/dyn|.
|
||||
|
||||
This means that Vim will search for the Python DLL file only when needed.
|
||||
When you don't use the Python interface you don't need it, thus you can use
|
||||
Vim without this DLL file.
|
||||
|
||||
To use the Python interface the Python DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Python version Vim was compiled with.
|
||||
Currently the name is "python24.dll". That is for Python 2.4. To know for
|
||||
sure edit "gvim.exe" and search for "python\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_ruby.txt* For Vim version 7.0aa. Last change: 2004 Mar 14
|
||||
*if_ruby.txt* For Vim version 7.0b. Last change: 2006 Mar 26
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Shugo Maeda
|
||||
@@ -11,6 +11,7 @@ The Ruby Interface to Vim *ruby* *Ruby*
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
6. Dynamic loading |ruby-dynamic|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
@@ -32,7 +33,7 @@ downloading Ruby there.
|
||||
Execute Ruby script {script}.
|
||||
{endpattern} must NOT be preceded by any white space.
|
||||
If {endpattern} is omitted, it defaults to a dot '.'
|
||||
like for the |:append| and |:insert| commands. This
|
||||
like for the |:append| and |:insert| commands. This
|
||||
form of the |:ruby| command is mainly useful for
|
||||
including ruby code in vim scripts.
|
||||
Note: This command doesn't work when the Ruby feature
|
||||
@@ -60,7 +61,7 @@ Example Vim script: >
|
||||
*:rubydo* *:rubyd* *E265*
|
||||
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
||||
[range], with $_ being set to the text of each line in
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
the text, but note that it is not possible to add or
|
||||
delete lines using this command.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
@@ -77,23 +78,26 @@ Executing Ruby commands is not possible in the |sandbox|.
|
||||
Ruby code gets all of its access to vim via the "VIM" module.
|
||||
|
||||
Overview >
|
||||
print "Hello" # displays a message
|
||||
VIM.command(cmd) # execute an ex command
|
||||
num = VIM::Window.count # gets the number of windows
|
||||
w = VIM::Window[n] # gets window "n"
|
||||
cw = VIM::Window.current # gets the current window
|
||||
num = VIM::Buffer.count # gets the number of buffers
|
||||
b = VIM::Buffer[n] # gets buffer "n"
|
||||
cb = VIM::Buffer.current # gets the current buffer
|
||||
w.height = lines # sets the window height
|
||||
w.cursor = [row, col] # sets the window cursor position
|
||||
pos = w.cursor # gets an array [row, col]
|
||||
name = b.name # gets the buffer file name
|
||||
line = b[n] # gets a line from the buffer
|
||||
num = b.count # gets the number of lines
|
||||
b[n] = str # sets a line in the buffer
|
||||
b.delete(n) # deletes a line
|
||||
b.append(n, str) # appends a line after n
|
||||
print "Hello" # displays a message
|
||||
VIM.command(cmd) # execute an ex command
|
||||
num = VIM::Window.count # gets the number of windows
|
||||
w = VIM::Window[n] # gets window "n"
|
||||
cw = VIM::Window.current # gets the current window
|
||||
num = VIM::Buffer.count # gets the number of buffers
|
||||
b = VIM::Buffer[n] # gets buffer "n"
|
||||
cb = VIM::Buffer.current # gets the current buffer
|
||||
w.height = lines # sets the window height
|
||||
w.cursor = [row, col] # sets the window cursor position
|
||||
pos = w.cursor # gets an array [row, col]
|
||||
name = b.name # gets the buffer file name
|
||||
line = b[n] # gets a line from the buffer
|
||||
num = b.count # gets the number of lines
|
||||
b[n] = str # sets a line in the buffer
|
||||
b.delete(n) # deletes a line
|
||||
b.append(n, str) # appends a line after n
|
||||
line = VIM::Buffer.current.line # gets the current line
|
||||
num = VIM::Buffer.current.line_number # gets the current line number
|
||||
VIM::Buffer.current.line = "test" # sets the current line number
|
||||
<
|
||||
|
||||
Module Functions:
|
||||
@@ -115,7 +119,9 @@ VIM::command({cmd})
|
||||
*ruby-evaluate*
|
||||
VIM::evaluate({expr})
|
||||
Evaluates {expr} using the vim internal expression evaluator (see
|
||||
|expression|). Returns the expression result as a string.
|
||||
|expression|). Returns the expression result as a string.
|
||||
A |List| is turned into a string by joining the items and inserting
|
||||
line breaks.
|
||||
|
||||
==============================================================================
|
||||
3. VIM::Buffer objects *ruby-buffer*
|
||||
@@ -126,7 +132,7 @@ Class Methods:
|
||||
|
||||
current Returns the current buffer object.
|
||||
count Returns the number of buffers.
|
||||
self[{n}] Returns the buffer object for the number {n}. The first number
|
||||
self[{n}] Returns the buffer object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
@@ -141,6 +147,11 @@ self[{n}] = {str}
|
||||
delete({n}) Deletes a line from the buffer. {n} is the line number.
|
||||
append({n}, {str})
|
||||
Appends a line after the line {n}.
|
||||
line Returns the current line of the buffer if the buffer is
|
||||
active.
|
||||
line = {str} Sets the current line of the buffer if the buffer is active.
|
||||
line_number Returns the number of the current line if the buffer is
|
||||
active.
|
||||
|
||||
==============================================================================
|
||||
4. VIM::Window objects *ruby-window*
|
||||
@@ -151,7 +162,7 @@ Class Methods:
|
||||
|
||||
current Returns the current window object.
|
||||
count Returns the number of windows.
|
||||
self[{n}] Returns the window object for the number {n}. The first number
|
||||
self[{n}] Returns the window object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
@@ -159,17 +170,36 @@ Methods:
|
||||
buffer Returns the buffer displayed in the window.
|
||||
height Returns the height of the window.
|
||||
height = {n} Sets the window height to {n}.
|
||||
width Returns the width of the window.
|
||||
width = {n} Sets the window width to {n}.
|
||||
cursor Returns a [row, col] array for the cursor position.
|
||||
cursor = [{row}, {col}]
|
||||
Sets the cursor position to {row} and {col}.
|
||||
|
||||
==============================================================================
|
||||
4. Global variables *ruby-globals*
|
||||
5. Global variables *ruby-globals*
|
||||
|
||||
There are two global variables.
|
||||
|
||||
$curwin The current window object.
|
||||
$curbuf The current buffer object.
|
||||
|
||||
==============================================================================
|
||||
6. Dynamic loading *ruby-dynamic*
|
||||
|
||||
On MS-Windows the Ruby library can be loaded dynamically. The |:version|
|
||||
output then includes |+ruby/dyn|.
|
||||
|
||||
This means that Vim will search for the Ruby DLL file only when needed. When
|
||||
you don't use the Ruby interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Ruby interface the Ruby DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Ruby version Vim was compiled with.
|
||||
Currently the name is "ruby18.dll". That is for Ruby 1.8. To know for sure
|
||||
edit "gvim.exe" and search for "ruby\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_sniff.txt* For Vim version 7.0aa. Last change: 2001 Sep 03
|
||||
*if_sniff.txt* For Vim version 7.0b. Last change: 2005 Mar 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL
|
||||
@@ -45,7 +45,7 @@ edit source code. On the other hand, you can send queries to SNiFF+ with the
|
||||
:sni[ff] Display all possible requests and the connection
|
||||
status
|
||||
|
||||
Most requests require a symbol (identifier) as parameter. If it is omitted,
|
||||
Most requests require a symbol (identifier) as parameter. If it is omitted,
|
||||
Vim will use the current word under the cursor.
|
||||
The available requests are listed below:
|
||||
|
||||
@@ -54,7 +54,7 @@ request mapping description
|
||||
connect sc Establish connection with SNiFF+.
|
||||
Make sure SNiFF+ is prepared for this in the
|
||||
Preferences
|
||||
disconnect sq Disconnect from SNiFF+. You can reconnect any
|
||||
disconnect sq Disconnect from SNiFF+. You can reconnect any
|
||||
time with :sniff connect (or 'sc')
|
||||
toggle st Toggle between implementation
|
||||
and definition file
|
||||
@@ -80,7 +80,7 @@ show-docu sd Show documentation of symbol
|
||||
gen-docu sD Generate documentation of symbol
|
||||
|
||||
The mappings are defined in a file 'sniff.vim', which is part of every SNiFF+
|
||||
product ($SNIFF_DIR/config/sniff.vim). This file is sourced whenever Vim
|
||||
product ($SNIFF_DIR/config/sniff.vim). This file is sourced whenever Vim
|
||||
connects to SNiFF+.
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*if_tcl.txt* For Vim version 7.0aa. Last change: 2004 Jan 17
|
||||
*if_tcl.txt* For Vim version 7.0b. Last change: 2006 Mar 06
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Ingo Wilken
|
||||
@@ -14,6 +14,7 @@ The Tcl Interface to Vim *tcl* *Tcl* *TCL*
|
||||
6. Miscellaneous; Output from Tcl |tcl-misc| |tcl-output|
|
||||
7. Known bugs & problems |tcl-bugs|
|
||||
8. Examples |tcl-examples|
|
||||
9. Dynamic loading |tcl-dynamic|
|
||||
|
||||
{Vi does not have any of these commands} *E280* *E281*
|
||||
|
||||
@@ -36,7 +37,7 @@ comments, ideas etc to <Ingo.Wilken@informatik.uni-oldenburg.de>
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||
omitted from after the "<<", a dot '.' must be used after {script}, like for
|
||||
the |:append| and |:insert| commands.
|
||||
This form of the |:tcl| command is mainly useful for including tcl code in Vim
|
||||
@@ -132,7 +133,8 @@ Commands:
|
||||
Evaluates the expression {expr} using vim's internal expression
|
||||
evaluator (see |expression|). Any expression that queries a buffer
|
||||
or window property uses the current buffer/current window. Returns
|
||||
the result as a string.
|
||||
the result as a string. A |List| is turned into a string by joining
|
||||
the items and inserting line breaks.
|
||||
Examples: >
|
||||
set perl_available [::vim::expr has("perl")]
|
||||
< See also |tcl-window-expr| and |tcl-buffer-expr|.
|
||||
@@ -152,7 +154,7 @@ Commands:
|
||||
|
||||
::vim::window {option} *tcl-window*
|
||||
Provides access to vim windows. Currently only the "list" option is
|
||||
implemented. This creates a window command (see |tcl-window-cmds|) for
|
||||
implemented. This creates a window command (see |tcl-window-cmds|) for
|
||||
each window, and returns a list of the command names as the result.
|
||||
Example: >
|
||||
set wins [::vim::window list]
|
||||
@@ -227,7 +229,7 @@ The ::vim::current(window) variable contains the name of the window command
|
||||
for the current window. A window command is automatically deleted when the
|
||||
corresponding vim window is closed.
|
||||
|
||||
Lets assume the name of the window command is stored in the Tcl variable "win",
|
||||
Let's assume the name of the window command is stored in the Tcl variable "win",
|
||||
i.e. "$win" calls the command. The following options are available: >
|
||||
|
||||
$win buffer # Create Tcl command for window's buffer.
|
||||
@@ -306,7 +308,7 @@ changed, all marks in the buffer are automatically adjusted. Any changes to
|
||||
the buffer's contents made by Tcl commands can be undone with the "undo" vim
|
||||
command (see |undo|).
|
||||
|
||||
Lets assume the name of the buffer command is stored in the Tcl variable "buf",
|
||||
Let's assume the name of the buffer command is stored in the Tcl variable "buf",
|
||||
i.e. "$buf" calls the command. The following options are available: >
|
||||
|
||||
$buf append {n} {str} # Append a line to buffer, after line {n}.
|
||||
@@ -497,7 +499,7 @@ This procedure runs an ex command on each buffer (idea stolen from Ron Aaron):
|
||||
}
|
||||
Use it like this:
|
||||
:tcl eachbuf %s/foo/bar/g
|
||||
Be careful with Tcl's string and backslash substitution, tough. If in doubt,
|
||||
Be careful with Tcl's string and backslash substitution, tough. If in doubt,
|
||||
surround the ex command with curly braces.
|
||||
|
||||
|
||||
@@ -508,5 +510,22 @@ startup file (usually "~/.vimrc" on Unix):
|
||||
tclfile ~/.vimrc.tcl
|
||||
endif
|
||||
|
||||
==============================================================================
|
||||
9. Dynamic loading *tcl-dynamic*
|
||||
|
||||
On MS-Windows the Tcl library can be loaded dynamically. The |:version|
|
||||
output then includes |+tcl/dyn|.
|
||||
|
||||
This means that Vim will search for the Tcl DLL file only when needed. When
|
||||
you don't use the Tcl interface you don't need it, thus you can use Vim
|
||||
without this DLL file.
|
||||
|
||||
To use the Tcl interface the Tcl DLL must be in your search path. In a
|
||||
console window type "path" to see what directories are used.
|
||||
|
||||
The name of the DLL must match the Tcl version Vim was compiled with.
|
||||
Currently the name is "tcl83.dll". That is for Tcl 8.3. To know for sure
|
||||
edit "gvim.exe" and search for "tcl\d*.dll\c".
|
||||
|
||||
==============================================================================
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*indent.txt* For Vim version 7.0aa. Last change: 2005 Feb 24
|
||||
*indent.txt* For Vim version 7.0b. Last change: 2005 Aug 30
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -237,7 +237,7 @@ assume a 'shiftwidth' of 4.
|
||||
} }
|
||||
<
|
||||
bN If N != 0 Vim will align a final "break" with the case label,
|
||||
so that case..break looks like a sort of block. (default: 0).
|
||||
so that case..break looks like a sort of block. (default: 0).
|
||||
|
||||
cino= cino=b1 >
|
||||
switch (x) switch(x)
|
||||
@@ -325,7 +325,7 @@ assume a 'shiftwidth' of 4.
|
||||
********/ ********/
|
||||
< (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
|
||||
|
||||
/N Indent comment lines N characters extra. (default 0).
|
||||
/N Indent comment lines N characters extra. (default 0).
|
||||
cino= cino=/4 >
|
||||
a = b; a = b;
|
||||
/* comment */ /* comment */
|
||||
@@ -381,7 +381,7 @@ assume a 'shiftwidth' of 4.
|
||||
the last non-white character in its line and it is not the
|
||||
closing parentheses, indent the following line N characters
|
||||
relative to the outer context (i.e. start of the line or the
|
||||
next unclosed parentheses). (default: 0).
|
||||
next unclosed parentheses). (default: 0).
|
||||
|
||||
cino=(0 cino=(0,W4 >
|
||||
a_long_line( a_long_line(
|
||||
@@ -406,7 +406,7 @@ assume a 'shiftwidth' of 4.
|
||||
<
|
||||
*java-cinoptions* *java-indenting*
|
||||
jN Indent java anonymous classes correctly. The value 'N' is
|
||||
currently unused but must be non-zero (e.g. 'j1'). 'j1' will
|
||||
currently unused but must be non-zero (e.g. 'j1'). 'j1' will
|
||||
indent for example the following code snippet correctly: >
|
||||
|
||||
object.add(new ChangeListener() {
|
||||
@@ -449,33 +449,33 @@ $VIMRUNTIME/indent directory for examples.
|
||||
REMARKS ABOUT SPECIFIC INDENT FILES ~
|
||||
|
||||
|
||||
FORTRAN *fortran-indent*
|
||||
FORTRAN *ft-fortran-indent*
|
||||
|
||||
Block if, select case, and where constructs are indented. Comments, labelled
|
||||
Block if, select case, and where constructs are indented. Comments, labelled
|
||||
statements and continuation lines are indented if the Fortran is in free
|
||||
source form, whereas they are not indented if the Fortran is in fixed source
|
||||
form because of the left margin requirements. Hence manual indent corrections
|
||||
form because of the left margin requirements. Hence manual indent corrections
|
||||
will be necessary for labelled statements and continuation lines when fixed
|
||||
source form is being used. For further discussion of the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
source form is being used. For further discussion of the method used for the
|
||||
detection of source format see |ft-fortran-syntax|.
|
||||
|
||||
Do loops ~
|
||||
All do loops are left unindented by default. Do loops can be unstructured in
|
||||
All do loops are left unindented by default. Do loops can be unstructured in
|
||||
Fortran with (possibly multiple) loops ending on a labelled executable
|
||||
statement of almost arbitrary type. Correct indentation requires
|
||||
compiler-quality parsing. Old code with do loops ending on labelled statements
|
||||
statement of almost arbitrary type. Correct indentation requires
|
||||
compiler-quality parsing. Old code with do loops ending on labelled statements
|
||||
of arbitrary type can be indented with elaborate programs such as Tidy
|
||||
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
also left unindented because continue statements are also used for purposes
|
||||
other than ending a do loop. Programs such as Tidy can convert structured
|
||||
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
|
||||
be indented. If you use only structured loops of the do/enddo form, you should
|
||||
other than ending a do loop. Programs such as Tidy can convert structured
|
||||
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
|
||||
be indented. If you use only structured loops of the do/enddo form, you should
|
||||
declare this by setting the fortran_do_enddo variable in your .vimrc as
|
||||
follows >
|
||||
|
||||
let fortran_do_enddo=1
|
||||
|
||||
in which case do loops will be indented. If all your loops are of do/enddo
|
||||
in which case do loops will be indented. If all your loops are of do/enddo
|
||||
type only in, say, .f90 files, then you should set a buffer flag with an
|
||||
autocommand such as >
|
||||
|
||||
@@ -485,7 +485,7 @@ to get do loops indented in .f90 files and left alone in Fortran files with
|
||||
other extensions such as .for.
|
||||
|
||||
|
||||
PYTHON *python-indent*
|
||||
PYTHON *ft-python-indent*
|
||||
|
||||
The amount of indent can be set for the following situations. The examples
|
||||
given are de the defaults. Note that the variables are set to an expression,
|
||||
@@ -499,7 +499,7 @@ Indent for a continuation line: >
|
||||
let g:pyindent_continue = '&sw * 2'
|
||||
|
||||
|
||||
VERILOG *verilog-indent*
|
||||
VERILOG *ft-verilog-indent*
|
||||
|
||||
General block statements such as if, for, case, always, initial, function,
|
||||
specify and begin, etc., are indented. The module block statements (first
|
||||
@@ -534,7 +534,7 @@ In addition, you can turn the verbose mode for debug issue: >
|
||||
Make sure to do ":set cmdheight=2" first to allow the display of the message.
|
||||
|
||||
|
||||
VIM *vim-indent*
|
||||
VIM *ft-vim-indent*
|
||||
|
||||
For indenting Vim scripts there is one variable that specifies the amount of
|
||||
indent for a continuation line, a line that starts with a backslash: >
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*index.txt* For Vim version 7.0aa. Last change: 2005 Feb 25
|
||||
*index.txt* For Vim version 7.0b. Last change: 2006 Mar 24
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -150,12 +150,15 @@ commands in CTRL-X submode *i_CTRL-X_index*
|
||||
|i_CTRL-X_CTRL-K| CTRL-X CTRL-K complete identifiers from dictionary
|
||||
|i_CTRL-X_CTRL-L| CTRL-X CTRL-L complete whole lines
|
||||
|i_CTRL-X_CTRL-N| CTRL-X CTRL-N next completion
|
||||
|i_CTRL-X_CTRL-O| CTRL-X CTRL-O omni completion
|
||||
|i_CTRL-X_CTRL-P| CTRL-X CTRL-P previous completion
|
||||
|i_CTRL-X_CTRL-S| CTRL-X CTRL-S spelling suggestions
|
||||
|i_CTRL-X_CTRL-T| CTRL-X CTRL-T complete identifiers from thesaurus
|
||||
|i_CTRL-X_CTRL-Y| CTRL-X CTRL-Y scroll down
|
||||
|i_CTRL-X_CTRL-U| CTRL-X CTRL-U complete with 'completefunc'
|
||||
|i_CTRL-X_CTRL-V| CTRL-X CTRL-V complete like in : command line
|
||||
|i_CTRL-X_CTRL-]| CTRL-X CTRL-] complete tags
|
||||
|i_CTRL-X_s| CTRL-X s spelling suggestions
|
||||
{not available when compiled without the +insert_expand feature}
|
||||
|
||||
==============================================================================
|
||||
@@ -340,9 +343,9 @@ tag char note action in Normal mode ~
|
||||
"yy"
|
||||
|ZZ| ZZ store current file if modified, and exit
|
||||
|ZQ| ZQ exit current file always
|
||||
|[| [{char} square bracket command (see below)
|
||||
|[| [{char} square bracket command (see |[| below)
|
||||
\ not used
|
||||
|]| ]{char} square bracket command (see below)
|
||||
|]| ]{char} square bracket command (see |]| below)
|
||||
|^| ^ 1 cursor to the first CHAR of the line
|
||||
|_| _ 1 cursor to the first CHAR N - 1 lines lower
|
||||
|`| `{a-zA-Z0-9} 1 cursor to the mark {a-zA-Z0-9}
|
||||
@@ -370,7 +373,7 @@ tag char note action in Normal mode ~
|
||||
|e| e 1 cursor forward to the end of word N
|
||||
|f| f{char} 1 cursor to Nth occurrence of {char} to the
|
||||
right
|
||||
|g| g{char} extended commands, see below
|
||||
|g| g{char} extended commands, see |g| below
|
||||
|h| h 1 cursor N chars to the left
|
||||
|i| i 2 insert text before the cursor N times
|
||||
|j| j 1 cursor N lines downward
|
||||
@@ -400,7 +403,7 @@ tag char note action in Normal mode ~
|
||||
cursor [into buffer x]
|
||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
||||
|yy| ["x]yy yank N lines [into buffer x]
|
||||
|z| z{char} commands starting with 'z', see below
|
||||
|z| z{char} commands starting with 'z', see |z| below
|
||||
|{| { 1 cursor N paragraphs backward
|
||||
|bar| | 1 cursor to column N
|
||||
|}| } 1 cursor N paragraphs forward
|
||||
@@ -538,6 +541,9 @@ tag command action in Normal mode ~
|
||||
the cursor
|
||||
|CTRL-W_f| CTRL-W f split window and edit file name under the
|
||||
cursor
|
||||
|CTRL-W_F| CTRL-W F split window and edit file name under the
|
||||
cursor and jump to the line number
|
||||
following the file name.
|
||||
|CTRL-W_g_CTRL-]| CTRL-W g CTRL-] split window and do |:tjump| to tag under
|
||||
cursor
|
||||
|CTRL-W_g]| CTRL-W g ] split window and do |:tselect| for tag
|
||||
@@ -684,6 +690,7 @@ tag char note action in Normal mode ~
|
||||
of the current screen line
|
||||
|g8| g8 print hex value of bytes used in UTF-8
|
||||
character under the cursor
|
||||
|g<| g< display previous command output
|
||||
|g?| g? 2 Rot13 encoding operator
|
||||
|g?g?| g?? 2 Rot13 encode current line
|
||||
|g?g?| g?g? 2 Rot13 encode current line
|
||||
@@ -715,6 +722,9 @@ tag char note action in Normal mode ~
|
||||
word
|
||||
|gf| gf start editing the file whose name is under
|
||||
the cursor
|
||||
|gF| gF start editing the file whose name is under
|
||||
the cursor and jump to the line number
|
||||
following the filename.
|
||||
|gg| gg 1 cursor to line N, default first line
|
||||
|gh| gh start Select mode
|
||||
|gi| gi 2 like "i", but first move to the |'^| mark
|
||||
@@ -732,6 +742,7 @@ tag char note action in Normal mode ~
|
||||
|gu| gu{motion} 2 make Nmove text lowercase
|
||||
|gv| gv reselect the previous Visual area
|
||||
|gw| gw{motion} 2 format Nmove text and keep cursor
|
||||
|g@| g@{motion} call 'operatorfunc'
|
||||
|g~| g~{motion} 2 swap case for Nmove text
|
||||
|g<Down>| g<Down> 1 same as "gj"
|
||||
|g<End>| g<End> 1 same as "g$"
|
||||
@@ -755,16 +766,19 @@ tag char note action in Normal mode ~
|
||||
cursor on first non-blank
|
||||
|z.| z. redraw, cursor line to center of window,
|
||||
cursor on first non-blank
|
||||
|z=| z= give spelling suggestions
|
||||
|zA| zA open a closed fold or close an open fold
|
||||
recursively
|
||||
|zC| zC close folds recursively
|
||||
|zD| zD delete folds recursively
|
||||
|zE| zE eliminate all folds
|
||||
|zF| zF create a fold for N lines
|
||||
|zG| zG mark word as good spelled word
|
||||
|zM| zM set 'foldlevel' to zero
|
||||
|zN| zN set 'foldenable'
|
||||
|zO| zO open folds recursively
|
||||
|zR| zR set 'foldlevel' to the deepest fold
|
||||
|zW| zW mark word as wrong (bad) spelled word
|
||||
|zX| zX re-apply 'foldlevel'
|
||||
|z^| z^ cursor on line N (default line above
|
||||
window), otherwise like "z-"
|
||||
@@ -776,6 +790,7 @@ tag char note action in Normal mode ~
|
||||
position the cursor at the end (right side)
|
||||
of the screen
|
||||
|zf| zf{motion} create a fold for Nmove text
|
||||
|zg| zg mark word as good spelled word
|
||||
|zh| zh when 'wrap' off scroll screen N characters
|
||||
to the right
|
||||
|zi| zi toggle 'foldenable'
|
||||
@@ -792,6 +807,7 @@ tag char note action in Normal mode ~
|
||||
side) of the screen
|
||||
|zt| zt redraw, cursor line at top of window
|
||||
|zv| zv open enough folds to view the cursor line
|
||||
|zw| zw mark word as wrong (bad) spelled word
|
||||
|zx| zx re-apply 'foldlevel' and do "zv"
|
||||
|zz| zz redraw, cursor line at center of window
|
||||
|z<Left>| z<Left> same as "zh"
|
||||
@@ -800,7 +816,7 @@ tag char note action in Normal mode ~
|
||||
==============================================================================
|
||||
3. Visual mode *visual-index*
|
||||
|
||||
Most commands in Visual mode are the same as in Normal mode. The ones listed
|
||||
Most commands in Visual mode are the same as in Normal mode. The ones listed
|
||||
here are those that are different.
|
||||
|
||||
tag command note action in Visual mode ~
|
||||
@@ -1059,6 +1075,9 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cNfile| :cNf[ile] go to last error in previous file
|
||||
|:cabbrev| :ca[bbrev] like ":abbreviate" but for Command-line mode
|
||||
|:cabclear| :cabc[lear] clear all abbreviations for Command-line mode
|
||||
|:caddbuffer| :caddb[uffer] add errors from buffer
|
||||
|:caddexpr| :cad[dexpr] add errors from expr
|
||||
|:caddfile| :caddf[ile] add error message to current quickfix list
|
||||
|:call| :cal[l] call a function
|
||||
|:catch| :cat[ch] part of a :try command
|
||||
|:cbuffer| :cb[uffer] parse error messages and jump to first error
|
||||
@@ -1066,8 +1085,11 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:cclose| :ccl[ose] close quickfix window
|
||||
|:cd| :cd change directory
|
||||
|:center| :ce[nter] format lines at the center
|
||||
|:cexpr| :cex[pr] read errors from expr and jump to first
|
||||
|:cfile| :cf[ile] read file with error messages and jump to first
|
||||
|:cfirst| :cfir[st] go to the specified error, default first one
|
||||
|:cgetbuffer| :cgetb[uffer] get errors from buffer
|
||||
|:cgetexpr| :cgete[xpr] get errors from expr
|
||||
|:cgetfile| :cg[etfile] read file with error messages
|
||||
|:changes| :cha[nges] print the change list
|
||||
|:chdir| :chd[ir] change directory
|
||||
@@ -1128,6 +1150,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:dsearch| :ds[earch] list one #define
|
||||
|:dsplit| :dsp[lit] split window and jump to #define
|
||||
|:edit| :e[dit] edit a file
|
||||
|:earlier| :ea[rlier] go to older change, undo
|
||||
|:echo| :ec[ho] echoes the result of expressions
|
||||
|:echoerr| :echoe[rr] like :echo, show like an error and use history
|
||||
|:echohl| :echoh[l] set highlighting for echo commands
|
||||
@@ -1137,6 +1160,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:elseif| :elsei[f] part of an :if command
|
||||
|:emenu| :em[enu] execute a menu by name
|
||||
|:endif| :en[dif] end previous :if
|
||||
|:endfor| :endfo[r] end previous :for
|
||||
|:endfunction| :endf[unction] end of a user function
|
||||
|:endtry| :endt[ry] end previous :try
|
||||
|:endwhile| :endw[hile] end previous :while
|
||||
@@ -1158,11 +1182,12 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:folddoopen| :foldd[oopen] execute command on lines not in a closed fold
|
||||
|:folddoclosed| :folddoc[losed] execute command on lines in a closed fold
|
||||
|:foldopen| :foldo[pen] open folds
|
||||
|:for| :for for loop
|
||||
|:function| :fu[nction] define a user function
|
||||
|:global| :g[lobal] execute commands for matching lines
|
||||
|:goto| :go[to] go to byte in the buffer
|
||||
|:grep| :gr[ep] run 'grepprg' and jump to first match
|
||||
|:grepadd| :grepa[dd] like grep, but append to current list
|
||||
|:grepadd| :grepa[dd] like :grep, but append to current list
|
||||
|:gui| :gu[i] start the GUI
|
||||
|:gvim| :gv[im] start the GUI
|
||||
|:hardcopy| :ha[rdcopy] send text to the printer
|
||||
@@ -1195,25 +1220,62 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:join| :j[oin] join lines
|
||||
|:jumps| :ju[mps] print the jump list
|
||||
|:k| :k set a mark
|
||||
|:keepalt| :keepa[lt] following command keeps the alternate file
|
||||
|:keepmarks| :kee[pmarks] following command keeps marks where they are
|
||||
|:keepjumps| :keepj[jumps] following command keeps jumplist and marks
|
||||
|:lNext| :lN[ext] go to previous entry in location list
|
||||
|:lNfile| :lNf[ile] go to last entry in previous file
|
||||
|:list| :l[ist] print lines
|
||||
|:laddexpr| :lad[dexpr] add locations from expr
|
||||
|:laddbuffer| :laddb[uffer] add locations from buffer
|
||||
|:laddfile| :laddf[ile] add locations to current location list
|
||||
|:last| :la[st] go to the last file in the argument list
|
||||
|:language| :lan[guage] set the language (locale)
|
||||
|:later| :lat[er] go to newer change, redo
|
||||
|:lbuffer| :lb[uffer] parse locations and jump to first location
|
||||
|:lcd| :lc[d] change directory locally
|
||||
|:lchdir| :lch[dir] change directory locally
|
||||
|:lclose| :lcl[ose] close location window
|
||||
|:lcscope| :lcs[cope] like ":cscope" but uses location list
|
||||
|:left| :le[ft] left align lines
|
||||
|:leftabove| :lefta[bove] make split window appear left or above
|
||||
|:let| :let assign a value to a variable or option
|
||||
|:lexpr| :lex[pr] read locations from expr and jump to first
|
||||
|:lfile| :lf[ile] read file with locations and jump to first
|
||||
|:lfirst| :lfir[st] go to the specified location, default first one
|
||||
|:lgetbuffer| :lgetb[uffer] get locations from buffer
|
||||
|:lgetexpr| :lgete[xpr] get locations from expr
|
||||
|:lgetfile| :lg[etfile] read file with locations
|
||||
|:lgrep| :lgr[ep] run 'grepprg' and jump to first match
|
||||
|:lgrepadd| :lgrepa[dd] like :grep, but append to current list
|
||||
|:lhelpgrep| :lh[elpgrep] like ":helpgrep" but uses location list
|
||||
|:ll| :ll go to specific location
|
||||
|:llast| :lla[st] go to the specified location, default last one
|
||||
|:llist| :lli[st] list all locations
|
||||
|:lmake| :lmak[e] execute external command 'makeprg' and parse
|
||||
error messages
|
||||
|:lmap| :lm[ap] like ":map!" but includes Lang-Arg mode
|
||||
|:lmapclear| :lmapc[lear] like ":mapclear!" but includes Lang-Arg mode
|
||||
|:lnext| :lne[xt] go to next location
|
||||
|:lnewer| :lnew[er] go to newer location list
|
||||
|:lnfile| :lnf[ile] go to first location in next file
|
||||
|:lnoremap| :ln[oremap] like ":noremap!" but includes Lang-Arg mode
|
||||
|:loadkeymap| :loadk[eymap] load the following keymaps until EOF
|
||||
|:loadview| :lo[adview] load view for current window from a file
|
||||
|:lockmarks| :loc[kmarks] following command keeps marks where they are
|
||||
|:lockvar| :lockv[ar] lock variables
|
||||
|:lolder| :lol[der] go to older location list
|
||||
|:lopen| :lope[n] open location window
|
||||
|:lprevious| :lp[revious] go to previous location
|
||||
|:lpfile| :lpf[ile] go to last location in previous file
|
||||
|:lrewind| :lr[ewind] go to the specified location, default first one
|
||||
|:ls| :ls list all buffers
|
||||
|:ltag| :lt[ag] jump to tag and add matching tags to the
|
||||
location list
|
||||
|:lunmap| :lu[nmap] like ":unmap!" but includes Lang-Arg mode
|
||||
|:lvimgrep| :lv[imgrep] search for pattern in files
|
||||
|:lvimgrepadd| :lvimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:lwindow| :lw[indow] open or close location window
|
||||
|:move| :m[ove] move lines
|
||||
|:mark| :ma[rk] set a mark
|
||||
|:make| :mak[e] execute external command 'makeprg' and parse
|
||||
@@ -1227,11 +1289,13 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:messages| :mes[sages] view previously displayed messages
|
||||
|:mkexrc| :mk[exrc] write current mappings and settings to a file
|
||||
|:mksession| :mks[ession] write session info to a file
|
||||
|:mkspell| :mksp[ell] produce .spl spell file
|
||||
|:mkvimrc| :mkv[imrc] write current mappings and settings to a file
|
||||
|:mkview| :mkvie[w] write view of current window to a file
|
||||
|:mode| :mod[e] show or change the screen mode
|
||||
|:mzscheme| :mz[scheme] execute MzScheme command
|
||||
|:mzfile| :mzf[ile] execute MzScheme script file
|
||||
|:nbkey| :nb[key] pass a key to Netbeans
|
||||
|:next| :n[ext] go to next file in the argument list
|
||||
|:new| :new create a new empty window
|
||||
|:nmap| :nm[ap] like ":map" but for Normal mode
|
||||
@@ -1239,6 +1303,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:nmenu| :nme[nu] add menu for Normal mode
|
||||
|:nnoremap| :nn[oremap] like ":noremap" but for Normal mode
|
||||
|:nnoremenu| :nnoreme[nu] like ":noremenu" but for Normal mode
|
||||
|:noautocmd| :noa[utocmd] following command don't trigger autocommands
|
||||
|:noremap| :no[remap] enter a mapping that will not be remapped
|
||||
|:nohlsearch| :noh[lsearch] suspend 'hlsearch' highlighting
|
||||
|:noreabbrev| :norea[bbrev] enter an abbreviation that will not be
|
||||
@@ -1252,7 +1317,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:omap| :om[ap] like ":map" but for Operator-pending mode
|
||||
|:omapclear| :omapc[lear] remove all mappings for Operator-pending mode
|
||||
|:omenu| :ome[nu] add menu for Operator-pending mode
|
||||
|:only| :on[ly] close all windows except current one
|
||||
|:only| :on[ly] close all windows except the current one
|
||||
|:onoremap| :ono[remap] like ":noremap" but for Operator-pending mode
|
||||
|:onoremenu| :onoreme[nu] like ":noremenu" but for Operator-pending mode
|
||||
|:options| :opt[ions] open the options-window
|
||||
@@ -1262,6 +1327,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:pedit| :ped[it] edit file in the preview window
|
||||
|:perl| :pe[rl] execute Perl command
|
||||
|:print| :p[rint] print lines
|
||||
|:profdel| :profd[el] stop profiling a function or script
|
||||
|:profile| :prof[ile] profiling functions and scripts
|
||||
|:promptfind| :pro[mtfind] open GUI dialog for searching
|
||||
|:promptrepl| :promtr[epl] open GUI dialog for search/replace
|
||||
@@ -1311,6 +1377,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:substitute| :s[ubstitute] find and replace text
|
||||
|:sNext| :sN[ext] split window and go to previous file in
|
||||
argument list
|
||||
|:sandbox| :san[dbox] execute a command in the sandbox
|
||||
|:sargument| :sa[rgument] split window and go to specific file in
|
||||
argument list
|
||||
|:sall| :sal[l] open a window for each file in argument list
|
||||
@@ -1334,7 +1401,7 @@ The commands are sorted on the non-optional part of their name.
|
||||
buffer list
|
||||
|:scriptnames| :scrip[tnames] list names of all sourced Vim scripts
|
||||
|:scriptencoding| :scripte[ncoding] encoding used in sourced Vim script
|
||||
|:scscope| :scs[cope] split window and execute cscope command
|
||||
|:scscope| :scs[cope] split window and execute cscope command
|
||||
|:set| :se[t] show or set options
|
||||
|:setfiletype| :setf[iletype] set 'filetype', unless it was set already
|
||||
|:setglobal| :setg[lobal] show global values of options
|
||||
@@ -1350,11 +1417,23 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:slast| :sla[st] split window and go to last file in the
|
||||
argument list
|
||||
|:smagic| :sm[agic] :substitute with 'magic'
|
||||
|:smap| :sma[p] like ":map" but for Select mode
|
||||
|:smapclear| :smapc[lear] remove all mappings for Select mode
|
||||
|:smenu| :sme[nu] add menu for Select mode
|
||||
|:snext| :sn[ext] split window and go to next file in the
|
||||
argument list
|
||||
|:sniff| :sni[ff] send request to sniff
|
||||
|:snomagic| :sno[magic] :substitute with 'nomagic'
|
||||
|:snoremap| :snor[emap] like ":noremap" but for Select mode
|
||||
|:snoremenu| :snoreme[nu] like ":noremenu" but for Select mode
|
||||
|:sort| :sor[t] sort lines
|
||||
|:source| :so[urce] read Vim or Ex commands from a file
|
||||
|:spelldump| :spelld[ump] split window and fill with all correct words
|
||||
|:spellgood| :spe[llgood] add good word for spelling
|
||||
|:spellinfo| :spelli[nfo] show info about loaded spell files
|
||||
|:spellrepall| :spellr[epall] replace all bad words like last |z=|
|
||||
|:spellundo| :spellu[ndo] remove good or bad word
|
||||
|:spellwrong| :spellw[rong] add spelling mistake
|
||||
|:split| :sp[lit] split current window
|
||||
|:sprevious| :spr[evious] split window and go to previous file in the
|
||||
argument list
|
||||
@@ -1363,11 +1442,14 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:stop| :st[op] suspend the editor or escape to a shell
|
||||
|:stag| :sta[g] split window and jump to a tag
|
||||
|:startinsert| :star[tinsert] start Insert mode
|
||||
|:startgreplace| :startg[replace] start Virtual Replace mode
|
||||
|:startreplace| :startr[eplace] start Replace mode
|
||||
|:stopinsert|| :stopi[nsert] stop Insert mode
|
||||
|:stjump| :stj[ump] do ":tjump" and split window
|
||||
|:stselect| :sts[elect] do ":tselect" and split window
|
||||
|:sunhide| :sun[hide] same as ":unhide"
|
||||
|:sunmap| :sunm[ap] like ":unmap" but for Select mode
|
||||
|:sunmenu| :sunme[nu] remove menu for Select mode
|
||||
|:suspend| :sus[pend] same as ":stop"
|
||||
|:sview| :sv[iew] split window and edit file read-only
|
||||
|:swapname| :sw[apname] show the name of the current swap file
|
||||
@@ -1375,6 +1457,21 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:syncbind| :sync[bind] sync scroll binding
|
||||
|:t| :t same as ":copy"
|
||||
|:tNext| :tN[ext] jump to previous matching tag
|
||||
|:tabNext| :tabN[ext] go to previous tab page
|
||||
|:tabclose| :tabc[lose] close current tab page
|
||||
|:tabdo| :tabdo execute command in each tab page
|
||||
|:tabedit| :tabe[dit] edit a file in a new tab page
|
||||
|:tabfind| :tabf[ind] find file in 'path', edit it in a new tab page
|
||||
|:tabfirst| :tabfir[st] got to first tab page
|
||||
|:tablast| :tabl[ast] got to last tab page
|
||||
|:tabmove| :tabm[ove] move tab page to other position
|
||||
|:tabnew| :tabnew edit a file in a new tab page
|
||||
|:tabnext| :tabn[ext] go to next tab page
|
||||
|:tabonly| :tabo[nly] close all tab pages except the current one
|
||||
|:tabprevious| :tabp[revious] go to previous tab page
|
||||
|:tabrewind| :tabr[ewind] got to first tab page
|
||||
|:tabs| :tabs list the tab pages and what they contain
|
||||
|:tab| :tab create new tab when opening new window
|
||||
|:tag| :ta[g] jump to tag
|
||||
|:tags| :tags show the contents of the tag stack
|
||||
|:tcl| :tc[l] execute Tcl command
|
||||
@@ -1395,6 +1492,8 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:tselect| :ts[elect] list matching tags and select one
|
||||
|:tunmenu| :tu[nmenu] remove menu tooltip
|
||||
|:undo| :u[ndo] undo last change(s)
|
||||
|:undojoin| :undoj[oin] join next change with previous undo block
|
||||
|:undolist| :undol[ist] list leafs of the undo tree
|
||||
|:unabbreviate| :una[bbreviate] remove abbreviation
|
||||
|:unhide| :unh[ide] open a window for each loaded file in the
|
||||
buffer list
|
||||
@@ -1407,18 +1506,20 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:version| :ve[rsion] print version number and other info
|
||||
|:verbose| :verb[ose] execute command with 'verbose' set
|
||||
|:vertical| :vert[ical] make following command split vertically
|
||||
|:vimgrep| :vim[grep] search for pattern in files
|
||||
|:vimgrepadd| :vimgrepa[dd] like :vimgrep, but append to current list
|
||||
|:visual| :vi[sual] same as ":edit", but turns off "Ex" mode
|
||||
|:viusage| :viu[sage] overview of Normal mode commands
|
||||
|:view| :vie[w] edit a file read-only
|
||||
|:vmap| :vm[ap] like ":map" but for Visual mode
|
||||
|:vmapclear| :vmapc[lear] remove all mappings for Visual mode
|
||||
|:vmenu| :vme[nu] add menu for Visual mode
|
||||
|:vnoremap| :vn[oremap] like ":noremap" but for Visual mode
|
||||
|:vmap| :vm[ap] like ":map" but for Visual+Select mode
|
||||
|:vmapclear| :vmapc[lear] remove all mappings for Visual+Select mode
|
||||
|:vmenu| :vme[nu] add menu for Visual+Select mode
|
||||
|:vnew| :vne[w] create a new empty window, vertically split
|
||||
|:vnoremenu| :vnoreme[nu] like ":noremenu" but for Visual mode
|
||||
|:vnoremap| :vn[oremap] like ":noremap" but for Visual+Select mode
|
||||
|:vnoremenu| :vnoreme[nu] like ":noremenu" but for Visual+Select mode
|
||||
|:vsplit| :vs[plit] split current window vertically
|
||||
|:vunmap| :vu[nmap] like ":unmap" but for Visual mode
|
||||
|:vunmenu| :vunme[nu] remove menu for Visual mode
|
||||
|:vunmap| :vu[nmap] like ":unmap" but for Visual+Select mode
|
||||
|:vunmenu| :vunme[nu] remove menu for Visual+Select mode
|
||||
|:windo| :windo execute command in each window
|
||||
|:write| :w[rite] write to a file
|
||||
|:wNext| :wN[ext] write to a file and go to previous file in
|
||||
@@ -1438,8 +1539,16 @@ The commands are sorted on the non-optional part of their name.
|
||||
|:wviminfo| :wv[iminfo] write to viminfo file
|
||||
|:xit| :x[it] write if buffer changed and quit window or Vim
|
||||
|:xall| :xa[ll] same as ":wqall"
|
||||
|:xmapclear| :xmapc[lear] remove all mappings for Visual mode
|
||||
|:xmap| :xm[ap] like ":map" but for Visual mode
|
||||
|:xmenu| :xme[nu] add menu for Visual mode
|
||||
|:xnoremap| :xn[oremap] like ":noremap" but for Visual mode
|
||||
|:xnoremenu| :xnoreme[nu] like ":noremenu" but for Visual mode
|
||||
|:xunmap| :xu[nmap] like ":unmap" but for Visual mode
|
||||
|:xunmenu| :xunme[nu] remove menu for Visual mode
|
||||
|:yank| :y[ank] yank lines into a register
|
||||
|:z| :z print some lines
|
||||
|:~| :~ repeat last ":substitute"
|
||||
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*insert.txt* For Vim version 7.0aa. Last change: 2005 Feb 21
|
||||
*insert.txt* For Vim version 7.0b. Last change: 2006 Mar 21
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -126,8 +126,13 @@ CTRL-R {0-9a-z"%#*+:.-=} *i_CTRL-R*
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
Note that 0x80 (128 decimal) is used for
|
||||
special keys, use CTRL-R CTRL-R to insert it
|
||||
literally.
|
||||
special keys. E.g., you can use this to move
|
||||
the cursor up:
|
||||
CTRL-R ="\<Up>"
|
||||
Use CTRL-R CTRL-R to insert text literally.
|
||||
When the result is a |List| the items are used
|
||||
as lines. They can have line breaks inside
|
||||
too.
|
||||
See |registers| about registers. {not in Vi}
|
||||
|
||||
CTRL-R CTRL-R {0-9a-z"%#*+/:.-=} *i_CTRL-R_CTRL-R*
|
||||
@@ -190,7 +195,7 @@ CTRL-Q Same as CTRL-V.
|
||||
work then. It does work in the GUI.
|
||||
|
||||
CTRL-X Enter CTRL-X mode. This is a sub-mode where commands can
|
||||
be given to complete words or scroll the window. See
|
||||
be given to complete words or scroll the window. See
|
||||
|i_CTRL-X| and |ins-completion|. {not in Vi}
|
||||
|
||||
*i_CTRL-E*
|
||||
@@ -271,7 +276,7 @@ entered directly. This way you can enter any character, except a line break
|
||||
|
||||
first char mode max nr of chars max value ~
|
||||
(none) decimal 3 255
|
||||
o or O octal 3 255
|
||||
o or O octal 3 377 (255)
|
||||
x or X hexadecimal 2 ff (255)
|
||||
u hexadecimal 4 ffff (65535)
|
||||
U hexadecimal 8 7fffffff (2147483647)
|
||||
@@ -354,6 +359,8 @@ CTRL-G CTRL-J cursor one line down, insert start column *i_CTRL-G_CTRL-J*
|
||||
<MouseUp> scroll three lines up *i_<MouseUp>*
|
||||
<S-MouseUp> scroll a full page up *i_<S-MouseUp>*
|
||||
CTRL-O execute one command, return to Insert mode *i_CTRL-O*
|
||||
CTRL-\ CTRL-O like CTRL-O but don't move the cursor *i_CTRL-\_CTRL-O*
|
||||
CTRL-L when 'insertmode' is set: go to Normal mode *i_CTRL-L*
|
||||
CTRL-G u break undo sequence, start new change *i_CTRL-G_u*
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
@@ -363,7 +370,8 @@ option.
|
||||
The CTRL-O command sometimes has a side effect: If the cursor was beyond the
|
||||
end of the line, it will be put on the last character in the line. In
|
||||
mappings it's often better to use <Esc> (first put an "x" in the text, <Esc>
|
||||
will then always put the cursor on it).
|
||||
will then always put the cursor on it). Or use CTRL-\ CTRL-O, but then
|
||||
beware of the cursor possibly being beyond the end of the line.
|
||||
|
||||
The shifted cursor keys are not available on all terminals.
|
||||
|
||||
@@ -392,7 +400,7 @@ The CTRL-G j and CTRL-G k commands can be used to insert text in front of a
|
||||
column. Example: >
|
||||
int i;
|
||||
int j;
|
||||
Position the cursor on the first "int", type "istatic<C-G>j ". The
|
||||
Position the cursor on the first "int", type "istatic <C-G>j ". The
|
||||
result is: >
|
||||
static int i;
|
||||
int j;
|
||||
@@ -419,7 +427,7 @@ When 'textwidth' and 'wrapmargin' are both set, 'textwidth' is used.
|
||||
If you don't really want to break the line, but view the line wrapped at a
|
||||
convenient place, see the 'linebreak' option.
|
||||
|
||||
The line is only broken automatically when using insert mode, or when
|
||||
The line is only broken automatically when using Insert mode, or when
|
||||
appending to a line. When in replace mode and the line length is not
|
||||
changed, the line will not be broken.
|
||||
|
||||
@@ -435,6 +443,10 @@ characters to the 'formatoptions' option:
|
||||
current insert command. Only differs from "l" when entering non-white
|
||||
characters while crossing the 'textwidth' boundary.
|
||||
|
||||
Normally an internal function will be used to decide where to break the line.
|
||||
If you want to do it in a different way set the 'formatexpr' option to an
|
||||
expression that will take care of the line break.
|
||||
|
||||
If you want to format a block of text, you can use the "gq" operator. Type
|
||||
"gq" and a movement command to move the cursor to the end of the block. In
|
||||
many cases, the command "gq}" will do what you want (format until the end of
|
||||
@@ -547,7 +559,7 @@ entering new data while keeping all the columns aligned.
|
||||
==============================================================================
|
||||
7. Insert mode completion *ins-completion*
|
||||
|
||||
In Insert and Replace modes, there are several commands to complete part of a
|
||||
In Insert and Replace mode, there are several commands to complete part of a
|
||||
keyword or line that has been typed. This is useful if you are using
|
||||
complicated keywords (e.g., function names with capitals and underscores).
|
||||
|
||||
@@ -565,7 +577,10 @@ Completion can be done for:
|
||||
7. file names |i_CTRL-X_CTRL-F|
|
||||
8. definitions or macros |i_CTRL-X_CTRL-D|
|
||||
9. Vim command-line |i_CTRL-X_CTRL-V|
|
||||
10. keywords in 'complete' |i_CTRL-N|
|
||||
10. User defined completion |i_CTRL-X_CTRL-U|
|
||||
11. omni completion |i_CTRL-X_CTRL-O|
|
||||
12. Spelling suggestions |i_CTRL-X_s|
|
||||
13. keywords in 'complete' |i_CTRL-N|
|
||||
|
||||
All these (except 2) are done in CTRL-X mode. This is a sub-mode of Insert
|
||||
and Replace modes. You enter CTRL-X mode by typing CTRL-X and one of the
|
||||
@@ -612,11 +627,11 @@ Completing whole lines *compl-whole-line*
|
||||
|
||||
*i_CTRL-X_CTRL-L*
|
||||
CTRL-X CTRL-L Search backwards for a line that starts with the
|
||||
same characters as in the current line before the
|
||||
cursor. Indent is ignored. The found line is
|
||||
same characters as those in the current line before
|
||||
the cursor. Indent is ignored. The matching line is
|
||||
inserted in front of the cursor.
|
||||
The 'complete' option is used to decide in which
|
||||
buffers a match is searched for. But only loaded
|
||||
The 'complete' option is used to decide which buffers
|
||||
are searched for a match. Both loaded and unloaded
|
||||
buffers are used.
|
||||
CTRL-L or
|
||||
CTRL-P Search backwards for next matching line. This line
|
||||
@@ -668,6 +683,9 @@ at least two characters is matched.
|
||||
just type:
|
||||
printf("(%g, %g, %g)", vector[0], ^P[1], ^P[2]);
|
||||
|
||||
The search wraps around the end of the file, the value of 'wrapscan' is not
|
||||
used here.
|
||||
|
||||
Multiple repeats of the same completion are skipped; thus a different match
|
||||
will be inserted at each CTRL-N and CTRL-P (unless there is only one
|
||||
matching keyword).
|
||||
@@ -726,7 +744,7 @@ CTRL-X CTRL-K Search the files given with the 'dictionary' option
|
||||
keyword replaces the previous matching keyword.
|
||||
|
||||
*i_CTRL-X_CTRL-T*
|
||||
CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
CTRL-X CTRL-T Works as CTRL-X CTRL-K, but in a special way. It uses
|
||||
the 'thesaurus' option instead of 'dictionary'. If a
|
||||
match is found in the thesaurus file, all the
|
||||
remaining words on the same line are included as
|
||||
@@ -839,7 +857,8 @@ CTRL-X CTRL-D Search in the current and included files for the
|
||||
Completing Vim commands *compl-vim*
|
||||
|
||||
Completion is context-sensitive. It works like on the Command-line. It
|
||||
completes an Ex command as well as its arguments.
|
||||
completes an Ex command as well as its arguments. This is useful when writing
|
||||
a Vim script.
|
||||
|
||||
*i_CTRL-X_CTRL-V*
|
||||
CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
|
||||
@@ -858,11 +877,11 @@ CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
|
||||
completion, for example: >
|
||||
:imap <Tab> <C-X><C-V>
|
||||
|
||||
User defined completing *compl-function*
|
||||
User defined completion *compl-function*
|
||||
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'completefunc' option. See the option for how the function is called and an
|
||||
example.
|
||||
'completefunc' option. See below for how the function is called and an
|
||||
example |complete-functions|.
|
||||
|
||||
*i_CTRL-X_CTRL-U*
|
||||
CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
|
||||
@@ -875,6 +894,47 @@ CTRL-X CTRL-U Guess what kind of item is in front of the cursor and
|
||||
previous one.
|
||||
|
||||
|
||||
Omni completion *compl-omni*
|
||||
|
||||
Completion is done by a function that can be defined by the user with the
|
||||
'omnifunc' option. This is to be used for filetype-specific completion.
|
||||
|
||||
See below for how the function is called and an example |complete-functions|.
|
||||
For remarks about specific filetypes see |compl-omni-filetypes|.
|
||||
|
||||
*i_CTRL-X_CTRL-O*
|
||||
CTRL-X CTRL-O Guess what kind of item is in front of the cursor and
|
||||
find the first match for it.
|
||||
CTRL-O or
|
||||
CTRL-N Use the next match. This match replaces the previous
|
||||
one.
|
||||
|
||||
CTRL-P Use the previous match. This match replaces the
|
||||
previous one.
|
||||
|
||||
|
||||
Spelling suggestions *compl-spelling*
|
||||
|
||||
A word before or at the cursor is located and correctly spelled words are
|
||||
suggested to replace it. If there is a badly spelled word in the line, before
|
||||
or under the cursor, the cursor is moved to after it. Otherwise the word just
|
||||
before the cursor is used for suggestions, even though it isn't badly spelled.
|
||||
|
||||
NOTE: CTRL-S suspends display in many Unix terminals. Use 's' instead. Type
|
||||
CTRL-Q to resume displaying.
|
||||
|
||||
*i_CTRL-X_CTRL-S* *i_CTRL-X_s*
|
||||
CTRL-X CTRL-S or
|
||||
CTRL-X s Locate the word in front of the cursor and find the
|
||||
first spell suggestion for it.
|
||||
CTRL-S or
|
||||
CTRL-N Use the next suggestion. This replaces the previous
|
||||
one. Note that you can't use 's' here.
|
||||
|
||||
CTRL-P Use the previous suggestion. This replaces the
|
||||
previous one.
|
||||
|
||||
|
||||
Completing keywords from different sources *compl-generic*
|
||||
|
||||
*i_CTRL-N*
|
||||
@@ -900,6 +960,520 @@ CTRL-P Find previous match for words that start with the
|
||||
copy the words following the previous expansion in
|
||||
other contexts unless a double CTRL-X is used.
|
||||
|
||||
|
||||
FUNCTIONS FOR FINDING COMPLETIONS *complete-functions*
|
||||
|
||||
This applies to 'completefunc' and 'omnifunc'.
|
||||
|
||||
The function is called in two different ways:
|
||||
- First the function is called to find the start of the text to be completed.
|
||||
- Later the function is called to actually find the matches.
|
||||
|
||||
On the first invocation the arguments are:
|
||||
a:findstart 1
|
||||
a:base empty
|
||||
|
||||
The function must return the column where the completion starts. It must be a
|
||||
number between zero and the cursor column "col('.')". This involves looking
|
||||
at the characters just before the cursor and including those characters that
|
||||
could be part of the completed item. The text between this column and the
|
||||
cursor column will be replaced with the matches. Return -1 if no completion
|
||||
can be done.
|
||||
|
||||
On the second invocation the arguments are:
|
||||
a:findstart 0
|
||||
a:base the text with which matches should match; the text that was
|
||||
located in the first call (can be empty)
|
||||
|
||||
The function must return a List with the matching words. These matches
|
||||
usually include the "a:base" text. When there are no matches return an empty
|
||||
List.
|
||||
*complete-items*
|
||||
Each list item can either be a string or a Dictionary. When it is a string it
|
||||
is used as the completion. When it is a Dictionary it can contain these
|
||||
items:
|
||||
word the completion, mandatory
|
||||
abbr abbreviation of "word", to be used in the menu
|
||||
menu extra text for the popup menu
|
||||
info more information about the item
|
||||
kind single letter indicating the type of completion
|
||||
icase when non-zero case is to be ignored; when omitted
|
||||
the 'ignorecase' option is used
|
||||
|
||||
All of these except 'icase' must be a string. If an item does not meet these
|
||||
requirements then an error message is given and further items in the list are
|
||||
not used. You can mix string and Dictionary items in the returned list.
|
||||
|
||||
The "menu" item is used in the popup menu and may be truncated, thus it should
|
||||
be relatively short. The "info" item can be longer, it will be displayed in
|
||||
the preview window when "preview" appears in 'completeopt'. The "info" item
|
||||
will also remain displayed after the popup menu has been removed. This is
|
||||
useful for function arguments.
|
||||
|
||||
The "kind" item uses a single letter to indicate the kind of completion. This
|
||||
may be used to show the completion differently (different color or icon).
|
||||
Currently these types can be used:
|
||||
v variable
|
||||
f function or method
|
||||
m member of a struct or class
|
||||
t typedef
|
||||
d #define or macro
|
||||
|
||||
When searching for matches takes some time call |complete_add()| to add each
|
||||
match to the total list. These matches should then not appear in the returned
|
||||
list! Call |complete_check()| now and then to allow the user to press a key
|
||||
while still searching for matches. Stop searching when it returns non-zero.
|
||||
|
||||
The function is allowed to move the cursor, it is restored afterwards. This
|
||||
option cannot be set from a |modeline| or in the |sandbox|, for security
|
||||
reasons.
|
||||
|
||||
An example that completes the names of the months: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
let res = []
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call add(res, m)
|
||||
endif
|
||||
endfor
|
||||
return res
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
The same, but now pretending searching for matches is slow: >
|
||||
fun! CompleteMonths(findstart, base)
|
||||
if a:findstart
|
||||
" locate the start of the word
|
||||
let line = getline('.')
|
||||
let start = col('.') - 1
|
||||
while start > 0 && line[start - 1] =~ '\a'
|
||||
let start -= 1
|
||||
endwhile
|
||||
return start
|
||||
else
|
||||
" find months matching with "a:base"
|
||||
for m in split("Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec")
|
||||
if m =~ '^' . a:base
|
||||
call complete_add(m)
|
||||
endif
|
||||
sleep 300m " simulate searching for next match
|
||||
if complete_check()
|
||||
break
|
||||
endif
|
||||
endfor
|
||||
return []
|
||||
endif
|
||||
endfun
|
||||
set completefunc=CompleteMonths
|
||||
<
|
||||
|
||||
INSERT COMPLETION POPUP MENU *ins-completion-menu*
|
||||
*popupmenu-completion*
|
||||
Vim can display the matches in a simplistic popup menu.
|
||||
|
||||
The menu is used when:
|
||||
- The 'completeopt' option contains "menu" or "menuone".
|
||||
- The terminal supports at least 8 colors.
|
||||
- There are at least two matches.
|
||||
|
||||
The 'pumheight' option can be used to set a maximum height. The default is to
|
||||
use all space available.
|
||||
|
||||
There are two states:
|
||||
1. A complete match has been inserted.
|
||||
2. Only part of a match has been inserted.
|
||||
|
||||
You normally start in the first state, with the first match being inserted.
|
||||
When "longest" is in 'completeopt' and there is more than one match you start
|
||||
in the second state.
|
||||
|
||||
If you select another match, e.g., with CTRL-N or CTRL-P, you go from the
|
||||
second to the first state. This doesn't change the list of matches.
|
||||
|
||||
When you are back at the original text then you are in the second state. To
|
||||
get there right away you can use a mapping that uses CTRL-P right after
|
||||
starting the completion: >
|
||||
:imap <F7> <C-N><C-P>
|
||||
<
|
||||
*popupmenu-keys*
|
||||
In the first state these keys have a special meaning:
|
||||
<BS> and CTRL-H Delete one character, find the matches for the word before
|
||||
the cursor. This reduces the list of matches, often to one
|
||||
entry, and switches to the second state.
|
||||
|
||||
In the second state these keys have a special meaning:
|
||||
<BS> and CTRL-H Delete one character, find the matches for the shorter word
|
||||
before the cursor. This may find more matches.
|
||||
CTRL-L Add one character from the current match, may reduce the
|
||||
number of matches.
|
||||
any printable, non-white character:
|
||||
Add this character and reduce the number of matches.
|
||||
|
||||
In both states these can be used:
|
||||
<CR> and <Enter> Accept the currently selected match and stop completion.
|
||||
<PageUp> Select a match several entries back, but don't insert it.
|
||||
<PageDown> Select a match several entries further, but don't insert it.
|
||||
<Up> Select the previous match, as if CTRL-P was used, but don't
|
||||
insert it.
|
||||
<Down> Select the next match, as if CTRL-N was used, but don't
|
||||
insert it.
|
||||
Any other character:
|
||||
Stop completion without changing the match and insert the
|
||||
typed character. Note that typing a space or <Tab> will
|
||||
work in both states.
|
||||
|
||||
|
||||
The colors of the menu can be changed with these highlight groups:
|
||||
Pmenu normal item |hl-Pmenu|
|
||||
PmenuSel selected item |hl-PmenuSel|
|
||||
PmenuSbar scrollbar |hl-PmenuSbar|
|
||||
PmenuThumb thumb of the scrollbar |hl-PmenuThumb|
|
||||
|
||||
There are no special mappings for when the popup menu is visible. However,
|
||||
you can use an Insert mode mapping that checks the |pumvisible()| function to
|
||||
do something different. Example: >
|
||||
:inoremap <Down> <C-R>=pumvisible() ? "\<lt>C-N>" : "\<lt>Down>"<CR>
|
||||
|
||||
You can use of <expr> in mapping to have the popup menu used when typing a
|
||||
character and some condition is met. For example, for typing a dot: >
|
||||
inoremap <expr> . MayComplete()
|
||||
func MayComplete()
|
||||
if (can complete)
|
||||
return ".\<C-X>\<C-O>"
|
||||
endif
|
||||
return '.'
|
||||
endfunc
|
||||
|
||||
See |:map-<expr>| for more info.
|
||||
|
||||
|
||||
FILETYPE-SPECIFIC REMARKS FOR OMNI COMPLETION *compl-omni-filetypes*
|
||||
|
||||
The file used for {filetype} should be autoload/{filetype}complete.vim
|
||||
in 'runtimepath'. Thus for "java" it is autoload/javacomplete.vim.
|
||||
|
||||
|
||||
C *ft-c-omni*
|
||||
|
||||
Completion of C code requires a tags file. You should use Exuberant ctags,
|
||||
because it adds extra information that is needed for completion. You can find
|
||||
it here: http://ctags.sourceforge.net/
|
||||
For version 5.5.4 you should add a patch that adds the "typename:" field:
|
||||
ftp://ftp.vim.org/pub/vim/unstable/patches/ctags-5.5.4.patch
|
||||
A compiled .exe for MS-Windows can be found at:
|
||||
http://georgevreilly.com/vim/ctags.html
|
||||
|
||||
If you want to complete system functions you can do something like this. Use
|
||||
ctags to generate a tags file for all the system header files: >
|
||||
% ctags -R -f ~/.vim/systags /usr/include /usr/local/include
|
||||
In your vimrc file add this tags file to the 'tags' option: >
|
||||
set tags+=~/.vim/systags
|
||||
|
||||
When using CTRL-X CTRL-O after a name without any "." or "->" it is completed
|
||||
from the tags file directly. This works for any identifier, also function
|
||||
names. If you want to complete a local variable name, which does not appear
|
||||
in the tags file, use CTRL-P instead.
|
||||
|
||||
When using CTRL-X CTRL-O after something that has "." or "->" Vim will attempt
|
||||
to recognize the type of the variable and figure out what members it has.
|
||||
This means only members valid for the variable will be listed.
|
||||
|
||||
When a member name already was complete, CTRL-X CTRL-O will add a "." or
|
||||
"->" for composite types.
|
||||
|
||||
Vim doesn't include a C compiler, only the most obviously formatted
|
||||
declarations are recognized. Preprocessor stuff may cause confusion.
|
||||
When the same structure name appears in multiple places all possible members
|
||||
are included.
|
||||
|
||||
|
||||
CSS *ft-css-omni*
|
||||
|
||||
Complete properties and their appropriate values according to CSS 2.1
|
||||
specification.
|
||||
|
||||
|
||||
HTML and XHTML *ft-html-omni*
|
||||
*ft-xhtml-omni*
|
||||
|
||||
CTRL-X CTRL-O provides completion of various elements of (X)HTML files. It is
|
||||
designed to support writing of XHTML 1.0 Strict files but will also works for
|
||||
other versions of HTML. Features:
|
||||
|
||||
- after "<" complete tag name depending on context (no div suggestion inside
|
||||
of an a tag); '/>' indicates empty tags
|
||||
- inside of tag complete proper attributes (no width attribute for an a tag);
|
||||
show also type of attribute; '*' indicates required attributes
|
||||
- when attribute has limited number of possible values help to complete them
|
||||
- complete names of entities
|
||||
- complete values of "class" and "id" attributes with data obtained from
|
||||
<style> tag and included CSS files
|
||||
- when completing value of "style" attribute or working inside of "style" tag
|
||||
switch to |ft-css-omni| completion
|
||||
- when completing values of events attributes or working inside of "script"
|
||||
tag switch to |ft-javascript-omni| completion
|
||||
- when used after "</" CTRL-X CTRL-O will close the last opened tag
|
||||
|
||||
Note: When used first time completion menu will be shown with little delay
|
||||
- this is time needed for loading of data file.
|
||||
Note: Completion may fail in badly formatted documents. In such case try to
|
||||
run |:make| command to detect formatting problems.
|
||||
|
||||
|
||||
JAVASCRIPT *ft-javascript-omni*
|
||||
|
||||
Completion of most elements of JavaScript language and DOM elements.
|
||||
|
||||
Complete:
|
||||
|
||||
- variables
|
||||
- function name; show function arguments
|
||||
- function arguments
|
||||
- properties of variables trying to detect type of variable
|
||||
- complete DOM objects and properties depending on context
|
||||
- keywords of language
|
||||
|
||||
Completion works in separate JavaScript files (&ft==javascript), inside of
|
||||
<script> tag of (X)HTML and in values of event attributes (including scanning
|
||||
of external files.
|
||||
|
||||
DOM compatibility
|
||||
|
||||
At the moment (beginning of 2006) there are two main browsers - MS Internet
|
||||
Explorer and Mozilla Firefox. These two applications are covering over 90% of
|
||||
market. Theoretically standards are created by W3C organisation
|
||||
(http://www.w3c.org) but they are not always followed/implemented.
|
||||
|
||||
IE FF W3C Omni completion ~
|
||||
+/- +/- + + ~
|
||||
+ + - + ~
|
||||
+ - - - ~
|
||||
- + - - ~
|
||||
|
||||
Regardless from state of implementation in browsers but if element is defined
|
||||
in standards, completion plugin will place element in suggestion list. When
|
||||
both major engines implemented element, even if this is not in standards it
|
||||
will be suggested. All other elements are not placed in suggestion list.
|
||||
|
||||
|
||||
PHP *ft-php-omni*
|
||||
|
||||
Completion of PHP code requires tags file for completion of data from external
|
||||
files. You should use Exuberant ctags version 5.5.4 or newer. You can find it
|
||||
here: http://ctags.sourceforge.net/
|
||||
|
||||
Script completes:
|
||||
|
||||
- after $ variables name
|
||||
- if variable was declared as object add "->", if tags file is available show
|
||||
name of class
|
||||
|
||||
- function names with additonal info:
|
||||
- in case of built-in functions list of possible arguments and after | type
|
||||
data returned by function
|
||||
- in case of user function arguments and name of file were function was
|
||||
defined (if it is not current file)
|
||||
|
||||
- constants names
|
||||
- class names after "new" declaration
|
||||
|
||||
|
||||
Note: when doing completion first time Vim will load all necessary data into
|
||||
memory. It may take several seconds. After next use of completion delay
|
||||
should not be noticeable.
|
||||
|
||||
Script detects if cursor is inside <?php ?> tags. If it is outside it will
|
||||
automatically switch to HTML/CSS/JavaScript completion. Note: contrary to
|
||||
original HTML files completion of tags (and only tags) isn't context aware.
|
||||
|
||||
|
||||
SYNTAX *ft-syntax-omni*
|
||||
|
||||
This uses the current syntax highlighting for completion. It can be used for
|
||||
any filetype and provides a minimal language-sensitive completion.
|
||||
|
||||
To enable syntax code completion you can run: >
|
||||
setlocal omnifunc=syntaxcomplete#Complete
|
||||
|
||||
You can automate this by placing the following in your vimrc (after any
|
||||
":filetype" command): >
|
||||
if has("autocmd") && exists("+omnifunc")
|
||||
autocmd Filetype *
|
||||
\ if &omnifunc == "" |
|
||||
\ setlocal omnifunc=syntaxcomplete#Complete |
|
||||
\ endif
|
||||
endif
|
||||
|
||||
The above will set completion to this script only if a specific plugin does
|
||||
not already exist for that filetype.
|
||||
|
||||
Each filetype can have a wide range of syntax items. The plugin allows you to
|
||||
customize which syntax groups to include or exclude from the list. Let's have
|
||||
a look at the PHP filetype to see how this works.
|
||||
|
||||
If you edit a file called, index.php, run the following command: >
|
||||
:syntax list
|
||||
|
||||
First thing you will notice is there are many different syntax groups. The
|
||||
PHP language can include elements from different languages like HTML,
|
||||
JavaScript and many more. The syntax plugin will only include syntax groups
|
||||
that begin with the filetype, "php", in this case. For example these syntax
|
||||
groups are included by default with the PHP: phpEnvVar, phpIntVar,
|
||||
phpFunctions.
|
||||
|
||||
The PHP language has an enormous number of items which it knows how to syntax
|
||||
highlight. This means these items will be available within the omni
|
||||
completion list. Some people may find this list unwieldy or are only
|
||||
interested in certain items.
|
||||
|
||||
There are two ways to prune this list (if necessary). If you find certain
|
||||
syntax groups you do not wish displayed you can add the following to your
|
||||
vimrc: >
|
||||
let g:omni_syntax_group_exclude_php = 'phpCoreConstant,phpConstant'
|
||||
|
||||
Add as many syntax groups to this list by comma separating them. The basic
|
||||
form of this variable is: >
|
||||
let g:omni_syntax_group_exclude_{filetype} = 'comma,separated,list'
|
||||
|
||||
For completeness the opposite is also true. Creating this variable in your
|
||||
vimrc will only include the items in the phpFunctions and phpMethods syntax
|
||||
groups: >
|
||||
let g:omni_syntax_group_include_php = 'phpFunctions,phpMethods'
|
||||
|
||||
You can create as many of these variables as you need, varying only the
|
||||
filetype at the end of the variable name.
|
||||
|
||||
|
||||
XML *ft-xml-omni*
|
||||
|
||||
Vim 7 provides mechanism to context aware completion of XML files. It depends
|
||||
on special |xml-omni-datafile| and two commands: |:XMLns| and |:XMLent|.
|
||||
Features are:
|
||||
|
||||
- after "<" complete tag name depending on context (no div suggest
|
||||
inside of an a tag)
|
||||
- inside of tag complete proper attributes (no width attribute for an
|
||||
a tag)
|
||||
- when attribute has limited number of possible values help to complete
|
||||
them
|
||||
- complete names of entities (defined in |xml-omni-datafile| and in current file
|
||||
with "<!ENTITY" declarations
|
||||
- when used after "</" CTRL-X CTRL-O will close the last opened tag
|
||||
|
||||
Format of XML data file *xml-omni-datafile*
|
||||
|
||||
Vim distribution provides two data files as examples (xhtml10s.vim, xsl.vim)
|
||||
|
||||
XML data files are stored in "autoload/xml" directory in 'runtimepath'. They
|
||||
have meaningful name which will be used in commands. It should be unique name
|
||||
which will not create conflicts in future. For example name xhtml10s.vim means
|
||||
it is data file for XHTML 1.0 Strict.
|
||||
|
||||
File contains one variable with fixed name: g:xmldata_xhtml10s . It is
|
||||
compound from two parts:
|
||||
|
||||
1. "g:xmldata_" general prefix
|
||||
2. "xhtml10s" name of file and name of described XML dialect
|
||||
|
||||
Part two must be exactly the same as name of file.
|
||||
|
||||
Variable is data structure in form of |Dictionary|. Keys are tag names and
|
||||
values are two element |List|. First element of List is also List with names
|
||||
of possible children, second element is |Dictionary| with names of attributes
|
||||
as keys and possible values of attributes as values. Example: >
|
||||
|
||||
let g:xmldata_crippledhtml = {
|
||||
\ "html":
|
||||
\ [ ["body", "head"], {"id": [], "xmlns": ["http://www.w3.org/1999/xhtml"],
|
||||
\ "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}],
|
||||
\ "script":
|
||||
\ [ [], {"id": [], "charset": [], "type": ["text/javascript"], "src": [],
|
||||
\ "defer": ["BOOL"], "xml:space": ["preserve"]}],
|
||||
\ "meta":
|
||||
\ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme":
|
||||
\ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}]
|
||||
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]},
|
||||
\ "vimxmltaginfo": {
|
||||
\ 'meta': ['/>', '']},
|
||||
\ "vimxmlattrinfo": {
|
||||
\ 'http-equiv': ['ContentType', '']}
|
||||
|
||||
This example should be put in "autoload/xml/crippledhtml.vim" file.
|
||||
|
||||
In example are visible four special elements:
|
||||
|
||||
1. "vimxmlentities" - special key with List containing entities of this XML
|
||||
dialect.
|
||||
2. "BOOL" - value of attribute key showing if attribute should be inserted
|
||||
bare ("defer" vs. 'defer="'). It can be the only element of List of
|
||||
attribute values.
|
||||
3. "vimxmltaginfo" - special key with dictionary containing as key tag names,
|
||||
as value two element List for additional menu info and long description.
|
||||
4. "vimxmlattrinfo" - special key with dictionary containing as key attribute
|
||||
names, as value two element List for additional menu info and long
|
||||
description.
|
||||
|
||||
Note: Tag names in data file MUST not contain namespace description. Check
|
||||
xsl.vim for example.
|
||||
|
||||
|
||||
Commands
|
||||
|
||||
:XMLns {name} [{namespace}] *:XMLns*
|
||||
|
||||
Vim has to know which data file should be used and with which namespace. For
|
||||
loading of data file and connecting data with prope namespace use |:XMLns|
|
||||
command. First (obligatory) argument is name of data (xhtml10s, xsl). Second
|
||||
argument is code of namespace (h, xsl). When used without second argument
|
||||
dialect will be used as default - without namespace declaration. For example
|
||||
to use XML completion in .xsl files: >
|
||||
|
||||
:XMLns xhtml10s
|
||||
:XMLns xsl xsl
|
||||
|
||||
|
||||
:XMLent {name} *:XMLent*
|
||||
|
||||
By default entities will be completed from data file of default
|
||||
namespace. XMLent command should be used in case when there is no
|
||||
default namespace: >
|
||||
|
||||
:XMLent xhtml10s
|
||||
|
||||
Usage
|
||||
|
||||
While used in situation (after declarations from previous part, | is
|
||||
cursor position): >
|
||||
|
||||
<|
|
||||
|
||||
Will complete to appropriate XHTML tag, and in this situation: >
|
||||
|
||||
<xsl:|
|
||||
|
||||
Will complete to appropriate XSL tag.
|
||||
|
||||
File xmlcomplete.vim provides through |autoload| mechanism
|
||||
GetLastOpenTag function which can be used in XML files to get name of
|
||||
last open tag with (b:unaryTagsStack has to be defined): >
|
||||
|
||||
:echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
==============================================================================
|
||||
8. Insert mode commands *inserting*
|
||||
|
||||
@@ -1004,6 +1578,7 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
|
||||
Note that when using this command in a function or
|
||||
script, the insertion only starts after the function
|
||||
or script is finished.
|
||||
This command does not work from |:normal|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
@@ -1025,6 +1600,13 @@ NOTE: ":append" and ":insert" don't work properly in between ":if" and
|
||||
the function or script is finished.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
|
||||
*:startgreplace*
|
||||
:startg[replace][!] Just like |:startreplace|, but use Virtual Replace
|
||||
mode, like with |gR|.
|
||||
{not in Vi}
|
||||
{not available when compiled without the +ex_extra
|
||||
feature}
|
||||
|
||||
==============================================================================
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*intro.txt* For Vim version 7.0aa. Last change: 2005 Feb 07
|
||||
*intro.txt* For Vim version 7.0b. Last change: 2005 Sep 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -151,31 +151,19 @@ example and try to find out which settings or other things influence the
|
||||
appearance of the bug. Try different machines, if possible. Send me patches
|
||||
if you can!
|
||||
|
||||
In case of doubt, use: >
|
||||
It will help to include information about the version of Vim you are using and
|
||||
your setup. You can get the information with this command: >
|
||||
:so $VIMRUNTIME/bugreport.vim
|
||||
This will create a file "bugreport.txt" in the current directory, with a lot
|
||||
of information of your environment. Before sending this out, check if it
|
||||
doesn't contain any confidential information!
|
||||
|
||||
*debug-vim*
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes:
|
||||
If Vim crashes, please try to find out where. You can find help on this here:
|
||||
|debug.txt|.
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
In case of doubt or when you wonder if the problem has already been fixed but
|
||||
you can't find a fix for it, become a member of the vim-dev maillist and ask
|
||||
your question there. |maillist|
|
||||
|
||||
*year-2000* *Y2K*
|
||||
Since Vim internally doesn't use dates for editing, there is no year 2000
|
||||
@@ -198,7 +186,7 @@ The user may create scripts for Vim that use external commands. These might
|
||||
introduce Y2K problems, but those are not really part of Vim itself.
|
||||
|
||||
==============================================================================
|
||||
3. Credits *credits* *author*
|
||||
3. Credits *credits* *author* *Bram* *Moolenaar*
|
||||
|
||||
Most of Vim was written by Bram Moolenaar <Bram@vim.org>.
|
||||
|
||||
@@ -330,11 +318,11 @@ and <> are part of what you type, the context should make this clear.
|
||||
["x] An optional register designation where text can be stored.
|
||||
See |registers|. The x is a single character between 'a' and
|
||||
'z' or 'A' and 'Z' or '"', and in some cases (with the put
|
||||
command) between '0' and '9', '%', '#', or others. The
|
||||
command) between '0' and '9', '%', '#', or others. The
|
||||
uppercase and lowercase letter designate the same register,
|
||||
but the lowercase letter is used to overwrite the previous
|
||||
register contents, while the uppercase letter is used to
|
||||
append to the previous register contents. Without the ""x" or
|
||||
append to the previous register contents. Without the ""x" or
|
||||
with """" the stored text is put into the unnamed register.
|
||||
|
||||
*{}*
|
||||
|
||||
@@ -135,7 +135,7 @@ NR == 1 { nf=split(FILENAME,f,".")
|
||||
print "<H1>Vim documentation: " f[1] "</H1>";
|
||||
print "<A NAME=\"top\"></A>";
|
||||
if ( FILENAME != "help.txt" ) {
|
||||
print "<A HREF=\"help.html\">main help file</A>\n";
|
||||
print "<A HREF=\"index.html\">main help file</A>\n";
|
||||
}
|
||||
print "<HR>";
|
||||
print "<PRE>";
|
||||
@@ -244,7 +244,15 @@ npipe > 2 && nstar < 3 {
|
||||
find_tag1();
|
||||
}
|
||||
else {
|
||||
if ( f[1] == "index" ) {
|
||||
printf "|<A HREF=\"vimindex.html\">" p[i] "</A>|";
|
||||
} else {
|
||||
if ( f[1] == "help" ) {
|
||||
printf "|<A HREF=\"index.html\">" p[i] "</A>|";
|
||||
} else {
|
||||
printf "|<A HREF=\"" f[1] ".html\">" p[i] "</A>|";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -373,13 +381,12 @@ END {
|
||||
|
||||
#
|
||||
# as main we keep index.txt (by default)
|
||||
# other candidate, help.txt
|
||||
#
|
||||
function topback () {
|
||||
if ( FILENAME != "tags" ) {
|
||||
if ( FILENAME != "help.txt" ) {
|
||||
printf("<A HREF=\"#top\">top</A> - ");
|
||||
printf("<A HREF=\"help.html\">main help file</A>\n");
|
||||
printf("<A HREF=\"index.html\">main help file</A>\n");
|
||||
} else {
|
||||
printf("<A HREF=\"#top\">top</A>\n");
|
||||
}
|
||||
@@ -581,7 +588,7 @@ function find_tag2() {
|
||||
ntags=split(atag,blata,"[ ]");
|
||||
if ( ntags > 1 ) { return; }
|
||||
if ( ( allow_one_char == "no" ) && \
|
||||
( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) {
|
||||
( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",atag) !=0 ) ) {
|
||||
return;
|
||||
}
|
||||
if ( skip_word[atag] == "yes" ) { return; }
|
||||
@@ -610,7 +617,7 @@ function find_tag3() {
|
||||
ntags=split(btag,blata,"[ ]");
|
||||
if ( ntags > 1 ) { return; }
|
||||
if ( ( allow_one_char == "no" ) && \
|
||||
( index("!#$%\&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) {
|
||||
( index("!#$%&'()+,-./0:;=?@ACINX\\[\\]^_`at\\{\\}~",btag) !=0 ) ) {
|
||||
return;
|
||||
}
|
||||
if ( skip_word[btag] == "yes" ) { return; }
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*map.txt* For Vim version 7.0aa. Last change: 2005 Feb 27
|
||||
*map.txt* For Vim version 7.0b. Last change: 2006 Mar 20
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -10,6 +10,17 @@ This subject is introduced in sections |05.3|, |24.7| and |40.1| of the user
|
||||
manual.
|
||||
|
||||
1. Key mapping |key-mapping|
|
||||
1.1 MAP COMMANDS |:map-commands|
|
||||
1.2 Special arguments |:map-arguments|
|
||||
1.3 Mapping and modes |:map-modes|
|
||||
1.4 Listing mappings |map-listing|
|
||||
1.5 Mapping special keys |:map-special-keys|
|
||||
1.6 Special characters |:map-special-chars|
|
||||
1.7 What keys to map |map-which-keys|
|
||||
1.8 Examples |map-examples|
|
||||
1.9 Using mappings |map-typing|
|
||||
1.10 Mapping alt-keys |:map-alt-keys|
|
||||
1.11 Mapping an operator |:map-operator|
|
||||
2. Abbreviations |abbreviations|
|
||||
3. Local mappings and functions |script-local|
|
||||
4. User-defined commands |user-commands|
|
||||
@@ -22,7 +33,10 @@ is to define a sequence commands for a function key. Example: >
|
||||
|
||||
:map <F2> a<C-R>=strftime("%c")<CR><Esc>
|
||||
|
||||
This appends the current date and time after the cursor. (in <> notation |<>|)
|
||||
This appends the current date and time after the cursor (in <> notation |<>|).
|
||||
|
||||
|
||||
1.1 MAP COMMANDS *:map-commands*
|
||||
|
||||
There are commands to enter new mappings, remove mappings and list mappings.
|
||||
See |map-overview| for the various forms of "map" and their relationships with
|
||||
@@ -31,42 +45,48 @@ modes.
|
||||
{lhs} means left-hand-side *{lhs}*
|
||||
{rhs} means right-hand-side *{rhs}*
|
||||
|
||||
:map {lhs} {rhs} *:map*
|
||||
:nm[ap] {lhs} {rhs} *:nm* *:nmap*
|
||||
:vm[ap] {lhs} {rhs} *:vm* *:vmap*
|
||||
:om[ap] {lhs} {rhs} *:om* *:omap*
|
||||
:map! {lhs} {rhs} *:map!*
|
||||
:im[ap] {lhs} {rhs} *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} *:cm* *:cmap*
|
||||
:map {lhs} {rhs} |mapmode-nvo| *:map*
|
||||
:nm[ap] {lhs} {rhs} |mapmode-n| *:nm* *:nmap*
|
||||
:vm[ap] {lhs} {rhs} |mapmode-v| *:vm* *:vmap*
|
||||
:xm[ap] {lhs} {rhs} |mapmode-x| *:xm* *:xmap*
|
||||
:smap {lhs} {rhs} |mapmode-s| *:smap*
|
||||
:om[ap] {lhs} {rhs} |mapmode-o| *:om* *:omap*
|
||||
:map! {lhs} {rhs} |mapmode-ic| *:map!*
|
||||
:im[ap] {lhs} {rhs} |mapmode-i| *:im* *:imap*
|
||||
:lm[ap] {lhs} {rhs} |mapmode-l| *:lm* *:lmap*
|
||||
:cm[ap] {lhs} {rhs} |mapmode-c| *:cm* *:cmap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. The result, including
|
||||
{rhs}, is then further scanned for mappings. This
|
||||
allows for nested and recursive use of mappings.
|
||||
|
||||
|
||||
:no[remap] {lhs} {rhs} *:no* *:noremap*
|
||||
:nn[oremap] {lhs} {rhs} *:nn* *:nnoremap*
|
||||
:vn[oremap] {lhs} {rhs} *:vn* *:vnoremap*
|
||||
:ono[remap] {lhs} {rhs} *:ono* *:onoremap*
|
||||
:no[remap]! {lhs} {rhs} *:no!* *:noremap!*
|
||||
:ino[remap] {lhs} {rhs} *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} *:cno* *:cnoremap*
|
||||
:no[remap] {lhs} {rhs} |mapmode-nvo| *:no* *:noremap*
|
||||
:nn[oremap] {lhs} {rhs} |mapmode-n| *:nn* *:nnoremap*
|
||||
:vn[oremap] {lhs} {rhs} |mapmode-v| *:vn* *:vnoremap*
|
||||
:xn[oremap] {lhs} {rhs} |mapmode-x| *:xn* *:xnoremap*
|
||||
:snor[emap] {lhs} {rhs} |mapmode-s| *:snor* *:snoremap*
|
||||
:ono[remap] {lhs} {rhs} |mapmode-o| *:ono* *:onoremap*
|
||||
:no[remap]! {lhs} {rhs} |mapmode-ic| *:no!* *:noremap!*
|
||||
:ino[remap] {lhs} {rhs} |mapmode-i| *:ino* *:inoremap*
|
||||
:ln[oremap] {lhs} {rhs} |mapmode-l| *:ln* *:lnoremap*
|
||||
:cno[remap] {lhs} {rhs} |mapmode-c| *:cno* *:cnoremap*
|
||||
Map the key sequence {lhs} to {rhs} for the modes
|
||||
where the map command applies. Disallow mapping of
|
||||
{rhs}, to avoid nested and recursive mappings. Often
|
||||
used to redefine a command. {not in Vi}
|
||||
|
||||
|
||||
:unm[ap] {lhs} *:unm* *:unmap*
|
||||
:nun[map] {lhs} *:nun* *:nunmap*
|
||||
:vu[nmap] {lhs} *:vu* *:vunmap*
|
||||
:ou[nmap] {lhs} *:ou* *:ounmap*
|
||||
:unm[ap]! {lhs} *:unm!* *:unmap!*
|
||||
:iu[nmap] {lhs} *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} *:cu* *:cunmap*
|
||||
:unm[ap] {lhs} |mapmode-nvo| *:unm* *:unmap*
|
||||
:nun[map] {lhs} |mapmode-n| *:nun* *:nunmap*
|
||||
:vu[nmap] {lhs} |mapmode-v| *:vu* *:vunmap*
|
||||
:xu[nmap] {lhs} |mapmode-x| *:xu* *:xunmap*
|
||||
:sunm[ap] {lhs} |mapmode-s| *:sunm* *:sunmap*
|
||||
:ou[nmap] {lhs} |mapmode-o| *:ou* *:ounmap*
|
||||
:unm[ap]! {lhs} |mapmode-ic| *:unm!* *:unmap!*
|
||||
:iu[nmap] {lhs} |mapmode-i| *:iu* *:iunmap*
|
||||
:lu[nmap] {lhs} |mapmode-l| *:lu* *:lunmap*
|
||||
:cu[nmap] {lhs} |mapmode-c| *:cu* *:cunmap*
|
||||
Remove the mapping of {lhs} for the modes where the
|
||||
map command applies. The mapping may remain defined
|
||||
for other modes where it applies.
|
||||
@@ -75,38 +95,44 @@ modes.
|
||||
:map @@ foo
|
||||
:unmap @@ | print
|
||||
|
||||
:mapc[lear] *:mapc* *:mapclear*
|
||||
:nmapc[lear] *:nmapc* *:nmapclear*
|
||||
:vmapc[lear] *:vmapc* *:vmapclear*
|
||||
:omapc[lear] *:omapc* *:omapclear*
|
||||
:mapc[lear]! *:mapc!* *:mapclear!*
|
||||
:imapc[lear] *:imapc* *:imapclear*
|
||||
:lmapc[lear] *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] *:cmapc* *:cmapclear*
|
||||
:mapc[lear] |mapmode-nvo| *:mapc* *:mapclear*
|
||||
:nmapc[lear] |mapmode-n| *:nmapc* *:nmapclear*
|
||||
:vmapc[lear] |mapmode-v| *:vmapc* *:vmapclear*
|
||||
:xmapc[lear] |mapmode-x| *:xmapc* *:xmapclear*
|
||||
:smapc[lear] |mapmode-s| *:smapc* *:smapclear*
|
||||
:omapc[lear] |mapmode-o| *:omapc* *:omapclear*
|
||||
:mapc[lear]! |mapmode-ic| *:mapc!* *:mapclear!*
|
||||
:imapc[lear] |mapmode-i| *:imapc* *:imapclear*
|
||||
:lmapc[lear] |mapmode-l| *:lmapc* *:lmapclear*
|
||||
:cmapc[lear] |mapmode-c| *:cmapc* *:cmapclear*
|
||||
Remove ALL mappings for the modes where the map
|
||||
command applies. {not in Vi}
|
||||
Warning: This also removes the default mappings.
|
||||
|
||||
:map
|
||||
:nm[ap]
|
||||
:vm[ap]
|
||||
:om[ap]
|
||||
:map!
|
||||
:im[ap]
|
||||
:lm[ap]
|
||||
:cm[ap]
|
||||
:map |mapmode-nvo|
|
||||
:nm[ap] |mapmode-n|
|
||||
:vm[ap] |mapmode-v|
|
||||
:xm[ap] |mapmode-x|
|
||||
:sm[ap] |mapmode-s|
|
||||
:om[ap] |mapmode-o|
|
||||
:map! |mapmode-ic|
|
||||
:im[ap] |mapmode-i|
|
||||
:lm[ap] |mapmode-l|
|
||||
:cm[ap] |mapmode-c|
|
||||
List all key mappings for the modes where the map
|
||||
command applies. Note that ":map" and ":map!" are
|
||||
used most often, because they include the other modes.
|
||||
|
||||
:map {lhs} *:map_l*
|
||||
:nm[ap] {lhs} *:nmap_l*
|
||||
:vm[ap] {lhs} *:vmap_l*
|
||||
:om[ap] {lhs} *:omap_l*
|
||||
:map! {lhs} *:map_l!*
|
||||
:im[ap] {lhs} *:imap_l*
|
||||
:lm[ap] {lhs} *:lmap_l*
|
||||
:cm[ap] {lhs} *:cmap_l*
|
||||
:map {lhs} |mapmode-nvo| *:map_l*
|
||||
:nm[ap] {lhs} |mapmode-n| *:nmap_l*
|
||||
:vm[ap] {lhs} |mapmode-v| *:vmap_l*
|
||||
:xm[ap] {lhs} |mapmode-x| *:xmap_l*
|
||||
:sm[ap] {lhs} |mapmode-s| *:smap_l*
|
||||
:om[ap] {lhs} |mapmode-o| *:omap_l*
|
||||
:map! {lhs} |mapmode-ic| *:map_l!*
|
||||
:im[ap] {lhs} |mapmode-i| *:imap_l*
|
||||
:lm[ap] {lhs} |mapmode-l| *:lmap_l*
|
||||
:cm[ap] {lhs} |mapmode-c| *:cmap_l*
|
||||
List the key mappings for the key sequences starting
|
||||
with {lhs} in the modes where the map command applies.
|
||||
{not in Vi}
|
||||
@@ -116,6 +142,24 @@ characters. You can use this to put command sequences under function keys,
|
||||
translate one key into another, etc. See |:mkexrc| for how to save and
|
||||
restore the current mappings.
|
||||
|
||||
*map-ambiguous*
|
||||
When two mappings start with the same sequence of characters, they are
|
||||
ambiguous. Example: >
|
||||
:imap aa foo
|
||||
:imap aaa bar
|
||||
When Vim has read "aa", it will need to get another character to be able to
|
||||
decide if "aa" or "aaa" should be mapped. This means that after typing "aa"
|
||||
that mapping won't get expanded yet, Vim is waiting for another character.
|
||||
If you type a space, then "foo" will get inserted, plus the space. If you
|
||||
type "a", then "bar" will get inserted.
|
||||
{Vi does not allow ambiguous mappings}
|
||||
|
||||
|
||||
1.2 SPECIAL ARGUMENTS *:map-arguments*
|
||||
|
||||
"<buffer>", "<silent>", "<script>", "<expr>" and "<unique>" can be used in any
|
||||
order. They must appear right after the command, before any other arguments.
|
||||
|
||||
*:map-local* *:map-<buffer>* *E224* *E225*
|
||||
If the first argument to one of these commands is "<buffer>" it will apply to
|
||||
mappings locally to the current buffer only. Example: >
|
||||
@@ -162,24 +206,50 @@ already exists which is equal.
|
||||
Example of what will fail: >
|
||||
:map ,w /[#&!]<CR>
|
||||
:map <buffer> <unique> ,w /[.,;]<CR>
|
||||
If you want to map a key and then have it do what it was originally mapped to,
|
||||
have a look at |maparg()|.
|
||||
|
||||
"<buffer>", "<silent>", "<script>" and "<unique>" can be used in any order.
|
||||
They must appear right after the command, before any other arguments.
|
||||
*:map-<expr>* *:map-expression*
|
||||
If the first argument to one of these commands is "<expr>" and it is used to
|
||||
define a new mapping or abbreviation, the argument is an expression. The
|
||||
expression is evaluated to obtain the {rhs} that is used. Example: >
|
||||
:inoremap <expr> . InsertDot()
|
||||
The result of the InsertDot() function will be inserted. It could check the
|
||||
text before the cursor and start omni completion when some condition is met.
|
||||
|
||||
Be very careful about side effects! The expression is evaluated while
|
||||
obtaining characters, if you change buffer text, move the cursor, edit another
|
||||
file, etc. you may very well make command disfunctional.
|
||||
|
||||
Here is an example that inserts a list number that increases: >
|
||||
let counter = 0
|
||||
inoremap <expr> <C-L> ListItem()
|
||||
inoremap <expr> <C-R> ListReset()
|
||||
|
||||
func ListItem()
|
||||
let g:counter += 1
|
||||
return g:counter . '. '
|
||||
endfunc
|
||||
|
||||
func ListReset()
|
||||
let g:counter = 0
|
||||
return ''
|
||||
endfunc
|
||||
|
||||
CTRL-L inserts the next number, CTRL-R resets the count. CTRL-R returns an
|
||||
empty string, so that nothing is inserted.
|
||||
|
||||
|
||||
MAPPING AND MODES
|
||||
1.3 MAPPING AND MODES *:map-modes*
|
||||
|
||||
There are five sets of mappings
|
||||
- For Normal mode: When typing commands.
|
||||
- For Visual mode: When typing commands while the Visual area is highlighted.
|
||||
- For Operator-pending mode: When an operator is pending (after "d", "y", "c",
|
||||
etc.). Example: ":omap { w" makes "y{" work like "yw" and "d{" like "dw".
|
||||
- For Insert mode. These are also used in Replace mode.
|
||||
- For Insert mode. These are also used in Replace mode.
|
||||
- For Command-line mode: When entering a ":" or "/" command.
|
||||
|
||||
There are no separate mappings for Select mode. The same as for Visual mode
|
||||
are used |Select-mode-mapping|.
|
||||
|
||||
Special case: While typing a count for a command in Normal mode, mapping zero
|
||||
is disabled. This makes it possible to map zero without making it impossible
|
||||
to type a count with a zero.
|
||||
@@ -187,13 +257,29 @@ to type a count with a zero.
|
||||
*map-overview* *map-modes*
|
||||
Overview of which map command works in which mode:
|
||||
|
||||
*mapmode-nvo* *mapmode-n* *mapmode-v* *mapmode-o*
|
||||
commands: modes: ~
|
||||
Normal Visual Operator-pending ~
|
||||
:map :noremap :unmap :mapclear yes yes yes
|
||||
:nmap :nnoremap :nunmap :nmapclear yes - -
|
||||
:vmap :vnoremap :vunmap :vmapclear - yes -
|
||||
:omap :onoremap :ounmap :omapclear - - yes
|
||||
Normal Visual+Select Operator-pending ~
|
||||
:map :noremap :unmap :mapclear yes yes yes
|
||||
:nmap :nnoremap :nunmap :nmapclear yes - -
|
||||
:vmap :vnoremap :vunmap :vmapclear - yes -
|
||||
:omap :onoremap :ounmap :omapclear - - yes
|
||||
|
||||
*mapmode-x* *mapmode-s*
|
||||
Some commands work both in Visual and Select mode, some in only one. Note
|
||||
that quite often "Visual" is mentioned where both Visual and Select mode
|
||||
apply. |Select-mode-mapping|
|
||||
|
||||
commands: modes: ~
|
||||
Visual Select ~
|
||||
:vmap :vnoremap :vunmap :vmapclear yes yes
|
||||
:xmap :xnoremap :xunmap :xmapclear yes -
|
||||
:smap :snoremap :sunmap :smapclear - yes
|
||||
|
||||
*mapmode-ic* *mapmode-i* *mapmode-c* *mapmode-l*
|
||||
Some commands work both in Insert mode and Command-line mode, some not:
|
||||
|
||||
commands: modes: ~
|
||||
Insert Command-line Lang-Arg ~
|
||||
:map! :noremap! :unmap! :mapclear! yes yes -
|
||||
:imap :inoremap :iunmap :imapclear yes - -
|
||||
@@ -236,19 +322,9 @@ character as an argument to command like "f" or "t".
|
||||
are only used for typed characters. This assumes that the language mapping
|
||||
was already done when typing the mapping.
|
||||
|
||||
*map-multibyte*
|
||||
It is possible to map multibyte characters, but only the whole character. You
|
||||
cannot map the first byte only. This was done to prevent problems in this
|
||||
scenario: >
|
||||
:set encoding=latin1
|
||||
:imap <M-C> foo
|
||||
:set encoding=utf-8
|
||||
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
|
||||
byte. If you type the character <20> (0xea <M-a>) in UTF-8 encoding this is the
|
||||
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
|
||||
otherwise it would be impossible to type the <20> character.
|
||||
|
||||
*map-listing*
|
||||
1.4 LISTING MAPPINGS *map-listing*
|
||||
|
||||
When listing mappings the characters in the first two columns are:
|
||||
|
||||
CHAR MODE ~
|
||||
@@ -273,6 +349,58 @@ with a space.
|
||||
Note: When using mappings for Visual mode, you can use the "'<" mark, which
|
||||
is the start of the last selected Visual area in the current buffer |'<|.
|
||||
|
||||
*:map-verbose*
|
||||
When 'verbose' is non-zero, listing a key map will also display where it was
|
||||
last defined. Example: >
|
||||
|
||||
:verbose map <C-W>*
|
||||
n <C-W>* * <C-W><C-S>*
|
||||
Last set from /home/abcd/.vimrc
|
||||
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
|
||||
1.5 MAPPING SPECIAL KEYS *:map-special-keys*
|
||||
|
||||
There are three ways to map a special key:
|
||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||
you have to type CTRL-V before hitting the function key. Note that when
|
||||
the key code for the key is in the termcap (the t_ options), it will
|
||||
automatically be translated into the internal code and become the second
|
||||
way of mapping (unless the 'k' flag is included in 'cpoptions').
|
||||
2. The second method is to use the internal code for the function key. To
|
||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||
first ten function keys can be defined in two ways: Just the number, like
|
||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||
refers to function key 10, defined with option 't_f10', which may be
|
||||
function key zero on some keyboards. The <> form cannot be used when
|
||||
'cpoptions' includes the '<' flag.
|
||||
3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
|
||||
termcap entry. Any string entry can be used. For example: >
|
||||
:map <t_F3> G
|
||||
< Maps function key 13 to "G". This does not work if 'cpoptions' includes
|
||||
the '<' flag.
|
||||
|
||||
The advantage of the second and third method is that the mapping will work on
|
||||
different terminals without modification (the function key will be
|
||||
translated into the same internal code or the actual key code, no matter what
|
||||
terminal you are using. The termcap must be correct for this to work, and you
|
||||
must use the same mappings).
|
||||
|
||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||
isn't the terminal key codes are tried (see |terminal-options|). If a
|
||||
terminal code is found it is replaced with the internal code. Then the check
|
||||
for a mapping is done again (so you can map an internal code to something
|
||||
else). What is written into the script file depends on what is recognized.
|
||||
If the terminal key code was recognized as a mapping the key code itself is
|
||||
written to the script file. If it was recognized as a terminal code the
|
||||
internal code is written to the script file.
|
||||
|
||||
|
||||
1.6 SPECIAL CHARACTERS *:map-special-chars*
|
||||
*map_backslash*
|
||||
Note that only CTRL-V is mentioned here as a special character for mappings
|
||||
and abbreviations. When 'cpoptions' does not contain 'B', a backslash can
|
||||
@@ -284,23 +412,12 @@ To map a backslash, or use a backslash literally in the {rhs}, the special
|
||||
sequence "<Bslash>" can be used. This avoids the need to double backslashes
|
||||
when using nested mappings.
|
||||
|
||||
*map-ambiguous*
|
||||
When two mappings start with the same sequence of characters, they are
|
||||
ambiguous. Example: >
|
||||
:imap aa foo
|
||||
:imap aaa bar
|
||||
When Vim has read "aa", it will need to get another character to be able to
|
||||
decide if "aa" or "aaa" should be mapped. This means that after typing "aa"
|
||||
that mapping won't get expanded yet, Vim is waiting for another character.
|
||||
If you type a space, then "foo" will get inserted, plus the space. If you
|
||||
type "a", then "bar" will get inserted.
|
||||
{Vi does not allow ambiguous mappings}
|
||||
|
||||
*map_CTRL_C*
|
||||
It's not possible to use a CTRL-C in the {lhs}. You just can't map CTRL-C.
|
||||
The reason is that CTRL-C must always be available to break a running command.
|
||||
Exception: When using the GUI version on MS-Windows CTRL-C can be mapped to
|
||||
allow a Copy command to the clipboard. Use CTRL-Break to interrupt Vim.
|
||||
*map_CTRL-C*
|
||||
Using CTRL-C in the {lhs} is possible, but it will only work when Vim is
|
||||
waiting for a key, not when Vim is busy with something. When Vim is busy
|
||||
CTRL-C interrupts/breaks the command.
|
||||
When using the GUI version on MS-Windows CTRL-C can be mapped to allow a Copy
|
||||
command to the clipboard. Use CTRL-Break to interrupt Vim.
|
||||
|
||||
*map_space_in_lhs*
|
||||
To include a space in {lhs} precede it with a CTRL-V (type two CTRL-Vs for
|
||||
@@ -320,6 +437,18 @@ example, to make sure that function key 8 does nothing at all: >
|
||||
:map <F8> <Nop>
|
||||
:map! <F8> <Nop>
|
||||
<
|
||||
*map-multibyte*
|
||||
It is possible to map multibyte characters, but only the whole character. You
|
||||
cannot map the first byte only. This was done to prevent problems in this
|
||||
scenario: >
|
||||
:set encoding=latin1
|
||||
:imap <M-C> foo
|
||||
:set encoding=utf-8
|
||||
The mapping for <M-C> is defined with the latin1 encoding, resulting in a 0xc3
|
||||
byte. If you type the character <20> (0xea <M-a>) in UTF-8 encoding this is the
|
||||
two bytes 0xc3 0xa1. You don't want the 0xc3 byte to be mapped then,
|
||||
otherwise it would be impossible to type the <20> character.
|
||||
|
||||
*<Leader>* *mapleader*
|
||||
To define a mapping which uses the "mapleader" variable, the special string
|
||||
"<Leader>" can be used. It is replaced with the string value of "mapleader".
|
||||
@@ -407,14 +536,16 @@ and CTRL-X is not mapped. This was done to be able to use all the named
|
||||
registers and marks, even when the command with the same name has been
|
||||
mapped.
|
||||
|
||||
*map-which-keys*
|
||||
|
||||
1.7 WHAT KEYS TO MAP *map-which-keys*
|
||||
|
||||
If you are going to map something, you will need to choose which key(s) to use
|
||||
for the {lhs}. You will have to avoid keys that are used for Vim commands,
|
||||
otherwise you would not be able to use those commands anymore. Here are a few
|
||||
suggestions:
|
||||
- Function keys <F2>, <F3>, etc.. Also the shifted function keys <S-F1>,
|
||||
<S-F2>, etc. Note that <F1> is already used for the help command.
|
||||
- Meta-keys (with the ALT key pressed).
|
||||
- Meta-keys (with the ALT key pressed). |:map-alt-keys|
|
||||
- Use the '_' or ',' character and then any other character. The "_" and ","
|
||||
commands do exist in Vim (see |_| and |,|), but you probably never use them.
|
||||
- Use a key that is a synonym for another command. For example: CTRL-P and
|
||||
@@ -425,7 +556,9 @@ losing any builtin function. You can also use ":help {key}^D" to find out if
|
||||
a key is used for some command. ({key} is the specific key you want to find
|
||||
out about, ^D is CTRL-D).
|
||||
|
||||
*map-examples*
|
||||
|
||||
1.8 EXAMPLES *map-examples*
|
||||
|
||||
A few examples (given as you type them, for "<CR>" you type four characters;
|
||||
the '<' flag must not be present in 'cpoptions' for this to work). >
|
||||
|
||||
@@ -434,7 +567,9 @@ the '<' flag must not be present in 'cpoptions' for this to work). >
|
||||
:map _x d/END/e<CR>
|
||||
:map! qq quadrillion questions
|
||||
<
|
||||
*map-typing*
|
||||
|
||||
1.9 USING MAPPINGS *map-typing*
|
||||
|
||||
Vim will compare what you type with the start of a mapped sequence. If there
|
||||
is an incomplete match, it will get more characters until there either is a
|
||||
complete match or until there is no match at all. Example: If you map! "qq",
|
||||
@@ -447,14 +582,15 @@ you type slowly, or your system is slow, reset the 'timeout' option. Then you
|
||||
might want to set the 'ttimeout' option.
|
||||
|
||||
*map-keys-fails*
|
||||
There is one situation where key codes might not be recognized:
|
||||
There are situations where key codes might not be recognized:
|
||||
- Vim can only read part of the key code. Mostly this is only the first
|
||||
character. This happens on some Unix versions in an xterm.
|
||||
- The key code is after character(s) that are mapped. E.g., "<F1><F1>" or
|
||||
"g<F1>".
|
||||
|
||||
The result is that the key code is not recognized in this situation, and the
|
||||
mapping fails.
|
||||
There are two actions needed to avoid this problem:
|
||||
mapping fails. There are two actions needed to avoid this problem:
|
||||
|
||||
- Remove the 'K' flag from 'cpoptions'. This will make Vim wait for the rest
|
||||
of the characters of the function key.
|
||||
- When using <F1> to <F4> the actual key code generated may correspond to
|
||||
@@ -470,6 +606,9 @@ special key: >
|
||||
Don't type a real <Esc>, Vim will recognize the key code and replace it with
|
||||
<F1> anyway.
|
||||
|
||||
Another problem may be that when keeping ALT or Meta pressed the terminal
|
||||
prepends ESC instead of setting the 8th bit. See |:map-alt-keys|.
|
||||
|
||||
*recursive_mapping*
|
||||
If you include the {lhs} in the {rhs} you have a recursive mapping. When
|
||||
{lhs} is typed, it will be replaced with {rhs}. When the {lhs} which is
|
||||
@@ -506,43 +645,104 @@ the original Vi, as long as there is only one undo command in the mapped
|
||||
sequence (having two undo commands in a mapped sequence did not make sense
|
||||
in the original Vi, you would get back the text before the first undo).
|
||||
|
||||
*:map-special-keys*
|
||||
There are three ways to map a special key:
|
||||
1. The Vi-compatible method: Map the key code. Often this is a sequence that
|
||||
starts with <Esc>. To enter a mapping like this you type ":map " and then
|
||||
you have to type CTRL-V before hitting the function key. Note that when
|
||||
the key code for the key is in the termcap (the t_ options), it will
|
||||
automatically be translated into the internal code and become the second
|
||||
way of mapping (unless the 'k' flag is included in 'cpoptions').
|
||||
2. The second method is to use the internal code for the function key. To
|
||||
enter such a mapping type CTRL-K and then hit the function key, or use
|
||||
the form "#1", "#2", .. "#9", "#0", "<Up>", "<S-Down>", "<S-F7>", etc.
|
||||
(see table of keys |key-notation|, all keys from <Up> can be used). The
|
||||
first ten function keys can be defined in two ways: Just the number, like
|
||||
"#2", and with "<F>", like "<F2>". Both stand for function key 2. "#0"
|
||||
refers to function key 10, defined with option 't_f10', which may be
|
||||
function key zero on some keyboards. The <> form cannot be used when
|
||||
'cpoptions' includes the '<' flag.
|
||||
3. Use the termcap entry, with the form <t_xx>, where "xx" is the name of the
|
||||
termcap entry. Any string entry can be used. For example: >
|
||||
:map <t_F3> G
|
||||
< Maps function key 13 to "G". This does not work if 'cpoptions' includes
|
||||
the '<' flag.
|
||||
|
||||
The advantage of the second and third method is that the mapping will work on
|
||||
different terminals without modification (the function key will be
|
||||
translated into the same internal code or the actual key code, no matter what
|
||||
terminal you are using. The termcap must be correct for this to work, and you
|
||||
must use the same mappings).
|
||||
1.10 MAPPING ALT-KEYS *:map-alt-keys*
|
||||
|
||||
DETAIL: Vim first checks if a sequence from the keyboard is mapped. If it
|
||||
isn't the terminal key codes are tried (see |terminal-options|). If a
|
||||
terminal code is found it is replaced with the internal code. Then the check
|
||||
for a mapping is done again (so you can map an internal code to something
|
||||
else). What is written into the script file depends on what is recognized.
|
||||
If the terminal key code was recognized as a mapping the key code itself is
|
||||
written to the script file. If it was recognized as a terminal code the
|
||||
internal code is written to the script file.
|
||||
In the GUI Vim handles the Alt key itself, thus mapping keys with ALT should
|
||||
always work. But in a terminal Vim gets a sequence of bytes and has to figure
|
||||
out whether ALT was pressed or not.
|
||||
|
||||
By default Vim assumes that pressing the ALT key sets the 8th bit of a typed
|
||||
character. Most decent terminals can work that way, such as xterm, aterm and
|
||||
rxvt. If your <A-k> mappings don't work it might be that the terminal is
|
||||
prefixing the character with an ESC character. But you can just as well type
|
||||
ESC before a character, thus Vim doesn't know what happened (except for
|
||||
checking the delay between characters, which is not reliable).
|
||||
|
||||
As of this writing, some mainstream terminals like gnome-terminal and konsole
|
||||
use the ESC prefix. There doesn't appear a way to have them use the 8th bit
|
||||
instead. Xterm should work well by default. Aterm and rxvt should work well
|
||||
when started with the "--meta8" argument. You can also tweak resources like
|
||||
"metaSendsEscape", "eightBitInput" and "eightBitOutput".
|
||||
|
||||
On the Linux console, this behavior can be toggled with the "setmetamode"
|
||||
command. Bear in mind that not using an ESC prefix could get you in trouble
|
||||
with other programs. You should make sure that bash has the "convert-meta"
|
||||
option set to "on" in order for your Meta keybindings to still work on it
|
||||
(it's the default readline behavior, unless changed by specific system
|
||||
configuration). For that, you can add the line: >
|
||||
|
||||
set convert-meta on
|
||||
|
||||
to your ~/.inputrc file. If you're creating the file, you might want to use: >
|
||||
|
||||
$include /etc/inputrc
|
||||
|
||||
as the first line, if that file exists on your system, to keep global options.
|
||||
This may cause a problem for entering special characters, such as the umlaut.
|
||||
Then you should use CTRL-V before that character.
|
||||
|
||||
Bear in mind that convert-meta has been reported to have troubles when used in
|
||||
UTF-8 locales. On terminals like xterm, the "metaSendsEscape" resource can be
|
||||
toggled on the fly through the "Main Options" menu, by pressing Ctrl-LeftClick
|
||||
on the terminal; that's a good last resource in case you want to send ESC when
|
||||
using other applications but not when inside VIM.
|
||||
|
||||
|
||||
1.11 MAPPING AN OPERATOR *:map-operator*
|
||||
|
||||
An operator is used before a {motion} command. To define your own operator
|
||||
you must create mapping that first sets the 'operatorfunc' option and then
|
||||
invoke the |g@| operator. After the user types the {motion} command the
|
||||
specified function will be called.
|
||||
|
||||
*g@* *E774* *E775*
|
||||
g@{motion} Call the function set by the 'operatorfunc' option.
|
||||
The '[ mark is positioned at the start of the text
|
||||
moved over by {motion}, the '] mark on the last
|
||||
character of the text.
|
||||
The function is called with one String argument:
|
||||
"line" {motion} was |linewise|
|
||||
"char" {motion} was |characterwise|
|
||||
"block" {motion} was |blockwise-visual||
|
||||
Although "block" would rarely appear, since it can
|
||||
only result from Visual mode where "g@" is not useful.
|
||||
{not available when compiled without the +eval
|
||||
feature}
|
||||
|
||||
Here is an example that counts the number of spaces with <F4>: >
|
||||
|
||||
nmap <silent> <F4> :set opfunc=CountSpaces<CR>g@
|
||||
vmap <silent> <F4> :<C-U>call CountSpaces(visualmode(), 1)<CR>
|
||||
|
||||
function! CountSpaces(type, ...)
|
||||
let sel_save = &selection
|
||||
let &selection = "inclusive"
|
||||
let reg_save = @@
|
||||
|
||||
if a:0 " Invoked from Visual mode, use '< and '> marks.
|
||||
silent exe "normal! `<" . a:type . "`>y"
|
||||
elseif a:type == 'line'
|
||||
silent exe "normal! '[V']y"
|
||||
elseif a:type == 'block'
|
||||
silent exe "normal! `[\<C-V>`]y"
|
||||
else
|
||||
silent exe "normal! `[v`]y"
|
||||
endif
|
||||
|
||||
echomsg strlen(substitute(@@, '[^ ]', '', 'g'))
|
||||
|
||||
let &selection = sel_save
|
||||
let @@ = reg_save
|
||||
endfunction
|
||||
|
||||
Note that the 'selection' option is temporarily set to "inclusive" to be able
|
||||
to yank exactly the right text by using Visual mode from the '[ to the ']
|
||||
mark.
|
||||
|
||||
Also note that there is a separate mapping for Visual mode. It removes the
|
||||
"'<,'>" range that ":" inserts in Visual mode and invokes the function with
|
||||
visualmode() and an extra argument.
|
||||
|
||||
==============================================================================
|
||||
2. Abbreviations *abbreviations* *Abbreviations*
|
||||
@@ -631,7 +831,7 @@ This does not work if 'cpoptions' includes the '<' flag. |<>|
|
||||
You can even do more complicated things. For example, to consume the space
|
||||
typed after an abbreviation: >
|
||||
func Eatchar(pat)
|
||||
let c = nr2char(getchar())
|
||||
let c = nr2char(getchar(0))
|
||||
return (c =~ a:pat) ? '' : c
|
||||
endfunc
|
||||
iabbr <silent> if if ()<Left><C-R>=Eatchar('\s')<CR>
|
||||
@@ -656,6 +856,16 @@ used in a |filetype-plugin| file. Example for a C plugin file: >
|
||||
mode, '!' for both. These are the same as for
|
||||
mappings, see |map-listing|.
|
||||
|
||||
*:abbreviate-verbose*
|
||||
When 'verbose' is non-zero, listing an abbreviation will also display where it
|
||||
was last defined. Example: >
|
||||
|
||||
:verbose abbreviate
|
||||
! teh the
|
||||
Last set from /home/abcd/vim/abbr.vim
|
||||
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
:ab[breviate] {lhs} list the abbreviations that start with {lhs}
|
||||
You may need to insert a CTRL-V (type it twice) to
|
||||
avoid that a typed {lhs} is expanded, since
|
||||
@@ -793,11 +1003,10 @@ local function or uses a local mapping.
|
||||
Otherwise, using "<SID>" outside of a script context is an error.
|
||||
|
||||
If you need to get the script number to use in a complicated script, you can
|
||||
use this trick: >
|
||||
:map <SID>xx <SID>xx
|
||||
:let s:sid = maparg("<SID>xx")
|
||||
:unmap <SID>xx
|
||||
And remove the trailing "xx".
|
||||
use this function: >
|
||||
function s:SID()
|
||||
return matchstr(expand('<sfile>'), '<SNR>\zs\d\+\ze_SID$')
|
||||
endfun
|
||||
|
||||
The "<SNR>" will be shown when listing functions and mappings. This is useful
|
||||
to find out what they are defined to.
|
||||
@@ -811,7 +1020,7 @@ feature}.
|
||||
==============================================================================
|
||||
4. User-defined commands *user-commands*
|
||||
|
||||
It is possible to define your own Ex commands. A user-defined command can act
|
||||
It is possible to define your own Ex commands. A user-defined command can act
|
||||
just like a built-in command (it can have a range or arguments, arguments can
|
||||
be completed as filenames or buffer names, etc), except that when the command
|
||||
is executed, it is transformed into a normal ex command and then executed.
|
||||
@@ -820,7 +1029,7 @@ For starters: See section |40.2| in the user manual.
|
||||
|
||||
*E183* *user-cmd-ambiguous*
|
||||
All user defined commands must start with an uppercase letter, to avoid
|
||||
confusion with builtin commands. (There are a few builtin commands, notably
|
||||
confusion with builtin commands. (There are a few builtin commands, notably
|
||||
:Next, :Print and :X, which do start with an uppercase letter. The builtin
|
||||
will always take precedence in these cases). The other characters of the user
|
||||
command can be uppercase letters, lowercase letters or digits. When using
|
||||
@@ -829,8 +1038,8 @@ ambiguous. For example, the command ":Cc2" could be the user command ":Cc2"
|
||||
without an argument, or the command ":Cc" with argument "2". It is advised to
|
||||
put a space between the command name and the argument to avoid these problems.
|
||||
|
||||
When using a user-defined command, the command can be abbreviated. However, if
|
||||
an abbreviation is not unique, an error will be issued. Furthermore, a
|
||||
When using a user-defined command, the command can be abbreviated. However, if
|
||||
an abbreviation is not unique, an error will be issued. Furthermore, a
|
||||
built-in command will always take precedence.
|
||||
|
||||
Example: >
|
||||
@@ -846,7 +1055,7 @@ It is recommended that full names for user-defined commands are used in
|
||||
scripts.
|
||||
|
||||
:com[mand] *:com* *:command*
|
||||
List all user-defined commands. When listing commands,
|
||||
List all user-defined commands. When listing commands,
|
||||
the characters in the first two columns are
|
||||
! Command has the -bang attribute
|
||||
" Command has the -register attribute
|
||||
@@ -855,11 +1064,22 @@ scripts.
|
||||
|
||||
:com[mand] {cmd} List the user-defined commands that start with {cmd}
|
||||
|
||||
*:command-verbose*
|
||||
When 'verbose' is non-zero, listing a command will also display where it was
|
||||
last defined. Example: >
|
||||
|
||||
:verbose command TOhtml
|
||||
Name Args Range Complete Definition
|
||||
TOhtml 0 % :call Convert2HTML(<line1>, <line2>)
|
||||
Last set from /usr/share/vim/vim-7.0/plugin/tohtml.vim
|
||||
<
|
||||
See |:verbose-cmd| for more information.
|
||||
|
||||
*E174* *E182*
|
||||
:com[mand][!] [{attr}...] {cmd} {rep}
|
||||
Define a user command. The name of the command is
|
||||
{cmd} and its replacement text is {rep}. The command's
|
||||
attributes (see below) are {attr}. If the command
|
||||
{cmd} and its replacement text is {rep}. The command's
|
||||
attributes (see below) are {attr}. If the command
|
||||
already exists, an error is reported, unless a ! is
|
||||
specified, in which case the command is redefined.
|
||||
|
||||
@@ -871,20 +1091,20 @@ scripts.
|
||||
|
||||
Command attributes
|
||||
|
||||
User-defined commands are treated by Vim just like any other ex commands. They
|
||||
can have arguments, or have a range specified. Arguments are subject to
|
||||
completion as filenames, buffers, etc. Exactly how this works depends upon the
|
||||
User-defined commands are treated by Vim just like any other ex commands. They
|
||||
can have arguments, or have a range specified. Arguments are subject to
|
||||
completion as filenames, buffers, etc. Exactly how this works depends upon the
|
||||
command's attributes, which are specified when the command is defined.
|
||||
|
||||
There are a number of attributes, split into four categories: argument
|
||||
handling, completion behavior, range handling, and special cases. The
|
||||
handling, completion behavior, range handling, and special cases. The
|
||||
attributes are described below, by category.
|
||||
|
||||
Argument handling *E175* *E176*
|
||||
|
||||
By default, a user defined command will take no arguments (and an error is
|
||||
reported if any are supplied). However, it is possible to specify that the
|
||||
command can take arguments, using the -nargs attribute. Valid cases are:
|
||||
reported if any are supplied). However, it is possible to specify that the
|
||||
command can take arguments, using the -nargs attribute. Valid cases are:
|
||||
|
||||
-nargs=0 No arguments are allowed (the default)
|
||||
-nargs=1 Exactly one argument is required
|
||||
@@ -922,6 +1142,7 @@ completion can be enabled:
|
||||
-complete=event autocommand events
|
||||
-complete=expression Vim expression
|
||||
-complete=file file and directory names
|
||||
-complete=shellcmd Shell command
|
||||
-complete=function function name
|
||||
-complete=help help subjects
|
||||
-complete=highlight highlight groups
|
||||
@@ -932,26 +1153,38 @@ completion can be enabled:
|
||||
-complete=tag_listfiles tags, file names are shown when CTRL-D is hit
|
||||
-complete=var user variables
|
||||
-complete=custom,{func} custom completion, defined via {func}
|
||||
-complete=customlist,{func} custom completion, defined via {func}
|
||||
|
||||
Custom completion *:command-completion-custom*
|
||||
*E467* *E468*
|
||||
|
||||
Custom completion *:command-completion-custom*
|
||||
*:command-completion-customlist*
|
||||
*E467* *E468*
|
||||
It is possible to define customized completion schemes via the "custom,{func}"
|
||||
completion argument. The {func} part should be a function with the following
|
||||
prototype >
|
||||
or the "customlist,{func}" completion argument. The {func} part should be a
|
||||
function with the following prototype >
|
||||
|
||||
:function {func}(ArgLead, CmdLine, CursorPos)
|
||||
|
||||
The function need not use all these arguments, but it should provide the
|
||||
completion candidates as the return value, one per line in a newline separated
|
||||
string. The function arguments are:
|
||||
The function need not use all these arguments. The function should provide the
|
||||
completion candidates as the return value.
|
||||
|
||||
For the "custom" argument, the function should return the completion
|
||||
candidates one per line in a newline separated string.
|
||||
|
||||
For the "customlist" argument, the function should return the completion
|
||||
candidates as a Vim List. Non-string items in the list are ignored.
|
||||
|
||||
The function arguments are:
|
||||
ArgLead the leading portion of the argument currently being
|
||||
completed on
|
||||
CmdLine the entire command line
|
||||
CursorPos the cursor position in it
|
||||
The function may use these for determining context. It is not necessary to
|
||||
filter candidates against the (implicit pattern in) ArgLead. Vim will do
|
||||
filter the candidates with its regexp engine after function return, and this
|
||||
is probably more efficient in most cases.
|
||||
CursorPos the cursor position in it (byte index)
|
||||
The function may use these for determining context. For the "custom"
|
||||
argument, it is not necessary to filter candidates against the (implicit
|
||||
pattern in) ArgLead. Vim will do filter the candidates with its regexp engine
|
||||
after function return, and this is probably more efficient in most cases. For
|
||||
the "customlist" argument, Vim will not filter the returned completion
|
||||
candidates and the user supplied function should filter the candidates.
|
||||
|
||||
The following example lists user names to a Finger command >
|
||||
:com -complete=custom,ListUsers -nargs=1 Finger !finger <args>
|
||||
@@ -959,13 +1192,22 @@ The following example lists user names to a Finger command >
|
||||
: return system("cut -d: -f1 /etc/passwd")
|
||||
:endfun
|
||||
|
||||
The following example completes filenames from the directories specified in
|
||||
the 'path' option: >
|
||||
:com -nargs=1 -bang -complete=customlist,EditFileComplete
|
||||
\ EditFile edit<bang> <args>
|
||||
:fun EditFileComplete(A,L,P)
|
||||
: return split(globpath(&path, a:ArgLead), "\n")
|
||||
:endfun
|
||||
<
|
||||
|
||||
Range handling *E177* *E178*
|
||||
|
||||
By default, user-defined commands do not accept a line number range. However,
|
||||
By default, user-defined commands do not accept a line number range. However,
|
||||
it is possible to specify that the command does take a range (the -range
|
||||
attribute), or that it takes an arbitrary count value, either in the line
|
||||
number position (-range=N, like the |:split| command) or as a "count"
|
||||
argument (-count=N, like the |:Next| command). Possible attributes are:
|
||||
argument (-count=N, like the |:Next| command). Possible attributes are:
|
||||
|
||||
-range Range allowed, default is current line
|
||||
-range=% Range allowed, default is whole file (1,$)
|
||||
@@ -997,10 +1239,11 @@ replacement text separately.
|
||||
Replacement text
|
||||
|
||||
The replacement text for a user defined command is scanned for special escape
|
||||
sequences, using <...> notation. Escape sequences are replaced with values
|
||||
from the entered command line, and all other text is copied unchanged. The
|
||||
resulting string is executed as an Ex command. If the initial < of an escape
|
||||
sequence is preceded by a backslash, the sequence is copied unchanged.
|
||||
sequences, using <...> notation. Escape sequences are replaced with values
|
||||
from the entered command line, and all other text is copied unchanged. The
|
||||
resulting string is executed as an Ex command. To avoid the replacement use
|
||||
<lt> in plade of the initial <. Thus to include "<bang>" literally use
|
||||
"<lt>bang>".
|
||||
|
||||
The valid escape sequences are
|
||||
|
||||
@@ -1017,7 +1260,7 @@ The valid escape sequences are
|
||||
expands to nothing.
|
||||
*<reg>* *<register>*
|
||||
<reg> (See the '-register' attribute) The optional register,
|
||||
if specified. Otherwise, expands to nothing. <register>
|
||||
if specified. Otherwise, expands to nothing. <register>
|
||||
is a synonym for this.
|
||||
*<args>*
|
||||
<args> The command arguments, exactly as supplied (but as
|
||||
@@ -1032,13 +1275,13 @@ The valid escape sequences are
|
||||
If the first two characters of an escape sequence are "q-" (for example,
|
||||
<q-args>) then the value is quoted in such a way as to make it a valid value
|
||||
for use in an expression. This uses the argument as one single value.
|
||||
When there is no argument <q-args> is an empty string.
|
||||
|
||||
To allow commands to pass their arguments on to a user-defined function, there
|
||||
is a special form <f-args> ("function args"). This splits the command
|
||||
is a special form <f-args> ("function args"). This splits the command
|
||||
arguments at spaces and Tabs, quotes each argument individually, and the
|
||||
<f-args> sequence is replaced by the comma-separated list of quoted arguments.
|
||||
See the Mycmd example below. When there is no argument, <f-args> also has no
|
||||
argument.
|
||||
See the Mycmd example below. If no arguments are given <f-args> is removed.
|
||||
|
||||
Examples >
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*mbyte.txt* For Vim version 7.0aa. Last change: 2005 Feb 13
|
||||
*mbyte.txt* For Vim version 7.0b. Last change: 2006 Mar 05
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar et al.
|
||||
@@ -286,6 +286,29 @@ Supported 'encoding' values are: *encoding-values*
|
||||
1 koi8-u Ukrainian
|
||||
1 macroman MacRoman (Macintosh encoding)
|
||||
1 8bit-{name} any 8-bit encoding (Vim specific name)
|
||||
1 cp437 similar to iso-8859-1
|
||||
1 cp737 similar to iso-8859-7
|
||||
1 cp775 Baltic
|
||||
1 cp850 similar to iso-8859-4
|
||||
1 cp852 similar to iso-8859-1
|
||||
1 cp855 similar to iso-8859-2
|
||||
1 cp857 similar to iso-8859-5
|
||||
1 cp860 similar to iso-8859-9
|
||||
1 cp861 similar to iso-8859-1
|
||||
1 cp862 similar to iso-8859-1
|
||||
1 cp863 similar to iso-8859-8
|
||||
1 cp865 similar to iso-8859-1
|
||||
1 cp866 similar to iso-8859-5
|
||||
1 cp869 similar to iso-8859-7
|
||||
1 cp874 Thai
|
||||
1 cp1250 Czech, Polish, etc.
|
||||
1 cp1251 Cyrillic
|
||||
1 cp1253 Greek
|
||||
1 cp1254 Turkish
|
||||
1 cp1255 Hebrew
|
||||
1 cp1256 Arabic
|
||||
1 cp1257 Baltic
|
||||
1 cp1258 Vietnamese
|
||||
1 cp{number} MS-Windows: any installed single-byte codepage
|
||||
2 cp932 Japanese (Windows only)
|
||||
2 euc-jp Japanese (Unix only)
|
||||
@@ -436,7 +459,7 @@ Useful utilities for converting the charset:
|
||||
ftp://ftp.cuhk.hk/pub/chinese/ifcss/software/unix/convert/hc-30.tar.gz
|
||||
|
||||
Korean: hmconv
|
||||
Hmconv is Korean code conversion utility especially for E-mail. It can
|
||||
Hmconv is Korean code conversion utility especially for E-mail. It can
|
||||
convert between EUC-KR and ISO-2022-KR. Hmconv can be found at:
|
||||
ftp://ftp.kaist.ac.kr/pub/hangul/code/hmconv/
|
||||
|
||||
@@ -444,7 +467,7 @@ Useful utilities for converting the charset:
|
||||
Lv is a Powerful Multilingual File Viewer. And it can be worked as
|
||||
|charset| converter. Supported |charset|: ISO-2022-CN, ISO-2022-JP,
|
||||
ISO-2022-KR, EUC-CN, EUC-JP, EUC-KR, EUC-TW, UTF-7, UTF-8, ISO-8859
|
||||
series, Shift_JIS, Big5 and HZ. Lv can be found at:
|
||||
series, Shift_JIS, Big5 and HZ. Lv can be found at:
|
||||
http://www.ff.iij4u.or.jp/~nrt/freeware/lv4495.tar.gz
|
||||
|
||||
|
||||
@@ -461,6 +484,12 @@ conversion needs to be done. These conversions are supported:
|
||||
request a very large buffer, more than Vim is willing to provide).
|
||||
Try getting another iconv() implementation.
|
||||
|
||||
*iconv-dynamic*
|
||||
On MS-Windows Vim can be compiled with the |+iconv/dyn| feature. This means
|
||||
Vim will search for the "iconv.dll" and "libiconv.dll" libraries. When
|
||||
neither of them can be found Vim will still work but some conversions won't be
|
||||
possible.
|
||||
|
||||
==============================================================================
|
||||
4. Using a terminal *mbyte-terminal*
|
||||
|
||||
@@ -506,7 +535,7 @@ Now start xterm with >
|
||||
or, for bigger character: >
|
||||
xterm -u8 -fn -misc-fixed-medium-r-normal--15-140-75-75-c-90-iso10646-1
|
||||
|
||||
and you will have a working UTF-8 terminal emulator. Try both >
|
||||
and you will have a working UTF-8 terminal emulator. Try both >
|
||||
|
||||
cat utf-8-demo.txt
|
||||
vim utf-8-demo.txt
|
||||
@@ -761,7 +790,7 @@ is suitable for complex input, such as CJK.
|
||||
number of Hira-gana characters are 76. So, first, we pre-input text as
|
||||
pronounced in Hira-gana, second, we convert Hira-gana to Kanji or Kata-Kana,
|
||||
if needed. There are some Kana-Kanji conversion server: jserver
|
||||
(distributed with Wnn, see below) and canna. Canna could be found at:
|
||||
(distributed with Wnn, see below) and canna. Canna could be found at:
|
||||
ftp://ftp.nec.co.jp/pub/Canna/ (no longer works).
|
||||
|
||||
There is a good input system: Wnn4.2. Wnn 4.2 contains,
|
||||
@@ -801,7 +830,7 @@ Use the RPM or port for your system.
|
||||
Preedit Area and Status Area are performed by the client application in
|
||||
the area of application. The client application is directed by the
|
||||
|IM-server| to display all pre-edit data at the location of text
|
||||
insertion. The client registers callbacks invoked by the input method
|
||||
insertion. The client registers callbacks invoked by the input method
|
||||
during pre-editing.
|
||||
*. over-the-spot *OverTheSpot*
|
||||
Status Area is created in a fixed position within the area of application,
|
||||
@@ -1228,11 +1257,16 @@ Double-width characters are supported. This works best with 'guifontwide' or
|
||||
normal width and a space to fill the gap. Note that the 'guifontset' option
|
||||
is no longer relevant in the GTK+ 2 GUI.
|
||||
|
||||
Up to two combining characters can be used. The combining character is drawn
|
||||
on top of the preceding character. When editing text a composing character is
|
||||
mostly considered part of the preceding character. For example "x" will
|
||||
delete a character and its following composing characters by default. If the
|
||||
'delcombine' option is on, then pressing 'x' will delete the combining
|
||||
*mbyte-combining* *mbyte-composing*
|
||||
A composing or combining character is used to change the meaning of the
|
||||
character before it. The combining characters are drawn on top of the
|
||||
preceding character.
|
||||
Up to two combining characters can be used by default. This can be changed
|
||||
with the 'maxcombine' option.
|
||||
When editing text a composing character is mostly considered part of the
|
||||
preceding character. For example "x" will delete a character and its
|
||||
following composing characters by default.
|
||||
If the 'delcombine' option is on, then pressing 'x' will delete the combining
|
||||
characters, one at a time, then the base character. But when inserting, you
|
||||
type the first character and the following composing characters separately,
|
||||
after which they will be joined. The "r" command will not allow you to type a
|
||||
@@ -1253,7 +1287,7 @@ characters present in the selected font.
|
||||
|
||||
Useful commands:
|
||||
- "ga" shows the decimal, hexadecimal and octal value of the character under
|
||||
the cursor. If there are composing characters these are shown too. (if the
|
||||
the cursor. If there are composing characters these are shown too. (If the
|
||||
message is truncated, use ":messages").
|
||||
- "g8" shows the bytes used in a UTF-8 character, also the composing
|
||||
characters, as hex numbers.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
*message.txt* For Vim version 7.0aa. Last change: 2005 Feb 13
|
||||
*message.txt* For Vim version 7.0b. Last change: 2006 Mar 01
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Bram Moolenaar
|
||||
@@ -19,7 +19,16 @@ The ":messages" command can be used to view previously given messages. This
|
||||
is especially useful when messages have been overwritten or truncated. This
|
||||
depends on the 'shortmess' option.
|
||||
|
||||
The number of remembered messages is fixed at 20.
|
||||
The number of remembered messages is fixed at 20 for the tiny version and 100
|
||||
for other versions.
|
||||
|
||||
*g<*
|
||||
The "g<" command can be used to see the last page of previous command output.
|
||||
This is especially useful if you accidentally typed <Space> at the hit-enter
|
||||
prompt.
|
||||
Note: when you stopped the output with "q" at the more prompt only up to that
|
||||
point will be displayed.
|
||||
The previous command output is cleared when another command produces output.
|
||||
|
||||
If you are using translated messages, the first printed line tells who
|
||||
maintains the messages or the translations. You can use this to contact the
|
||||
@@ -279,6 +288,19 @@ Example: >
|
||||
changes to: >
|
||||
:w! /tmp/test
|
||||
<
|
||||
*E768* >
|
||||
Swap file exists: {filename} (:silent! overrides)
|
||||
|
||||
You are protected from overwriting a file that is being edited by Vim. This
|
||||
happens when you use ":w! filename" and a swapfile is found.
|
||||
- If the swapfile was left over from an old crashed edit session you may want
|
||||
to delete the swapfile. Edit {filename} to find out information about the
|
||||
swapfile.
|
||||
- If you want to write anyway prepend ":silent!" to the command. For example: >
|
||||
:silent! w! /tmp/test
|
||||
< The special command is needed, since you already added the ! for overwriting
|
||||
an existing file.
|
||||
|
||||
*E139* >
|
||||
File is loaded in another buffer
|
||||
|
||||
@@ -568,6 +590,7 @@ The file is read-only and you are making a change to it anyway. You can use
|
||||
the |FileChangedRO| autocommand event to avoid this message (the autocommand
|
||||
must reset the 'readonly' option). See 'modifiable' to completely disallow
|
||||
making changes to a file.
|
||||
This message is only given for the first change after 'readonly' has been set.
|
||||
|
||||
*W13* >
|
||||
Warning: File "{filename}" has been created after editing started
|
||||
@@ -714,9 +737,10 @@ a user-defined command.
|
||||
|
||||
This is an (incomplete) overview of various messages that Vim gives:
|
||||
|
||||
*hit-enter* *press-enter* *hit-return* *press-return* >
|
||||
*hit-enter* *press-enter* *hit-return*
|
||||
*press-return* *hit-enter-prompt*
|
||||
|
||||
Hit ENTER or type command to continue
|
||||
Press ENTER or type command to continue
|
||||
|
||||
This message is given when there is something on the screen for you to read,
|
||||
and the screen is about to be redrawn:
|
||||
@@ -724,10 +748,16 @@ and the screen is about to be redrawn:
|
||||
- Something is displayed on the status line that is longer than the width of
|
||||
the window, or runs into the 'showcmd' or 'ruler' output.
|
||||
|
||||
-> Hit <Enter> or <Space> to redraw the screen and continue, without that key
|
||||
being used otherwise.
|
||||
-> Hit ":" or any other Normal mode command character to start that command.
|
||||
-> Hit <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Press <Enter> or <Space> to redraw the screen and continue, without that
|
||||
key being used otherwise.
|
||||
-> Press ':' or any other Normal mode command character to start that command.
|
||||
-> Press 'k', <Up>, 'u', 'b' or 'g' to scroll back in the messages. This
|
||||
works the same way as at the |more-prompt|. Only works when 'compatible'
|
||||
is off and 'more' is on.
|
||||
-> Pressing 'j', 'd' or <Down> is ignored when messages scrolled off the top
|
||||
of the screen, 'compatible' is off and 'more' is on, to avoid that typing
|
||||
one 'j' too many causes the messages to disappear.
|
||||
-> Press <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Use a menu. The characters defined for Cmdline-mode are used.
|
||||
-> When 'mouse' contains the 'r' flag, clicking the left mouse button works
|
||||
like pressing <Space>. This makes it impossible to select text though.
|
||||
@@ -735,19 +765,24 @@ and the screen is about to be redrawn:
|
||||
pressing <Space>.
|
||||
{Vi: only ":" commands are interpreted}
|
||||
|
||||
If you accidentally hit <Enter> or <Space> and you want to see the displayed
|
||||
text then use |g<|. This only works when 'more' is set.
|
||||
|
||||
To reduce the number of hit-enter prompts:
|
||||
- Set 'cmdheight' to 2 or higher.
|
||||
- Add flags to 'shortmess'.
|
||||
- Reset 'showcmd' and/or 'ruler'.
|
||||
|
||||
If your script causes the hit-enter prompt and you don't know why, you may
|
||||
find the |v:scrollstart| variable useful.
|
||||
|
||||
Also see 'mouse'. The hit-enter message is highlighted with the |hl-Question|
|
||||
group.
|
||||
|
||||
|
||||
*more-prompt* *pager* >
|
||||
-- More --
|
||||
-- More -- (RET: line, SPACE: page, d: half page, q: quit)
|
||||
-- More -- (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)
|
||||
-- More -- SPACE/d/j: screen/page/line down, b/u/k: up, q: quit
|
||||
|
||||
This message is given when the screen is filled with messages. It is only
|
||||
given when the 'more' option is on. It is highlighted with the |hl-MoreMsg|
|
||||
@@ -755,11 +790,16 @@ group.
|
||||
|
||||
Type effect ~
|
||||
<CR> or <NL> or j or <Down> one more line
|
||||
d down a page (half a screen)
|
||||
<Space> or <PageDown> down a screen
|
||||
G down all the way, until the hit-enter
|
||||
prompt
|
||||
|
||||
<BS> or k or <Up> one line back (*)
|
||||
<Space> or <PageDown> next page
|
||||
b or <PageUp> previous page (*)
|
||||
d down half a page
|
||||
u up half a page (*)
|
||||
u up a page (half a screen) (*)
|
||||
b or <PageUp> back a screen (*)
|
||||
g back to the start (*)
|
||||
|
||||
q, <Esc> or CTRL-C stop the listing
|
||||
: stop the listing and enter a
|
||||
command-line
|
||||
@@ -771,8 +811,8 @@ Type effect ~
|
||||
|
||||
Any other key causes the meaning of the keys to be displayed.
|
||||
|
||||
(*) backwards scrolling is only supported for these commands: >
|
||||
:clist
|
||||
(*) backwards scrolling is {not in Vi}. Only scrolls back to where messages
|
||||
started to scroll.
|
||||
(**) Clicking the left mouse button only works:
|
||||
- For the GUI: in the last line of the screen.
|
||||
- When 'r' is included in 'mouse' (but then selecting text won't work).
|
||||
@@ -781,4 +821,8 @@ Any other key causes the meaning of the keys to be displayed.
|
||||
Note: The typed key is directly obtained from the terminal, it is not mapped
|
||||
and typeahead is ignored.
|
||||
|
||||
The |g<| command can be used to see the last page of previous command output.
|
||||
This is especially useful if you accidentally typed <Space> at the hit-enter
|
||||
prompt.
|
||||
|
||||
vim:tw=78:ts=8:ft=help:norl:
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user