Compare commits

...

200 Commits

Author SHA1 Message Date
Bram Moolenaar
b3656edcb9 updated for version 7.0230 2006-03-20 21:59:49 +00:00
Bram Moolenaar
9b2200acd6 updated for version 7.0230 2006-03-20 21:55:45 +00:00
Bram Moolenaar
0126585dbb updated for version 7.0230 2006-03-20 21:50:15 +00:00
Bram Moolenaar
371d5403d0 updated for version 7.0230 2006-03-20 21:47:49 +00:00
Bram Moolenaar
ceaf7b8b66 updated for version 7.0229 2006-03-19 22:18:55 +00:00
Bram Moolenaar
39f05630ad updated for version 7.0229 2006-03-19 22:15:26 +00:00
Bram Moolenaar
c15ef30c08 updated for version 7.0229 2006-03-19 22:11:16 +00:00
Bram Moolenaar
e0fa560e6f updated for version 7.0229 2006-03-19 22:08:37 +00:00
Bram Moolenaar
2c93230f48 updated for version 7.0228 2006-03-18 21:42:09 +00:00
Bram Moolenaar
97b2ad3542 updated for version 7.0228 2006-03-18 21:40:56 +00:00
Bram Moolenaar
658b74a736 updated for version 7.0228 2006-03-18 21:33:02 +00:00
Bram Moolenaar
8d6ea5eb4f updated for version 7.0228 2006-03-18 21:31:46 +00:00
Bram Moolenaar
be4d506b5f updated for version 7.0228 2006-03-18 21:30:13 +00:00
Bram Moolenaar
f0acfce534 updated for version 7.0227 2006-03-17 23:21:19 +00:00
Bram Moolenaar
ca003e1e4f updated for version 7.0227 2006-03-17 23:19:38 +00:00
Bram Moolenaar
68f1a48647 updated for version 7.0227 2006-03-17 23:12:21 +00:00
Bram Moolenaar
a83c3e0ebd updated for version 7.0227 2006-03-17 23:10:44 +00:00
Bram Moolenaar
ea0cd36bdd updated for version 7.0226 2006-03-16 21:46:52 +00:00
Bram Moolenaar
2eb25daffd updated for version 7.0226 2006-03-16 21:43:34 +00:00
Bram Moolenaar
efd2bf158a updated for version 7.0226 2006-03-16 21:41:35 +00:00
Bram Moolenaar
d3667a2e29 updated for version 7.0226 2006-03-16 21:35:52 +00:00
Bram Moolenaar
cf03447964 updated for version 7.0225 2006-03-15 23:07:59 +00:00
Bram Moolenaar
27dc19509b updated for version 7.0225 2006-03-15 23:06:44 +00:00
Bram Moolenaar
95e9b49537 updated for version 7.0225 2006-03-15 23:04:43 +00:00
Bram Moolenaar
9d47f1707b updated for version 7.0225 2006-03-15 23:03:01 +00:00
Bram Moolenaar
7d47b6eed7 updated for version 7.0225 2006-03-15 22:59:18 +00:00
Bram Moolenaar
5671873089 updated for version 7.0225 2006-03-15 22:53:57 +00:00
Bram Moolenaar
c4675a193d updated for version 7.0225 2006-03-15 22:50:30 +00:00
Bram Moolenaar
db00351723 updated for version 7.0225 2006-03-15 22:48:35 +00:00
Bram Moolenaar
114216c417 updated for version 7.0224 2006-03-14 23:08:30 +00:00
Bram Moolenaar
34e9e2f13d updated for version 7.0224 2006-03-14 23:07:19 +00:00
Bram Moolenaar
a9a568ca77 updated for version 7.0224 2006-03-14 23:04:27 +00:00
Bram Moolenaar
2092d32231 updated for version 7.0224 2006-03-14 23:02:02 +00:00
Bram Moolenaar
1f4d4de1ba updated for version 7.0224 2006-03-14 23:00:46 +00:00
Bram Moolenaar
3b1ddfed51 updated for version 7.0224 2006-03-14 22:55:34 +00:00
Bram Moolenaar
c7d893589e updated for version 7.0224 2006-03-14 22:53:34 +00:00
Bram Moolenaar
af48b0924f updated for version 7.0224 2006-03-14 22:51:38 +00:00
Bram Moolenaar
0ce29937aa updated for version 7.0223 2006-03-13 22:18:45 +00:00
Bram Moolenaar
1e60789f9b updated for version 7.0223 2006-03-13 22:15:53 +00:00
Bram Moolenaar
019ff6825b updated for version 7.0223 2006-03-13 22:10:45 +00:00
Bram Moolenaar
346d743df2 updated for version 7.0223 2006-03-13 22:08:57 +00:00
Bram Moolenaar
35a2e197cf updated for version 7.0223 2006-03-13 22:07:11 +00:00
Bram Moolenaar
3c56a964af updated for version 7.0222 2006-03-12 22:19:04 +00:00
Bram Moolenaar
a1956f6b07 updated for version 7.0222 2006-03-12 22:18:00 +00:00
Bram Moolenaar
17be7e614e updated for version 7.0222 2006-03-12 22:13:45 +00:00
Bram Moolenaar
5316eee835 updated for version 7.0222 2006-03-12 22:11:10 +00:00
Bram Moolenaar
1c8f93ff02 updated for version 7.0222 2006-03-12 22:10:07 +00:00
Bram Moolenaar
b9a02fc557 updated for version 7.0222 2006-03-12 22:08:12 +00:00
Bram Moolenaar
600dddcf66 updated for version 7.0222 2006-03-12 22:05:10 +00:00
Bram Moolenaar
1fc0046932 updated for version 7.0222 2006-03-12 22:00:48 +00:00
Bram Moolenaar
c4956c8d1d updated for version 7.0222 2006-03-12 21:58:43 +00:00
Bram Moolenaar
2b48ad5cd7 updated for version 7.0222 2006-03-12 21:56:11 +00:00
Bram Moolenaar
5baddf0285 updated for version 7.0222 2006-03-12 21:53:56 +00:00
Bram Moolenaar
60f8377e42 updated for version 7.0222 2006-03-12 21:52:47 +00:00
Bram Moolenaar
f71a3db47e updated for version 7.0222 2006-03-12 21:50:18 +00:00
Bram Moolenaar
e48ec1fa6b updated for version 7.0221 2006-03-11 21:38:31 +00:00
Bram Moolenaar
a5b6ad13ef updated for version 7.0221 2006-03-11 21:36:59 +00:00
Bram Moolenaar
eb94e559e0 updated for version 7.0221 2006-03-11 21:35:11 +00:00
Bram Moolenaar
038221bcd0 updated for version 7.0221 2006-03-11 21:32:59 +00:00
Bram Moolenaar
d289f1315f updated for version 7.0221 2006-03-11 21:30:53 +00:00
Bram Moolenaar
c270d806f8 updated for version 7.0221 2006-03-11 21:29:41 +00:00
Bram Moolenaar
96d2c5b5be updated for version 7.0221 2006-03-11 21:27:59 +00:00
Bram Moolenaar
838bb71992 updated for version 7.0221 2006-03-11 21:24:08 +00:00
Bram Moolenaar
0b598c2fda updated for version 7.0221 2006-03-11 21:22:53 +00:00
Bram Moolenaar
d996771378 updated for version 7.0221 2006-03-11 21:18:15 +00:00
Bram Moolenaar
8ee8926785 updated for version 7.0221 2006-03-11 21:16:47 +00:00
Bram Moolenaar
ade0083d3a updated for version 7.0220 2006-03-10 21:46:58 +00:00
Bram Moolenaar
a94bc430e8 updated for version 7.0220 2006-03-10 21:42:59 +00:00
Bram Moolenaar
5c4bab0fe7 updated for version 7.0220 2006-03-10 21:37:46 +00:00
Bram Moolenaar
eca1575717 updated for version 7.0220 2006-03-10 21:35:45 +00:00
Bram Moolenaar
4e42719355 updated for version 7.0220 2006-03-10 21:34:27 +00:00
Bram Moolenaar
1056d98844 updated for version 7.0219 2006-03-09 22:37:52 +00:00
Bram Moolenaar
4ea8fe1d06 updated for version 7.0219 2006-03-09 22:32:39 +00:00
Bram Moolenaar
0fd9289de3 updated for version 7.0219 2006-03-09 22:27:48 +00:00
Bram Moolenaar
a3227e2b15 updated for version 7.0218 2006-03-08 21:32:40 +00:00
Bram Moolenaar
1f35bf9cab updated for version 7.0217 2006-03-07 22:38:47 +00:00
Bram Moolenaar
a203182302 updated for version 7.0217 2006-03-07 22:29:51 +00:00
Bram Moolenaar
362e1a30c6 updated for version 7.0216 2006-03-06 23:29:24 +00:00
Bram Moolenaar
768b8c4dbc updated for version 7.0214 2006-03-04 21:58:33 +00:00
Bram Moolenaar
87b5ca5172 updated for version 7.0214 2006-03-04 21:55:31 +00:00
Bram Moolenaar
36fc535cb1 updated for version 7.0214 2006-03-04 21:49:37 +00:00
Bram Moolenaar
d0131a8bd2 updated for version 7.0214 2006-03-04 21:46:13 +00:00
Bram Moolenaar
0e34f6269e updated for version 7.0213 2006-03-03 23:00:03 +00:00
Bram Moolenaar
3517bb1ece updated for version 7.0213 2006-03-03 22:58:45 +00:00
Bram Moolenaar
65c923adf3 updated for version 7.0213 2006-03-03 22:56:30 +00:00
Bram Moolenaar
bfb2d40b6e updated for version 7.0213 2006-03-03 22:50:42 +00:00
Bram Moolenaar
a55252087b updated for version 7.0212 2006-03-02 22:52:09 +00:00
Bram Moolenaar
8fd89f0fe7 updated for version 7.0212 2006-03-02 22:51:05 +00:00
Bram Moolenaar
0b23879827 updated for version 7.0212 2006-03-02 22:49:12 +00:00
Bram Moolenaar
c06ac34092 updated for version 7.0212 2006-03-02 22:43:39 +00:00
Bram Moolenaar
b475fb917b updated for version 7.0212 2006-03-02 22:40:52 +00:00
Bram Moolenaar
261bfeab3e updated for version 7.0211 2006-03-01 22:12:31 +00:00
Bram Moolenaar
fd2ac767eb updated for version 7.0211 2006-03-01 22:09:21 +00:00
Bram Moolenaar
e1438bb8d0 updated for version 7.0211 2006-03-01 22:01:55 +00:00
Bram Moolenaar
e224ffa156 updated for version 7.0210 2006-03-01 00:01:28 +00:00
Bram Moolenaar
03f4855fc2 updated for version 7.0210 2006-02-28 23:52:23 +00:00
Bram Moolenaar
b388adb188 updated for version 7.0210 2006-02-28 23:50:17 +00:00
Bram Moolenaar
5e3cb7e869 updated for version 7.0209 2006-02-27 23:58:35 +00:00
Bram Moolenaar
eddf53b02e updated for version 7.0208 2006-02-27 00:11:10 +00:00
Bram Moolenaar
a23ccb8ac6 updated for version 7.0208 2006-02-27 00:08:02 +00:00
Bram Moolenaar
1cad292503 updated for version 7.0208 2006-02-27 00:00:52 +00:00
Bram Moolenaar
a226a6dd9f updated for version 7.0208 2006-02-26 23:59:20 +00:00
Bram Moolenaar
a562149de3 updated for version 7.0207 2006-02-25 21:55:24 +00:00
Bram Moolenaar
5c8837f9d7 updated for version 7.0207 2006-02-25 21:52:33 +00:00
Bram Moolenaar
c542aef58d updated for version 7.0207 2006-02-25 21:47:41 +00:00
Bram Moolenaar
ba6c05240f updated for version 7.0207 2006-02-25 21:45:02 +00:00
Bram Moolenaar
32466aa2e9 updated for version 7.0206 2006-02-24 23:53:04 +00:00
Bram Moolenaar
2a3f7eeebf updated for version 7.0205 2006-02-23 21:34:44 +00:00
Bram Moolenaar
df1bdc92c2 updated for version 7.0205 2006-02-23 21:32:16 +00:00
Bram Moolenaar
80a94a582c updated for version 7.0205 2006-02-23 21:26:58 +00:00
Bram Moolenaar
d1f56e68f1 updated for version 7.0204 2006-02-22 21:25:37 +00:00
Bram Moolenaar
238a564935 updated for version 7.0203 2006-02-21 22:12:05 +00:00
Bram Moolenaar
8f7fd65b24 updated for version 7.0203 2006-02-21 22:04:51 +00:00
Bram Moolenaar
030f0dfad5 updated for version 7.0203 2006-02-21 22:02:53 +00:00
Bram Moolenaar
faa959a870 updated for version 7.0202 2006-02-20 21:37:40 +00:00
Bram Moolenaar
70836c8ba8 updated for version 7.0202 2006-02-20 21:28:49 +00:00
Bram Moolenaar
2a0449d129 updated for version 7.0202 2006-02-20 21:27:21 +00:00
Bram Moolenaar
7e8fd63682 updated for version 7.0201 2006-02-18 22:14:51 +00:00
Bram Moolenaar
997fb4ba69 updated for version 7.0200 2006-02-17 21:53:23 +00:00
Bram Moolenaar
49d7bf13e0 updated for version 7.0200 2006-02-17 21:45:41 +00:00
Bram Moolenaar
f740b29ae2 updated for version 7.0199 2006-02-16 22:11:02 +00:00
Bram Moolenaar
4c7ed462cb updated for version 7.0198 2006-02-15 22:18:42 +00:00
Bram Moolenaar
e45828b593 updated for version 7.0198 2006-02-15 22:12:56 +00:00
Bram Moolenaar
98ea5defcf updated for version 7.0198 2006-02-15 22:11:25 +00:00
Bram Moolenaar
1d2ba7fa85 updated for version 7.0197 2006-02-14 22:29:30 +00:00
Bram Moolenaar
f52c725c47 updated for version 7.0196 2006-02-10 23:23:57 +00:00
Bram Moolenaar
c7453f52d4 updated for version 7.0196 2006-02-10 23:20:28 +00:00
Bram Moolenaar
110bc6bc91 updated for version 7.0196 2006-02-10 23:13:40 +00:00
Bram Moolenaar
06b5db9397 updated for version 7.0196 2006-02-10 23:11:56 +00:00
Bram Moolenaar
3d0a603fa9 updated for version 7.0195 2006-02-09 23:54:54 +00:00
Bram Moolenaar
754b56089f updated for version 7.0195 2006-02-09 23:53:20 +00:00
Bram Moolenaar
cf0c554e3f updated for version 7.0195 2006-02-09 23:48:02 +00:00
Bram Moolenaar
8b6144bdfe updated for version 7.0194 2006-02-08 09:20:24 +00:00
Bram Moolenaar
9f2c6e1deb updated for version 7.0193 2006-02-04 22:45:44 +00:00
Bram Moolenaar
a65576059f updated for version 7.0193 2006-02-04 22:43:20 +00:00
Bram Moolenaar
41cabdadc2 updated for version 7.0193 2006-02-04 22:38:56 +00:00
Bram Moolenaar
a37420f46f updated for version 7.0193 2006-02-04 22:37:47 +00:00
Bram Moolenaar
0e5bd96f84 updated for version 7.0192 2006-02-04 00:59:56 +00:00
Bram Moolenaar
986920760e updated for version 7.0192 2006-02-04 00:57:42 +00:00
Bram Moolenaar
49315f65c9 updated for version 7.0192 2006-02-04 00:54:59 +00:00
Bram Moolenaar
1ef15e30a0 updated for version 7.0191 2006-02-01 21:56:25 +00:00
Bram Moolenaar
afeb4fa8a7 updated for version 7.0191 2006-02-01 21:51:12 +00:00
Bram Moolenaar
b8a7b560b1 updated for version 7.0191 2006-02-01 21:47:16 +00:00
Bram Moolenaar
280f126ef0 updated for version 7.0189 2006-01-30 00:14:18 +00:00
Bram Moolenaar
17c7c01170 updated for version 7.0188 2006-01-26 22:25:15 +00:00
Bram Moolenaar
51156d5a87 updated for version 7.0188 2006-01-26 22:17:47 +00:00
Bram Moolenaar
6ab5b84db4 updated for version 7.0188 2006-01-26 22:16:34 +00:00
Bram Moolenaar
d12f5c17be updated for version 7.0187 2006-01-25 22:10:52 +00:00
Bram Moolenaar
28c258fd24 updated for version 7.0187 2006-01-25 22:02:51 +00:00
Bram Moolenaar
7df351eb8a updated for version 7.0186 2006-01-23 22:30:28 +00:00
Bram Moolenaar
09df3127f4 updated for version 7.0186 2006-01-23 22:23:09 +00:00
Bram Moolenaar
33aec765bd updated for version 7.0185 2006-01-22 23:30:12 +00:00
Bram Moolenaar
71fe80dddd updated for version 7.0185 2006-01-22 23:25:56 +00:00
Bram Moolenaar
66fa271a25 updated for version 7.0185 2006-01-22 23:22:22 +00:00
Bram Moolenaar
0ac9379acf updated for version 7.0184 2006-01-21 22:16:51 +00:00
Bram Moolenaar
c716c306e9 updated for version 7.0184 2006-01-21 22:12:51 +00:00
Bram Moolenaar
b1b715d1fb updated for version 7.0184 2006-01-21 22:09:43 +00:00
Bram Moolenaar
b71eaaeaa8 updated for version 7.0183 2006-01-20 23:10:18 +00:00
Bram Moolenaar
2d3f489e09 updated for version 7.0183 2006-01-20 23:02:51 +00:00
Bram Moolenaar
8ada17c4d9 updated for version 7.0182 2006-01-19 22:16:24 +00:00
Bram Moolenaar
05a7bb363b updated for version 7.0182 2006-01-19 22:09:32 +00:00
Bram Moolenaar
c32840f267 updated for version 7.0181 2006-01-14 21:23:38 +00:00
Bram Moolenaar
04dbce064e updated for version 7.0181 2006-01-14 21:20:41 +00:00
Bram Moolenaar
316059c019 updated for version 7.0181 2006-01-14 21:18:42 +00:00
Bram Moolenaar
ea8bd73212 updated for version 7.0181 2006-01-14 21:15:59 +00:00
Bram Moolenaar
a40ceaf88a updated for version 7.0180 2006-01-13 22:35:40 +00:00
Bram Moolenaar
4770d09abd updated for version 7.0179 2006-01-12 23:22:24 +00:00
Bram Moolenaar
1cbe5f739d updated for version 7.0178 2005-12-29 22:51:09 +00:00
Bram Moolenaar
c7486e034e updated for version 7.0178 2005-12-29 22:48:26 +00:00
Bram Moolenaar
86e01085a1 updated for version 7.0178 2005-12-29 22:45:34 +00:00
Bram Moolenaar
371baa928d updated for version 7.0178 2005-12-29 22:43:53 +00:00
Bram Moolenaar
ebefac63f3 updated for version 7.0177 2005-12-28 22:39:57 +00:00
Bram Moolenaar
cc984263d7 updated for version 7.0176 2005-12-23 22:19:46 +00:00
Bram Moolenaar
0ce33f34a4 updated for version 7.0176 2005-12-23 22:16:03 +00:00
Bram Moolenaar
8fa0445c4f updated for version 7.0176 2005-12-23 22:13:51 +00:00
Bram Moolenaar
5c2f050d91 updated for version 7.0176 2005-12-23 22:11:04 +00:00
Bram Moolenaar
f4cd3e8074 updated for version 7.0175 2005-12-22 22:47:02 +00:00
Bram Moolenaar
bb1004ee56 updated for version 7.0174 2005-12-19 22:15:59 +00:00
Bram Moolenaar
a9b1e74b5d updated for version 7.0174 2005-12-19 22:14:58 +00:00
Bram Moolenaar
195d6357b4 updated for version 7.0174 2005-12-19 22:08:24 +00:00
Bram Moolenaar
46b8015066 updated for version 7.0174 2005-12-19 22:06:56 +00:00
Bram Moolenaar
e3226be91a updated for version 7.0173 2005-12-18 22:10:00 +00:00
Bram Moolenaar
d35f9711d4 updated for version 7.0173 2005-12-18 22:02:33 +00:00
Bram Moolenaar
da1b1a7357 updated for version 7.0173 2005-12-18 21:59:16 +00:00
Bram Moolenaar
3b18181f28 updated for version 7.0172 2005-12-17 22:10:02 +00:00
Bram Moolenaar
acf534595b updated for version 7.0172 2005-12-17 22:06:52 +00:00
Bram Moolenaar
97d29a1ace updated for version 7.0172 2005-12-17 22:02:57 +00:00
Bram Moolenaar
146522e760 updated for version 7.0171 2005-12-16 21:55:46 +00:00
Bram Moolenaar
83c465c705 updated for version 7.0171 2005-12-16 21:53:56 +00:00
Bram Moolenaar
12033fb4bf updated for version 7.0171 2005-12-16 21:49:31 +00:00
Bram Moolenaar
bca84a12bd updated for version 7.0170 2005-12-14 22:08:35 +00:00
Bram Moolenaar
38f1825274 updated for version 7.0170 2005-12-14 22:04:43 +00:00
Bram Moolenaar
61da4986dd updated for version 7.0170 2005-12-14 22:02:18 +00:00
Bram Moolenaar
6496966ad1 updated for version 7.0170 2005-12-14 21:59:55 +00:00
Bram Moolenaar
b2c2efa53a updated for version 7.0169 2005-12-13 20:09:08 +00:00
Bram Moolenaar
c6d8db78b1 updated for version 7.0169 2005-12-13 20:04:55 +00:00
Bram Moolenaar
b0bf8580c3 updated for version 7.0169 2005-12-13 20:02:15 +00:00
Bram Moolenaar
900b4d77f0 updated for version 7.0168 2005-12-12 22:05:50 +00:00
Bram Moolenaar
2c7a29c7fd updated for version 7.0168 2005-12-12 22:02:31 +00:00
Bram Moolenaar
5b962cf71c updated for version 7.0168 2005-12-12 21:58:40 +00:00
339 changed files with 47207 additions and 13182 deletions

View File

@@ -77,6 +77,7 @@ SRC_ALL = \
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 \
@@ -247,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 \
@@ -284,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 \
@@ -495,6 +498,7 @@ RT_SCRIPTS = \
runtime/filetype.vim \
runtime/scripts.vim \
runtime/menu.vim \
runtime/macmap.vim \
runtime/delmenu.vim \
runtime/synmenu.vim \
runtime/makemenu.vim \
@@ -674,6 +678,7 @@ LANG_GEN = \
runtime/spell/??/main.aap \
runtime/spell/yi/README.txt \
runtime/spell/main.aap \
runtime/spell/cleanadd.vim \
runtime/spell/*.vim \
runtime/spell/fixdup \
@@ -683,6 +688,9 @@ LANG_GEN_BIN = \
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 = \

View File

@@ -128,21 +128,24 @@ MINOR = 0aa
# - 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 ObjC/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 ObjC/gvim.pdb to "gvim_ole.pdb".
# - Delete install.exe and uninstall.exe.
# - If building the Win32s version delete vimrun.exe.
# Win32s GUI version:
@@ -430,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)
@@ -446,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)
@@ -500,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)

View File

@@ -4,12 +4,18 @@ 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
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
Occult completion files:
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)

View File

@@ -1,13 +1,13 @@
" Vim completion script
" Language: C
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Oct 06
" Last Change: 2006 Mar 19
" This function is used for the 'omnifunc' option.
function! ccomplete#Complete(findstart, base)
if a:findstart
" Locate the start of the item, including "." and "->".
" Locate the start of the item, including ".", "->" and "[...]".
let line = getline('.')
let start = col('.') - 1
let lastword = -1
@@ -24,6 +24,21 @@ function! ccomplete#Complete(findstart, base)
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
@@ -43,20 +58,56 @@ function! ccomplete#Complete(findstart, base)
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.
let items = split(base, '\.\|->', 1)
if len(items) <= 1
" Don't do anything for an empty base, would result in all the tags in the
" tags file.
if base == ''
return []
" 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
" Only one part, no "." or "->": complete from tags file.
" When local completion is wanted CTRL-N would have been used.
return map(taglist('^' . base), 'v:val["name"]')
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")
@@ -68,18 +119,56 @@ function! ccomplete#Complete(findstart, base)
" TODO: join previous line if it makes sense
let line = getline('.')
let col = col('.')
let res = s:Nextitem(strpart(line, 0, col), items[1:])
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 "typename" field.
if has_key(diclist[i], 'typename')
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:]))
call extend(res, s:StructMembers(diclist[i]['typename'], items[1:], 1))
endif
" For a variable use the command, which must be a search pattern that
@@ -87,8 +176,8 @@ function! ccomplete#Complete(findstart, base)
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:]))
let col = match(line, '\<' . items[0] . '\>')
call extend(res, s:Nextitem(strpart(line, 2, col - 2), items[1:], 0, 1))
endif
endif
endfor
@@ -99,27 +188,137 @@ function! ccomplete#Complete(findstart, base)
" TODO: join previous line if it makes sense
let line = getline('.')
let col = col('.')
let res = s:Nextitem(strpart(line, 0, col), items[1:])
let res = s:Nextitem(strpart(line, 0, col), items[1:], 0, 1)
endif
" If the one and only match was what's already there and it is a composite
" type, add a "." or "->".
if len(res) == 1 && res[0]['match'] == items[-1] && len(s:SearchMembers(res, [''])) > 0
" 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(res[0]['tagline'], '\*\s*' . res[0]['match']) > 0
let res[0]['match'] .= '->'
if match(a:line, '\*[ \t(]*' . a:match . '\>') > 0
return '->'
else
let res[0]['match'] .= '.'
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'])
" Use the whole search command as the "info" entry.
let s = matchstr(a:val['cmd'], '/^\s*\zs.*\ze$/')
if s != ''
let res['info'] = substitute(s, '\\\(.\)', '\1', 'g')
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 map(res, 'v:val["match"]')
endfunc
return res
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
" Use the whole search command as the "info" entry.
let s = matchstr(line, '\t/^\s*\zs.*\ze$/')
if s != ''
let res['info'] = substitute(s, '\\\(.\)', '\1', 'g')
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)
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\+\|\<')
@@ -128,34 +327,46 @@ function! s:Nextitem(lead, items)
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)
let res = s:StructMembers(tokens[tidx] . ':' . tokens[tidx + 1], a:items, a:all)
break
endif
" TODO: add more reserved words
if index(['int', 'float', 'static', 'unsigned', 'extern'], tokens[tidx]) >= 0
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 "typename" field.
if has_key(diclist[tagidx], 'typename')
call extend(res, s:StructMembers(diclist[tagidx]['typename'], a:items))
if has_key(item, 'typename')
call extend(res, s:StructMembers(item['typename'], a:items, a:all))
continue
endif
" Only handle typedefs here.
if diclist[tagidx]['kind'] != 't'
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 = diclist[tagidx]['cmd']
let cmd = item['cmd']
let ei = matchend(cmd, 'typedef\s\+')
if ei > 1
let cmdtokens = split(strpart(cmd, ei), '\s\+\|\<')
@@ -170,11 +381,11 @@ function! s:Nextitem(lead, items)
endif
endfor
if name != ''
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items))
call extend(res, s:StructMembers(cmdtokens[0] . ':' . name, a:items, a:all))
endif
else
elseif a:depth < 10
" Could be "typedef other_T some_T".
call extend(res, s:Nextitem(cmdtokens[0], a:items))
call extend(res, s:Nextitem(cmdtokens[0], a:items, a:depth + 1, a:all))
endif
endif
endif
@@ -188,9 +399,12 @@ function! s:Nextitem(lead, items)
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.
function! s:StructMembers(typename, items)
" 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 == ''
@@ -199,33 +413,73 @@ function! s:StructMembers(typename, items)
let typename = a:typename
let qflist = []
while 1
exe 'silent! vimgrep /\t' . typename . '\(\t\|$\)/j ' . fnames
let qflist = getqflist()
if len(qflist) > 0 || match(typename, "::") < 0
break
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
" No match for "struct:context::name", remove "context::" and try again.
let typename = substitute(typename, ':[^:]*::', ':', '')
endwhile
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]
call add(matches, {'match': memb, 'tagline': l['text']})
" 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
" No further items, return the result.
if len(a:items) == 1
return matches
endif
" 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[1:])
return s:SearchMembers(matches, a:items[idx :], a:all)
endif
" Failed to find anything.
@@ -233,25 +487,41 @@ function! s:StructMembers(typename, items)
endfunction
" For matching members, find matches for following items.
function! s:SearchMembers(matches, 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 line = a:matches[i]['tagline']
let e = matchend(line, '\ttypename:')
if e > 0
" Use typename field
let name = matchstr(line, '[^\t]*', e)
call extend(res, s:StructMembers(name, a:items))
let typename = ''
if has_key(a:matches[i], 'dict')
if has_key(a:matches[i].dict, 'typename')
let typename = a:matches[i].dict['typename']
endif
let line = "\t" . a:matches[i].dict['cmd']
else
let line = a:matches[i]['tagline']
let e = matchend(line, '\ttypename:')
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)
let e = match(line, '\<' . a:matches[i]['match'] . '\>', s)
if e > 0
call extend(res, s:Nextitem(strpart(line, s, e - s), a:items))
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

File diff suppressed because it is too large Load Diff

View 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:

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,8 @@
" netrwFileHandlers: contains various extension-based file handlers for
" netrw's browsers' x command ("eXecute launcher")
" Author: Charles E. Campbell, Jr.
" Date: Oct 12, 2005
" Version: 7
" Date: Feb 15, 2006
" Version: 8a ASTRO-ONLY
" 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
@@ -22,22 +22,27 @@ if exists("g:loaded_netrwFileHandlers") || &cp
endif
let s:keepcpo= &cpo
set cpo&vim
let g:loaded_netrwFileHandlers= "v7"
let g:loaded_netrwFileHandlers= "v8a"
" ---------------------------------------------------------------------
" netrwFileHandlers#Init: {{{1
" This functions is here to allow a call to this function to autoload
" the netrwFileHandlers.vim file
fun! netrwFileHandlers#Init()
" call Dfunc("netrwFileHandlers#Init()")
" call Dret("netrwFileHandlers#Init")
" 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
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_html: handles html when the user hits "x" when the {{{1
" s:NFH_html: handles html when the user hits "x" when the {{{1
" cursor is atop a *.html file
fun! netrwFileHandlers#NFH_html(pagefile)
" call Dfunc("netrwFileHandlers#NFH_html(".a:pagefile.")")
fun! s:NFH_html(pagefile)
" call Dfunc("s:NFH_html(".a:pagefile.")")
let page= substitute(a:pagefile,'^','file://','')
@@ -48,19 +53,19 @@ fun! netrwFileHandlers#NFH_html(pagefile)
" call Decho("executing !netscape ".page)
exe "!netscape \"".page.'"'
else
" call Dret("netrwFileHandlers#NFH_html 0")
" call Dret("s:NFH_html 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_html 1")
" call Dret("s:NFH_html 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_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! netrwFileHandlers#NFH_htm(pagefile)
" call Dfunc("netrwFileHandlers#NFH_htm(".a:pagefile.")")
fun! s:NFH_htm(pagefile)
" call Dfunc("s:NFH_htm(".a:pagefile.")")
let page= substitute(a:pagefile,'^','file://','')
@@ -71,18 +76,18 @@ fun! netrwFileHandlers#NFH_htm(pagefile)
" call Decho("executing !netscape ".page)
exe "!netscape \"".page.'"'
else
" call Dret("netrwFileHandlers#NFH_htm 0")
" call Dret("s:NFH_htm 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_htm 1")
" call Dret("s:NFH_htm 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_jpg: {{{1
fun! netrwFileHandlers#NFH_jpg(jpgfile)
" call Dfunc("netrwFileHandlers#NFH_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
@@ -90,181 +95,181 @@ fun! netrwFileHandlers#NFH_jpg(jpgfile)
" call Decho("silent! !".expand("$SystemRoot")."/SYSTEM32/MSPAINT ".escape(a:jpgfile," []|'"))
exe "!".expand("$SystemRoot")."/SYSTEM32/MSPAINT \"".a:jpgfile.'"'
else
" call Dret("netrwFileHandlers#NFH_jpg 0")
" call Dret("s:NFH_jpg 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_jpg 1")
" call Dret("s:NFH_jpg 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_gif: {{{1
fun! netrwFileHandlers#NFH_gif(giffile)
" call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_gif 0")
" call Dret("s:NFH_gif 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_gif 1")
" call Dret("s:NFH_gif 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_png: {{{1
fun! netrwFileHandlers#NFH_png(pngfile)
" call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_png 0")
" call Dret("s:NFH_png 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_png 1")
" call Dret("s:NFH_png 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_pnm: {{{1
fun! netrwFileHandlers#NFH_pnm(pnmfile)
" call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_pnm 0")
" call Dret("s:NFH_pnm 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_pnm 1")
" call Dret("s:NFH_pnm 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_bmp: visualize bmp files {{{1
fun! netrwFileHandlers#NFH_bmp(bmpfile)
" call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_bmp 0")
" call Dret("s:NFH_bmp 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_bmp 1")
" call Dret("s:NFH_bmp 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_pdf: visualize pdf files {{{1
fun! netrwFileHandlers#NFH_pdf(pdf)
" " call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_pdf 0")
" call Dret("s:NFH_pdf 0")
return 0
endif
" " call Dret("netrwFileHandlers#NFH_pdf 1")
" call Dret("s:NFH_pdf 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_doc: visualize doc files {{{1
fun! netrwFileHandlers#NFH_doc(doc)
" " call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_doc 0")
" call Dret("s:NFH_doc 0")
return 0
endif
" " call Dret("netrwFileHandlers#NFH_doc 1")
" call Dret("s:NFH_doc 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_sxw: visualize sxw files {{{1
fun! netrwFileHandlers#NFH_sxw(sxw)
" " call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_sxw 0")
" call Dret("s:NFH_sxw 0")
return 0
endif
" " call Dret("netrwFileHandlers#NFH_sxw 1")
" call Dret("s:NFH_sxw 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_xls: visualize xls files {{{1
fun! netrwFileHandlers#NFH_xls(xls)
" " call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_xls 0")
" call Dret("s:NFH_xls 0")
return 0
endif
" " call Dret("netrwFileHandlers#NFH_xls 1")
" call Dret("s:NFH_xls 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_ps: handles PostScript files {{{1
fun! netrwFileHandlers#NFH_ps(ps)
" call Dfunc("netrwFileHandlers#NFH_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("netrwFileHandlers#NFH_ps 0")
" call Dret("s:NFH_ps 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_ps 1")
" call Dret("s:NFH_ps 1")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_eps: handles encapsulated PostScript files {{{1
fun! netrwFileHandlers#NFH_eps(eps)
" call Dfunc("netrwFileHandlers#NFH_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!
@@ -278,40 +283,42 @@ fun! netrwFileHandlers#NFH_eps(eps)
exe "silent! !gswin32 \"".a:eps.'"'
redraw!
else
" call Dret("netrwFileHandlers#NFH_ps 0")
" call Dret("s:NFH_eps 0")
return 0
endif
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_fig: handles xfig files {{{1
fun! netrwFileHandlers#NFH_fig(fig)
" call Dfunc("netrwFileHandlers#NFH_fig()")
if executable("xfig")
exe "silent! !xfig ".a:fig
redraw!
else
" call Dret("netrwFileHandlers#NFH_fig 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_fig 1")
" call Dret("s:NFH_eps 0")
return 1
endfun
" ---------------------------------------------------------------------
" netrwFileHandlers#NFH_obj: handles tgif's obj files {{{1
fun! netrwFileHandlers#NFH_obj(obj)
" call Dfunc("netrwFileHandlers#NFH_obj()")
" 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("s:NFH_fig 0")
return 0
endif
" call Dret("s:NFH_fig 1")
return 1
endfun
" ---------------------------------------------------------------------
" 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("netrwFileHandlers#NFH_obj 0")
" call Dret("s:NFH_obj 0")
return 0
endif
" call Dret("netrwFileHandlers#NFH_obj 1")
" call Dret("s:NFH_obj 1")
return 1
endfun

View File

@@ -1,7 +1,7 @@
" netrwSettings.vim: makes netrw settings simpler
" Date: Oct 12, 2005
" Date: Jan 26, 2006
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" Version: 4
" Version: 6a ASTRO-ONLY
" 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
@@ -19,7 +19,7 @@
if exists("g:loaded_netrwSettings") || &cp
finish
endif
let g:loaded_netrwSettings = "v4"
let g:loaded_netrwSettings = "v6a"
" ---------------------------------------------------------------------
" NetrwSettings: {{{1
@@ -56,10 +56,10 @@ fun! netrwSettings#NetrwSettings()
let g:netrw_ignorenetrc= 0
endif
put ='+ ---------------------------------------------'
put ='+ NetrwSettings: (by Charles E. Campbell, Jr.)'
put ='+ --------------------------------------------'
put ='+ NetrwSettings: by Charles E. Campbell, Jr.'
put ='+ Press ? with cursor atop any line for help '
put ='+ ---------------------------------------------'
put ='+ --------------------------------------------'
let s:netrw_settings_stop= line(".")
put =''
@@ -89,7 +89,14 @@ fun! netrwSettings#NetrwSettings()
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

View 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

File diff suppressed because it is too large Load Diff

View 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:

View 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

View 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

View File

@@ -1,7 +1,7 @@
" tar.vim: Handles browsing tarfiles
" AUTOLOAD PORTION
" Date: Nov 28, 2005
" Version: 5
" Date: Dec 24, 2005
" Version: 7
" Maintainer: Charles E Campbell, Jr <drchipNOSPAM at campbellfamily dot biz>
" License: Vim License (see vim's :help license)
"
@@ -24,7 +24,7 @@ set cpo&vim
if exists("g:loaded_tar")
finish
endif
let g:loaded_tar= "v5"
let g:loaded_tar= "v7"
" ---------------------------------------------------------------------
" Default Settings: {{{1
@@ -93,7 +93,7 @@ fun! tar#Browse(tarfile)
else
exe "silent r! tar -".g:tar_browseoptions." '".a:tarfile."'"
endif
%g@/$@d
silent %g@/$@d
setlocal noma nomod ro
noremap <silent> <buffer> <cr> :call <SID>TarBrowseSelect()<cr>
@@ -146,7 +146,7 @@ fun! tar#Read(fname,mode)
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 a:fname =~# '\.bz2$'
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
@@ -242,16 +242,20 @@ fun! tar#Write(fname)
" call Decho("tarfile<".tarfile."> fname<".fname.">")
let dirpath = substitute(fname,'/[^/]\+$','','e')
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.">")
call mkdir(dirpath,"p")
exe "w! ".fname
if executable("cygpath")
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
let tarfile = substitute(system("cygpath ".tarfile),'\n','','e')
endif

View File

@@ -1,7 +1,7 @@
" Vim completion script
" Language: XHTML 1.0 Strict
" Language: XML
" Maintainer: Mikolaj Machowski ( mikmach AT wp DOT pl )
" Last Change: 2005 Nov 22
" 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,
@@ -54,6 +54,7 @@ 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
@@ -69,11 +70,33 @@ function! xmlcomplete#CompleteTags(findstart, base)
endif
let b:compl_context = getline('.')[0:(compl_begin)]
let b:compl_context = matchstr(b:compl_context, '.*<\zs.*')
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, '^\k*\ze:')
let b:xml_namespace = matchstr(b:compl_context, '^<\zs\k*\ze:')
if b:xml_namespace == ''
let b:xml_namespace = 'DEFAULT'
endif
@@ -89,7 +112,10 @@ function! xmlcomplete#CompleteTags(findstart, base)
let res = []
let res2 = []
" a:base is very short - we need context
let context = b:compl_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
@@ -111,13 +137,24 @@ function! xmlcomplete#CompleteTags(findstart, base)
let values = intent + values
endif
for m in values
if m =~ '^'.a:base
call add(res, m.';')
endif
endfor
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
return res + res2
endif
endif
if context =~ '>'
@@ -194,25 +231,42 @@ function! xmlcomplete#CompleteTags(findstart, base)
for m in sort(attrs)
if m =~ '^'.attr
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
call add(res, m)
elseif m =~ '='
call add(res, m)
else
call add(res, m.'="')
endif
call add(res, m)
elseif m =~ attr
if tag !~ '^[?!]' && len(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m]) > 0 && g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[tag][1][m][0] =~ '^BOOL$'
call add(res, m)
elseif m =~ '='
call add(res, m)
else
call add(res2, m.'="')
endif
call add(res2, m)
endif
endfor
return res + res2
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
@@ -265,25 +319,46 @@ function! xmlcomplete#CompleteTags(findstart, base)
" Deal with tag completion.
let opentag = xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
let opentag = substitute(opentag, '^\k*:', '', '')
let tags = g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]}[opentag][0]
let context = substitute(context, '^\k*:', '', '')
if b:xml_namespace == 'DEFAULT'
let b:xml_namespace = ''
if opentag == ''
"return []
let tags = keys(g:xmldata{'_'.g:xmldata_connection[b:xml_namespace]})
call filter(tags, 'v:val !~ "^vimxml"')
else
let b:xml_namespace .= ':'
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, b:xml_namespace.m)
call add(res, m)
elseif m =~ context
call add(res2, b:xml_namespace.m)
call add(res2, m)
endif
endfor
return res + res2
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
@@ -357,11 +432,11 @@ return ''
endfunction
function! s:InComment()
return synIDattr(synID(line('.'), col('.'), 0), 'name') =~ 'Comment'
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'
return synIDattr(synID(a:line, a:col, 0), 'name') =~ 'Comment\|String'
endfunction
function! s:SetKeywords()

View File

@@ -1,7 +1,7 @@
" zip.vim: Handles browsing zipfiles
" AUTOLOAD PORTION
" Date: Nov 28, 2005
" Version: 5
" Date: Dec 21, 2005
" Version: 6
" 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
@@ -22,7 +22,7 @@ if exists("g:loaded_zip")
finish
endif
let g:loaded_zip= "v5"
let g:loaded_zip= "v6"
" ----------------
" Functions: {{{1
@@ -198,16 +198,21 @@ fun! zip#Write(fname)
let zipfile = substitute(a:fname,'zipfile:\(.\{-}\):.*$','\1','')
let fname = substitute(a:fname,'zipfile:.\{-}:\(.*\)$','\1','')
let dirpath = substitute(fname,'/[^/]\+$','','e')
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.">")
call mkdir(dirpath,"p")
exe "w! ".fname
if executable("cygpath")
let dirpath = substitute(system("cygpath ".dirpath),'\n','','e')
let zipfile = substitute(system("cygpath ".zipfile),'\n','','e')
endif

View File

@@ -71,6 +71,7 @@ DOCS = \
pattern.txt \
pi_gzip.txt \
pi_netrw.txt \
pi_paren.txt \
pi_spec.txt \
pi_tar.txt \
pi_zip.txt \
@@ -88,7 +89,9 @@ DOCS = \
sponsor.txt \
starting.txt \
spell.txt \
sql.txt \
syntax.txt \
tabpage.txt \
tagsrch.txt \
term.txt \
tips.txt \
@@ -158,7 +161,6 @@ HTMLS = \
gui_x11.html \
hangulin.html \
hebrew.html \
help.html \
howto.html \
if_cscop.html \
if_mzsch.html \
@@ -170,6 +172,7 @@ HTMLS = \
if_tcl.html \
indent.html \
index.html \
vimindex.html \
insert.html \
intro.html \
map.html \
@@ -195,6 +198,7 @@ HTMLS = \
pattern.html \
pi_gzip.html \
pi_netrw.html \
pi_paren.html \
pi_spec.html \
print.html \
quickfix.html \
@@ -210,7 +214,9 @@ HTMLS = \
sponsor.html \
starting.html \
spell.html \
sql.html \
syntax.html \
tabpage.html \
tagsrch.html \
tags.html \
term.html \
@@ -321,6 +327,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
@@ -389,6 +403,7 @@ 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 $< >$@

View File

@@ -1,4 +1,4 @@
*autocmd.txt* For Vim version 7.0aa. Last change: 2005 Dec 11
*autocmd.txt* For Vim version 7.0aa. Last change: 2006 Mar 15
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -270,16 +270,28 @@ Name triggered by ~
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
|FuncUndefined| a user function is used but it isn't defined
|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
@@ -330,7 +342,7 @@ BufEnter After entering a buffer. Useful for setting
*BufFilePost*
BufFilePost After changing the name of the current buffer
with the ":file" or ":saveas" command.
*BufReadCmd*
*BufFilePre*
BufFilePre Before changing the name of the current buffer
with the ":file" or ":saveas" command.
*BufHidden*
@@ -368,10 +380,10 @@ BufRead or BufReadPost When starting to edit a new buffer, after
This does NOT work for ":r file". Not used
when the file doesn't exist. Also used after
successfully recovering a file.
*BufReadPre* *E200* *E201*
*BufReadCmd*
BufReadCmd Before starting to edit a new buffer. Should
read the file into the buffer. |Cmd-event|
*BufFilePre*
*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.
@@ -439,6 +451,7 @@ CmdwinLeave Before leaving the command-line window.
|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
@@ -447,6 +460,8 @@ CursorHold When the user doesn't press a key for the time
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).
@@ -457,6 +472,21 @@ CursorHold When the user doesn't press a key for the time
: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.
@@ -509,6 +539,9 @@ FileChangedShell When Vim notices that the modification time of
commands for the FileChangedShell event no
other FileChangedShell event will be
triggered.
*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|.
@@ -617,11 +650,12 @@ MenuPopup Just before showing the popup menu (under the
c Commmand line
*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".
|: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
@@ -641,6 +675,21 @@ RemoteReply When a reply from a Vim that functions as
*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
@@ -678,6 +727,14 @@ Syntax When the 'syntax' option has been set.
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
@@ -712,6 +769,10 @@ VimLeavePre Before exiting Vim, just before writing the
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.

View File

@@ -1,4 +1,4 @@
*change.txt* For Vim version 7.0aa. Last change: 2005 Dec 10
*change.txt* For Vim version 7.0aa. Last change: 2006 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -503,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: >
@@ -726,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.
@@ -763,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 ().
@@ -1166,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
@@ -1191,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}
@@ -1223,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

View File

@@ -1,4 +1,4 @@
*cmdline.txt* For Vim version 7.0aa. Last change: 2005 Nov 21
*cmdline.txt* For Vim version 7.0aa. Last change: 2006 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -153,7 +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)
(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
@@ -170,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}
@@ -197,6 +202,8 @@ CTRL-\ e {expr} *c_CTRL-\_e*
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()
@@ -350,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.
@@ -394,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
@@ -475,6 +486,7 @@ followed by another command:
:global
:help
:helpfind
:lcscope
:make
:normal
:perl
@@ -692,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()|.
@@ -731,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 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
@@ -959,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

View File

@@ -1,4 +1,4 @@
*debug.txt* For Vim version 7.0aa. Last change: 2005 Sep 01
*debug.txt* For Vim version 7.0aa. Last change: 2005 Dec 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -7,6 +7,7 @@
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|
@@ -61,9 +62,9 @@ This includes the WinDbg debugger.
If you have Visual Studio, use that instead of the VC Toolkit
and WinDbg.
(No idea what to do if your binary was built with the Borland or Cygwin
compilers. Sorry.)
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:

View File

@@ -1,4 +1,4 @@
*develop.txt* For Vim version 7.0aa. Last change: 2005 Sep 01
*develop.txt* For Vim version 7.0aa. Last change: 2006 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -149,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.
@@ -187,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
@@ -382,8 +383,8 @@ checking engine in Vim, for various reasons:
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 simplistic hashtable,
for example.
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
@@ -399,14 +400,88 @@ checking engine in Vim, for various reasons:
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*
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

View File

@@ -1,4 +1,4 @@
*diff.txt* For Vim version 7.0aa. Last change: 2005 Sep 21
*diff.txt* For Vim version 7.0aa. 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,
@@ -345,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
@@ -374,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

View File

@@ -1,4 +1,4 @@
*editing.txt* For Vim version 7.0aa. Last change: 2005 Jul 25
*editing.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -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|.
@@ -395,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*
@@ -407,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: >
@@ -416,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
@@ -786,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
@@ -860,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*
@@ -995,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

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
*filetype.txt* For Vim version 7.0aa. Last change: 2005 Sep 16
*filetype.txt* For Vim version 7.0aa. Last change: 2006 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -536,4 +536,10 @@ 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|.
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*gui.txt* For Vim version 7.0aa. Last change: 2005 Aug 07
*gui.txt* For Vim version 7.0aa. 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_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
@@ -498,6 +499,8 @@ 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*
@@ -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
@@ -954,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*

View File

@@ -1,4 +1,4 @@
*help.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
*help.txt* For Vim version 7.0aa. Last change: 2006 Mar 17
VIM - main help file
k
@@ -84,7 +84,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
@@ -122,6 +122,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
@@ -186,9 +187,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*
|cecutil.txt| DrChip's Utilities Jun 11, 2004

View File

@@ -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

View File

@@ -1,4 +1,4 @@
*if_mzsch.txt* For Vim version 7.0aa. Last change: 2005 May 08
*if_mzsch.txt* For Vim version 7.0aa. 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}
@@ -165,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.
@@ -243,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:

View File

@@ -1,4 +1,4 @@
*if_ole.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
*if_ole.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Paul Moore
@@ -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)")

View File

@@ -1,4 +1,4 @@
*if_perl.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*if_perl.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Sven Verdoolaege
@@ -181,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})

View File

@@ -1,4 +1,4 @@
*if_pyth.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*if_pyth.txt* For Vim version 7.0aa. Last change: 2006 Jan 20
VIM REFERENCE MANUAL by Paul Moore
@@ -131,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*

View File

@@ -1,4 +1,4 @@
*if_ruby.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*if_ruby.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Shugo Maeda
@@ -117,6 +117,8 @@ VIM::command({cmd})
VIM::evaluate({expr})
Evaluates {expr} using the vim internal expression evaluator (see
|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*

View File

@@ -1,4 +1,4 @@
*if_tcl.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*if_tcl.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Ingo Wilken
@@ -133,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|.

View File

@@ -1,4 +1,4 @@
*index.txt* For Vim version 7.0aa. Last change: 2005 Dec 11
*index.txt* For Vim version 7.0aa. Last change: 2006 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -541,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
@@ -719,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
@@ -736,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$"
@@ -759,7 +766,7 @@ 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= make spelling suggestions
|z=| z= give spelling suggestions
|zA| zA open a closed fold or close an open fold
recursively
|zC| zC close folds recursively
@@ -1068,7 +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
|:caddfile| :cad[dfile] add error message to current quickfix list
|: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
@@ -1139,6 +1148,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
@@ -1211,23 +1221,57 @@ The commands are sorted on the non-optional part of their name.
|: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
|: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
@@ -1269,7 +1313,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
@@ -1353,7 +1397,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
@@ -1369,15 +1413,22 @@ 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
@@ -1387,11 +1438,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
@@ -1399,6 +1453,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
@@ -1419,6 +1488,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
@@ -1436,15 +1507,15 @@ The commands are sorted on the non-optional part of their name.
|: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
@@ -1464,8 +1535,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:

View File

@@ -1,4 +1,4 @@
*insert.txt* For Vim version 7.0aa. Last change: 2005 Nov 22
*insert.txt* For Vim version 7.0aa. Last change: 2006 Mar 19
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*
@@ -354,7 +359,7 @@ 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-\ 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*
-----------------------------------------------------------------------
@@ -422,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.
@@ -438,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
@@ -622,8 +631,8 @@ CTRL-X CTRL-L Search backwards for a line that starts with the
the cursor. Indent is ignored. The matching line is
inserted in front of the cursor.
The 'complete' option is used to decide which buffers
are searched for a match. Only loaded buffers are
used.
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
replaces the previous matching line.
@@ -871,8 +880,8 @@ CTRL-X CTRL-V Guess what kind of item is in front of the cursor and
User defined completion *compl-function*
Completion is done by a function that can be defined by the user with the
'completefunc' option. See the 'completefunc' help 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
@@ -890,7 +899,7 @@ 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 the 'completefunc' help for how the function is called and an example.
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*
@@ -952,19 +961,178 @@ CTRL-P Find previous match for words that start with the
other contexts unless a double CTRL-X is used.
INSERT COMPLETION POPUP MENU *ins-completion-menu*
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".
- The 'completeopt' option contains "menu" or "menuone".
- The terminal supports at least 8 colors.
- There are at least two matches.
While the menu is displayed these keys have a special meaning:
<CR> and <Enter>: Accept the currently selected match
<Up>: Select the previous match, as if CTRL-P was used
<Down>: Select the next match, as if CTRL-N was used
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>
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|
@@ -972,8 +1140,28 @@ 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>
Filetype-specific remarks for omni completion *compl-omni-filetypes*
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*
@@ -982,7 +1170,9 @@ 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
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: >
@@ -1008,41 +1198,168 @@ When the same structure name appears in multiple places all possible members
are included.
CSS *ft-css-omni*
CSS *ft-css-omni*
Complete properties and their appropriate values according to CSS 2.1
specification.
(X)HTML *ft-html-omni*
*ft-xhtml-omni*
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:
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 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
- 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 "style" attribute or working inside of "style" tag
<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.
- 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.
XML *ft-xml-omni*
JAVASCRIPT *ft-javascript-omni*
Vim 7 provides mechanism to context aware completion of XML files. It depends
on special |xml-data-file| and two commands: |:XMLns| and |:XMLent|. Features
are:
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)
@@ -1050,15 +1367,15 @@ are:
a tag)
- when attribute has limited number of possible values help to complete
them
- complete names of entities (defined in |xml-data-file| and in current file
- 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*
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
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.
@@ -1072,9 +1389,9 @@ compound from two parts:
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: >
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":
@@ -1086,24 +1403,34 @@ attributes as keys and possible values of attributes as values. Example: >
\ "meta":
\ [ [], {"id": [], "http-equiv": [], "name": [], "content": [], "scheme":
\ [], "lang": [], "xml:lang": [], "dir": ["ltr", "rtl"]}]
\ "vimxmlentities": ["amp", "lt", "gt", "apos", "quot"]}
\ "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 two special elements:
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*
: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|
@@ -1116,24 +1443,24 @@ to use XML completion in .xsl files: >
:XMLns xsl xsl
:XMLent {name} *:XMLent*
: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
: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:|
<xsl:|
Will complete to appropriate XSL tag.
@@ -1141,7 +1468,7 @@ 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")
:echo xmlcomplete#GetLastOpenTag("b:unaryTagsStack")
@@ -1273,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}
==============================================================================

View File

@@ -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; }

View File

@@ -1,4 +1,4 @@
*map.txt* For Vim version 7.0aa. Last change: 2005 Dec 11
*map.txt* For Vim version 7.0aa. 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|
@@ -24,6 +35,9 @@ is to define a sequence commands for a function key. Example: >
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
modes.
@@ -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,12 +206,41 @@ 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.
@@ -177,9 +250,6 @@ There are five sets of mappings
- 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 ~
@@ -283,6 +359,48 @@ last defined. Example: >
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
@@ -294,18 +412,6 @@ 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*
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
@@ -331,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".
@@ -418,7 +536,9 @@ 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
@@ -436,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). >
@@ -445,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",
@@ -521,53 +645,15 @@ 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).
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.
Mapping ALT-keys *:map-alt-keys*
1.10 MAPPING ALT-KEYS *:map-alt-keys*
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 work that way, such as xterm, aterm and
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
@@ -575,8 +661,9 @@ 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, aterm and rxvt should work well by default, unless you tweak
resources like "metaSendsEscape", "eightBitInput" and "eightBitOutput".
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
@@ -601,6 +688,62 @@ 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*
@@ -688,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>
@@ -860,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.
@@ -1000,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
@@ -1098,8 +1241,9 @@ 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.
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

View File

@@ -1,4 +1,4 @@
*mbyte.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*mbyte.txt* For Vim version 7.0aa. Last change: 2006 Mar 05
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -1257,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

View File

@@ -1,4 +1,4 @@
*message.txt* For Vim version 7.0aa. Last change: 2005 Oct 10
*message.txt* For Vim version 7.0aa. Last change: 2006 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -19,7 +19,8 @@ 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.
@@ -750,9 +751,12 @@ and the screen is about to be redrawn:
-> 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', '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.
-> 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

View File

@@ -1,4 +1,4 @@
*motion.txt* For Vim version 7.0aa. Last change: 2005 Dec 09
*motion.txt* For Vim version 7.0aa. Last change: 2006 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -57,6 +57,7 @@ or change text. The following operators are available:
|>| > shift right
|<| < shift left
|zf| zf define a fold
|g@| g@ call function set with the 'operatorfunc' option
If the motion includes a count and the operator also had a count before it,
the two counts are multiplied. For example: "2d3w" deletes six words.
@@ -385,10 +386,11 @@ These commands move over words or WORDS.
*word*
A word consists of a sequence of letters, digits and underscores, or a
sequence of other non-blank characters, separated with white space (spaces,
tabs, <EOL>). This can be changed with the 'iskeyword' option.
tabs, <EOL>). This can be changed with the 'iskeyword' option. An empty line
is also considered to be a word.
*WORD*
A WORD consists of a sequence of non-blank characters, separated with white
space. An empty line is also considered to be a word and a WORD.
space. An empty line is also considered to be a WORD.
A sequence of folded lines is counted for one word of a single character.
"w" and "W", "e" and "E" move to the start/end of the first word or WORD after

View File

@@ -1,4 +1,4 @@
*netbeans.txt* For Vim version 7.0aa. Last change: 2005 Apr 04
*netbeans.txt* For Vim version 7.0aa. Last change: 2006 Mar 09
VIM REFERENCE MANUAL by Gordon Prieur
@@ -179,6 +179,7 @@ These messages are specific for NetBeans:
Region is guarded, cannot modify
NetBeans defines guarded areas in the text, which you cannot
change.
Also sets the current buffer, if necessary.
*E656*
NetBeans disallows writes of unmodified buffers
@@ -193,7 +194,7 @@ Partial writes disallowed for NetBeans buffers
*E658*
NetBeans connection lost for this buffer
NetBeans has become confused about the state of this file.
Rather than risc data corruption, NetBeans has severed the
Rather than risk data corruption, NetBeans has severed the
connection for this file. Vim will take over responsibility
for saving changes to this file and NetBeans will no longer
know of these changes.
@@ -258,10 +259,19 @@ problems and has been fixed in 2.2. To decrease the likelihood of this
confusion happening again, netbeans_saved() has been renamed to
netbeans_save_buffer().
We are now at version 2.3. For the differences between 2.2 and 2.3 search for
"2.3" below.
The messages are currently sent over a socket. Since the messages are in
plain UTF-8 text this protocol could also be used with any other communication
mechanism.
To see an example implementation look at the gvim tool in Agide. Currently
found here:
http://cvs.sf.net/viewcvs.py/a-a-p/Agide/Tools/GvimTool.py?view=markup
10.1 Kinds of messages |nb-messages|
10.2 Terms |nb-terms|
10.3 Commands |nb-commands|
@@ -485,8 +495,10 @@ setContentType
Not implemented.
setDot off Make the buffer the current buffer and set the cursor at the
specified position. If there are folds they are opened to
make the cursor line visible.
specified position. If the buffer is open in another window
than make that window the current window.
If there are folds they are opened to make the cursor line
visible.
In version 2.1 "lnum/col" can be used instead of "off".
setExitDelay seconds
@@ -566,6 +578,7 @@ stopDocumentListen
unguard off len
Opposite of "guard", remove guarding for a text area.
Also sets the current buffer, if necessary.
version Not implemented.
@@ -608,10 +621,22 @@ getText Return the contents of the buffer as a string.
insert off text
Insert "text" before position "off". "text" is a string
argument, "off" a number.
"off" should have a "\n" (newline) at the end of each line.
Or "\r\n" when 'fileformat' is "dos". When using "insert" in
an empty buffer Vim will set 'fileformat' accordingly.
When "off" points to the start of a line the text is inserted
above this line. Thus when "off" is zero lines are inserted
before the first line.
When "off" points after the start of a line, possibly on the
NUL at the end of a line, the first line of text is appended
to this line. Further lines come below it.
Possible replies:
123 no problem
123 !message failed
Note that the message in the reply is not quoted.
Also sets the current buffer, if necessary.
Does not move the cursor to the changed text.
Resets undo information.
remove off length
Delete "length" bytes of text at position "off". Both
@@ -620,6 +645,7 @@ remove off length
123 no problem
123 !message failed
Note that the message in the reply is not quoted.
Also sets the current buffer, if necessary.
saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
If there are no changed files or the user does not cancel the

View File

@@ -1,4 +1,4 @@
*options.txt* For Vim version 7.0aa. Last change: 2005 Dec 11
*options.txt* For Vim version 7.0aa. Last change: 2006 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -127,7 +127,7 @@ Note that an option may also have been set as a side effect of setting
{not available when compiled without the +eval feature}
*:set-termcap* *E522*
For {option} the form "t_xx" may be used to set a termcap option. This will
For {option} the form "t_xx" may be used to set a terminal option. This will
override the value from the termcap. You can then use it in a mapping. If
the "xx" part contains special characters, use the <t_xx> form: >
:set <t_#4>=^[Ot
@@ -162,6 +162,11 @@ include the "|" in the option value, use "\|" instead. This example sets the
This sets the 'titlestring' option to "hi" and 'iconstring' to "there": >
:set titlestring=hi|set iconstring=there
Similarly, the double quote character starts a comment. To include the '"' in
the option value, use '\"' instead. This example sets the 'titlestring'
option to 'hi "there"': >
:set titlestring=hi\ \"there\"
For MS-DOS and WIN32 backslashes in file names are mostly not removed. More
precise: For options that expect a file name (those where environment
variables are expanded) a backslash before a normal file name character is not
@@ -442,8 +447,8 @@ There are two forms of modelines. The first form:
where each part between ':' is the argument for a ":set"
command
Example: >
vi:noai:sw=3 ts=6
Example:
vi:noai:sw=3 ts=6 ~
The second form (this is compatible with some versions of Vi):
@@ -459,8 +464,8 @@ se[t] the string "set " or "se " (note the space)
: a colon
[text] any text or empty
Example: >
/* vim: set ai tw=75: */
Example:
/* vim: set ai tw=75: */ ~
The white space before {vi:|vim:|ex:} is required. This minimizes the chance
that a normal word like "lex:" is caught. There is one exception: "vi:" and
@@ -488,10 +493,10 @@ number can be specified where "vim:" is used:
vim={vers}: version {vers}
vim>{vers}: version after {vers}
{vers} is 600 for Vim 6.0 (hundred times the major version plus minor).
For example, to use a modeline only for Vim 6.0 and later: >
/* vim600: set foldmethod=marker: */
To use a modeline for Vim before version 5.7: >
/* vim<570: set sw=4: */
For example, to use a modeline only for Vim 6.0 and later:
/* vim600: set foldmethod=marker: */ ~
To use a modeline for Vim before version 5.7:
/* vim<570: set sw=4: */ ~
There can be no blanks between "vim" and the ":".
@@ -499,16 +504,16 @@ The number of lines that are checked can be set with the 'modelines' option.
If 'modeline' is off or 'modelines' is 0 no lines are checked.
Note that for the first form all of the rest of the line is used, thus a line
like: >
/* vi:ts=4: */
will give an error message for the trailing "*/". This line is OK: >
/* vi:set ts=4: */
like:
/* vi:ts=4: */ ~
will give an error message for the trailing "*/". This line is OK:
/* vi:set ts=4: */ ~
If an error is detected the rest of the line is skipped.
If you want to include a ':' in a set command precede it with a '\'. The
backslash in front of the ':' will be removed. Example: >
/* vi:set dir=c\:\tmp: */
backslash in front of the ':' will be removed. Example:
/* vi:set dir=c\:\tmp: */ ~
This sets the 'dir' option to "c:\tmp". Only a single backslash before the
':' is removed. Thus to include "\:" you have to specify "\\:".
@@ -1008,12 +1013,12 @@ A jump table for the options with a short description can be found at |Q_op|.
*'balloonexpr'* *'bexpr'*
'balloonexpr' 'bexpr' string (default "")
global
global or local to buffer |global-local|
{not in Vi}
{only available when compiled with the |+balloon_eval|
feature}
Expression to show in evaluation balloon. It is only used when
'ballooneval' is on. These variables can be used:
Expression for text to show in evaluation balloon. It is only used
when 'ballooneval' is on. These variables can be used:
v:beval_bufnr number of the buffer in which balloon is going to show
v:beval_winnr number of the window
@@ -1037,9 +1042,18 @@ A jump table for the options with a short description can be found at |Q_op|.
Vim does not try to send a message to an external debugger (Netbeans
or Sun Workshop).
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'balloonexpr' |textlock|.
To check whether line breaks in the balloon text work use this check: >
if has("balloon_multiline")
<
< When they are supported "\n" characters will start a new line. If the
expression evaluates to a |List| this is equal to using each List item
as a string and putting "\n" in between them.
*'binary'* *'bin'* *'nobinary'* *'nobin'*
'binary' 'bin' boolean (default off)
local to buffer
@@ -1172,6 +1186,7 @@ A jump table for the options with a short description can be found at |Q_op|.
autocommands. {not available when compiled without the
|+autocmd| feature}
quickfix quickfix buffer, contains list of errors |:cwindow|
or list of locations |:lwindow|
help help buffer (you are not supposed to set this
manually)
@@ -1180,8 +1195,9 @@ A jump table for the options with a short description can be found at |Q_op|.
Be careful with changing this option, it can have many side effects!
A "quickfix" buffer is only used for the error list. This value is
set by the |:cwindow| command and you are not supposed to change it.
A "quickfix" buffer is only used for the error list and the location
list. This value is set by the |:cwindow| and |:lwindow| commands and
you are not supposed to change it.
"nofile" and "nowrite" buffers are similar:
both: The buffer is not to be written to disk, ":w" doesn't
@@ -1563,6 +1579,7 @@ A jump table for the options with a short description can be found at |Q_op|.
u scan the unloaded buffers that are in the buffer list
U scan the buffers that are not in the buffer list
k scan the files given with the 'dictionary' option
kspell use the currently active spell checking |spell|
k{dict} scan the file {dict}. Several "k" flags can be given,
patterns are valid too. For example: >
:set cpt=k/usr/dict/*,k~/spanish
@@ -1598,104 +1615,36 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the +eval
or +insert_expand feature}
This option specifies a function to be used for CTRL-X CTRL-U
completion. |i_CTRL-X_CTRL-U|
This option specifies a function to be used for Insert mode completion
with CTRL-X CTRL-U. |i_CTRL-X_CTRL-U|
See |complete-functions| for an explanation of how the function is
invoked and what it should return.
The function will be invoked with two arguments. First the function
is called to find the start of the text to be completed. Secondly 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 of 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, what 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.
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 may 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
<
*'completeopt'* *'cot'*
'completeopt' 'cot' string (default: "menu")
'completeopt' 'cot' string (default: "menu,preview")
global
{not available when compiled without the
|+insert_expand| feature}
{not in Vi}
Options for Insert mode completion |ins-completion|.
Currently the only supported value is:
A comma separated list of options for Insert mode completion
|ins-completion|. The supported values are:
menu Use a popup menu to show the possible completions. The
menu is only shown when there is more than one match and
sufficient colors are available. |ins-completion-menu|
menuone Use the popup menu also when there is only one match.
Useful when there is additional information about the
match, e.g., what file it comes from.
longest Only insert the longest common text of the matches. Use
CTRL-L to add more characters. Whether case is ignored
depends on the kind of completion. For buffer text the
'ignorecase' option is used.
preview Show extra information about the currently selected
completion in the preview window.
*'confirm'* *'cf'* *'noconfirm'* *'nocf'*
'confirm' 'cf' boolean (default off)
@@ -1982,11 +1931,11 @@ A jump table for the options with a short description can be found at |Q_op|.
C-indenting.
*cpo--*
- When included, a vertical movement command fails when
it would above the first line or below the last line.
Without it the cursor moves to the first or last line,
unless it already was in that line.
it would go above the first line or below the last
line. Without it the cursor moves to the first or
last line, unless it already was in that line.
Applies to the commands "-", "k", CTRL-P, "+", "j",
CTRL-N and CTRL-J.
CTRL-N, CTRL-J and ":1234".
*cpo-+*
+ When included, a ":write file" command will reset the
'modified' flag of the buffer, even though the buffer
@@ -2096,13 +2045,35 @@ A jump table for the options with a short description can be found at |Q_op|.
Give messages when adding a cscope database. See |cscopeverbose|.
NOTE: This option is reset when 'compatible' is set.
*'cursorcolumn'* *'cuc'* *'nocursorcolumn'* *'nocuc'*
'cursorcolumn' 'cuc' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+syntax|
feature}
Highlight the screen column of the cursor with CursorColumn
|hl-CursorColumn|. Useful to align text. Will make screen redrawing
slower.
*'cursorline'* *'cul'* *'nocursorline'* *'nocul'*
'cursorline' 'cul' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the |+syntax|
feature}
Highlight the screen line of the cursor with CursorLine
|hl-CursorLine|. Useful to easily spot the cursor. Will make screen
redrawing slower.
*'debug'*
'debug' string (default "")
global
{not in Vi}
When set to "msg", error messages that would otherwise be omitted will
be given anyway. This is useful when debugging 'foldexpr' or
'indentexpr'.
be given anyway. This is useful when debugging 'foldexpr',
'formatexpr' or 'indentexpr'.
When set to "beep", a message will be given when otherwise only a beep
would be produced.
The values can be combined, separated by a comma.
@@ -2148,6 +2119,8 @@ A jump table for the options with a short description can be found at |Q_op|.
contain a list of words. This can be one word per line, or several
words per line, separated by non-keyword characters (white space is
preferred). Maximum line length is 510 bytes.
When this option is empty, or an entry "spell" is present, spell
checking is enabled the currently active spelling is used. |spell|
To include a comma in a file name precede it with a backslash. Spaces
after a comma are ignored, otherwise spaces are included in the file
name. See |option-backslash| about using backslashes.
@@ -2212,11 +2185,20 @@ A jump table for the options with a short description can be found at |Q_op|.
exactly. It should ignore adding trailing
white space, but not leading white space.
horizontal Start diff mode with horizontal splits (unless
explicitly specified otherwise).
vertical Start diff mode with vertical splits (unless
explicitly specified otherwise).
foldcolumn:{n} Set the 'foldcolumn' option to {n} when
starting diff mode. Without this 2 is used.
Examples: >
:set diffopt=filler,context:4
:set diffopt=
:set diffopt=filler
:set diffopt=filler,foldcolumn:3
<
*'digraph'* *'dg'* *'nodigraph'* *'nodg'*
'digraph' 'dg' boolean (default off)
@@ -2510,6 +2492,7 @@ A jump table for the options with a short description can be found at |Q_op|.
When reading a file 'fileencoding' will be set from 'fileencodings'.
To read a file in a certain encoding it won't work by setting
'fileencoding', use the |++enc| argument.
For a new file the global value of 'fileencoding' is used.
Prepending "8bit-" and "2byte-" has no meaning here, they are ignored.
When the option is set, the value is converted to lowercase. Thus
you can set it with uppercase values too. '_' characters are
@@ -2545,7 +2528,9 @@ A jump table for the options with a short description can be found at |Q_op|.
'encoding' is "utf-8" (or one of the other Unicode variants)
conversion is most likely done in a way that the reverse
conversion results in the same text. When 'encoding' is not
"utf-8" special characters may be lost!
"utf-8" some non-ASCII characters may be lost! You can use
the |++bad| argument to specify what is done with characters
that can't be converted.
For an empty file or a file with only ASCII characters most encodings
will work and the first entry of 'fileencodings' will be used (except
"ucs-bom", which requires the BOM to be present). If you prefer
@@ -2555,9 +2540,13 @@ A jump table for the options with a short description can be found at |Q_op|.
\ set fenc=iso-2022-jp | endif
< This sets 'fileencoding' to "iso-2022-jp" if the file does not contain
non-blank characters.
Note that 'fileencodings' is not used for an new file, 'fileencoding'
is always empty then. This means that a non-existing file may get a
different encoding than an empty file.
When the |++enc| argument is used then the value of 'fileencodings' is
not used.
Note that 'fileencodings' is not used for a new file, the global value
of 'fileencoding' is used instead. You can set it with: >
:setglobal fenc=iso-8859-2
< This means that a non-existing file may get a different encoding than
an empty file.
The special value "ucs-bom" can be used to check for a Unicode BOM
(Byte Order Mark) at the start of the file. It must not be preceded
by "utf-8" or another Unicode encoding for this to work properly.
@@ -2568,6 +2557,9 @@ A jump table for the options with a short description can be found at |Q_op|.
environment. This is the default value for 'encoding'. It is useful
when 'encoding' is set to "utf-8" and your environment uses a
non-latin1 encoding, such as Russian.
When 'encoding' is "utf-8" and a file contains an illegal byte
sequence it won't be recognized as UTF-8. You can use the |8g8|
command to find the illegal byte sequence.
WRONG VALUES: WHAT'S WRONG:
latin1,utf-8 "latin1" will always be used
utf-8,ucs-bom,latin1 BOM won't be recognized in an utf-8
@@ -2673,9 +2665,15 @@ A jump table for the options with a short description can be found at |Q_op|.
this use the ":filetype on" command. |:filetype|
Setting this option to a different value is most useful in a modeline,
for a file for which the file type is not automatically recognized.
Example, for in an IDL file: >
/* vim: set filetype=idl : */
< |FileType| |filetypes|
Example, for in an IDL file:
/* vim: set filetype=idl : */ ~
|FileType| |filetypes|
When a dot appears in the value then this separates two filetype
names. Example:
/* vim: set filetype=c.doxygen : */ ~
This will use the "c" filetype first, then the "doxygen" filetype.
This works both for filetype plugins and for syntax files. More than
one dot may appear.
Do not confuse this option with 'osfiletype', which is for the file
type that is actually stored with the file.
This option is not copied to another buffer, independent of the 's' or
@@ -2767,8 +2765,13 @@ A jump table for the options with a short description can be found at |Q_op|.
{not available when compiled without the |+folding|
or |+eval| feature}
The expression used for when 'foldmethod' is "expr". It is evaluated
for each line to obtain its fold level. See |fold-expr|. Also see
|eval-sandbox|.
for each line to obtain its fold level. See |fold-expr|.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'foldexpr' |textlock|.
*'foldignore'* *'fdi'*
'foldignore' 'fdi' string (default: "#")
@@ -2900,6 +2903,12 @@ A jump table for the options with a short description can be found at |Q_op|.
An expression which is used to specify the text displayed for a closed
fold. See |fold-foldtext|.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'foldtext' |textlock|.
*'formatoptions'* *'fo'*
'formatoptions' 'fo' string (Vim default: "tcq", Vi default: "vt")
local to buffer
@@ -2932,17 +2941,43 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{not in Vi}
The name of an external program that will be used to format the lines
selected with the "gq" command. The program must take the input on
selected with the |gq| operator. The program must take the input on
stdin and produce the output on stdout. The Unix program "fmt" is
such a program.
If this option is an empty string, the internal format function will
be used |C-indenting|.
If the 'formatexpr' option is not empty it will be used instead.
Otherwise, if 'formatprg' option is an empty string, the internal
format function will be used |C-indenting|.
Environment variables are expanded |:set_env|. See |option-backslash|
about including spaces and backslashes.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
*'fsync'* *'fs'*
*'formatexpr'* *'fex'*
'formatexpr' 'fex' string (default "")
local to buffer
{not in Vi}
{not available when compiled without the |+eval|
feature}
Expression which is evaluated to format a range of lines for the |gq|
operator. The |v:lnum| variable holds the first line to be formatted,
|v:count| the number of lines to be formatted.
When this option is empty 'formatprg' is used.
Example: >
:set formatexpr=mylang#Format()
< This will invoke the mylang#Format() function in the
autoload/mylang.vim file in 'runtimepath'. |autoload|
The expression is also evaluated when 'textwidth' is set and adding
text beyond that limit. This happens under the same conditions as
when internal formatting is used. Make sure the cursor is kept in the
same spot relative to the text then! The |mode()| function will
return "i" or "R" in this situation. When the function returns
non-zero Vim will fall back to using the internal format mechanism.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
*'fsync'* *'fs'*
'fsync' 'fs' boolean (default on)
global
{not in Vi}
@@ -2996,7 +3031,8 @@ A jump table for the options with a short description can be found at |Q_op|.
also work well with a single file: >
:set grepprg=grep\ -nH
< Special value: When 'grepprg' is set to "internal" the |:grep| command
works like |:vimgrep| and |:grepadd| like |:vimgrepadd|.
works like |:vimgrep|, |:lgrep| like |:lvimgrep|, |:grepadd| like
|:vimgrepadd| and |:lgrepadd| like |:lvimgrepadd|.
See also the section |:make_makeprg|, since most of the comments there
apply equally to 'grepprg'.
For Win32, the default is "findstr /n" if "findstr.exe" can be found,
@@ -3270,6 +3306,12 @@ A jump table for the options with a short description can be found at |Q_op|.
'c' Use console dialogs instead of popup dialogs for simple
choices.
'e' Add tab pages when indicated with 'showtabline'.
'guitablabel' can be used to change the text in the labels.
When 'e' is missing a non-GUI tab pages line may be used.
The GUI tabs are only supported on some systens, currently
only for GTK.
'f' Foreground: Don't use fork() to detach the GUI from the shell
where it was started. Use this for programs that wait for the
editor to finish (e.g., an e-mail program). Alternatively you
@@ -3330,6 +3372,22 @@ A jump table for the options with a short description can be found at |Q_op|.
Only in the GUI: If on, an attempt is made to open a pseudo-tty for
I/O to/from shell commands. See |gui-pty|.
*'guitablabel'* *'gtl'*
'guitablabel' 'gtl' string (default empty)
global
{not in Vi}
{only available when compiled with GUI enabled and
with the +windows feature}
When nonempty describes the text to use in a label of the GUI tab
pages line. When empty Vim will use a default label. See
|setting-guitablabel| for more info.
The format of this option is like that of 'statusline'.
Only used when the GUI tab pages line is displayed. 'e' must be
present in 'guioptions'. For the non-GUI tab pages line 'tabline' is
used.
*'helpfile'* *'hf'*
'helpfile' 'hf' string (default (MSDOS) "$VIMRUNTIME\doc\help.txt"
(others) "$VIMRUNTIME/doc/help.txt")
@@ -3692,11 +3750,17 @@ A jump table for the options with a short description can be found at |Q_op|.
option to a file name. Mostly useful to change "." to "/" for Java: >
:set includeexpr=substitute(v:fname,'\\.','/','g')
< The "v:fname" variable will be set to the file name that was detected.
Evaluated in the |sandbox|.
Also used for the |gf| command if an unmodified file name can't be
found. Allows doing "gf" on the name after an 'include' statement.
Also used for |<cfile>|.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'includeexpr' |textlock|.
*'incsearch'* *'is'* *'noincsearch'* *'nois'*
'incsearch' 'is' boolean (default off)
global
@@ -3713,6 +3777,10 @@ A jump table for the options with a short description can be found at |Q_op|.
cursor to the match.
The highlighting can be set with the 'i' flag in 'highlight'.
See also: 'hlsearch'.
CTRL-L can be used to add one character from after the current match
to the command line.
CTRL-R CTRL-W can be used to add the word at the end of the current
match, excluding the characters that were already typed.
NOTE: This option is reset when 'compatible' is set.
*'indentexpr'* *'inde'*
@@ -3742,9 +3810,16 @@ A jump table for the options with a short description can be found at |Q_op|.
:set indentexpr=GetMyIndent()
< Error messages will be suppressed, unless the 'debug' option contains
"msg".
See |indent-expression|. Also see |eval-sandbox|.
See |indent-expression|.
NOTE: This option is made empty when 'compatible' is set.
The expression may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'indentexpr' |textlock|.
*'indentkeys'* *'indk'*
'indentkeys' 'indk' string (default "0{,0},:,0#,!^F,o,O,e")
local to buffer
@@ -3997,8 +4072,8 @@ A jump table for the options with a short description can be found at |Q_op|.
specified with multi-byte characters (e.g., UTF-8), but only the lower
8 bits of each character will be used.
Example (for Greek): *greek* >
:set langmap=<EFBFBD>A,<EFBFBD>B,<EFBFBD>C,<EFBFBD>D,<EFBFBD>E,<EFBFBD>F,<EFBFBD>G,<EFBFBD>H,<EFBFBD>I,<EFBFBD>J,<EFBFBD>K,<EFBFBD>L,<EFBFBD>M,<EFBFBD>N,<EFBFBD>O,<EFBFBD>P,QQ,<EFBFBD>R,<EFBFBD>S,<EFBFBD>T,<EFBFBD>U,<EFBFBD>V,WW,<EFBFBD>X,<EFBFBD>Y,<EFBFBD>Z,<EFBFBD>a,<EFBFBD>b,<EFBFBD>c,<EFBFBD>d,<EFBFBD>e,<EFBFBD>f,<EFBFBD>g,<EFBFBD>h,<EFBFBD>i,<EFBFBD>j,<EFBFBD>k,<EFBFBD>l,<EFBFBD>m,<EFBFBD>n,<EFBFBD>o,<EFBFBD>p,qq,<EFBFBD>r,<EFBFBD>s,<EFBFBD>t,<EFBFBD>u,<EFBFBD>v,<EFBFBD>w,<EFBFBD>x,<EFBFBD>y,<EFBFBD>z
Example (for Greek, in UTF-8): *greek* >
:set langmap=ΑA,ΒB,ΨC,ΔD,ΕE,ΦF,ΓG,ΗH,ΙI,ΞJ,ΚK,ΛL,ΜM,ΝN,ΟO,ΠP,QQ,ΡR,ΣS,ΤT,ΘU,ΩV,WW,ΧX,ΥY,ΖZ,αa,βb,ψc,δd,εe,φf,γg,ηh,ιi,ξj,κk,λl,μm,νn,οo,πp,qq,ρr,σs,τt,θu,ωv,ςw,χx,υy,ζz
< Example (exchanges meaning of z and y for commands): >
:set langmap=zy,yz,ZY,YZ
<
@@ -4267,6 +4342,20 @@ A jump table for the options with a short description can be found at |Q_op|.
set. Note that this is not in milliseconds, like other options that
set a time. This is to be compatible with Nvi.
*'maxcombine'* *'mco'*
'maxcombine' 'mco' number (default 2)
global
{not in Vi}
{only available when compiled with the |+multi_byte|
feature}
The maximum number of combining characters supported for displaying.
Only used when 'encoding' is "utf-8".
The default is OK for most languages. Hebrew may require 4.
Maximum value is 6.
Even when this option is set to 2 you can still edit text with more
combining characters, you just can't see them. Use |g8| or |ga|.
See |mbyte-combining|.
*'maxfuncdepth'* *'mfd'*
'maxfuncdepth' 'mfd' number (default 100)
global
@@ -4593,12 +4682,12 @@ A jump table for the options with a short description can be found at |Q_op|.
This defines what bases Vim will consider for numbers when using the
CTRL-A and CTRL-X commands for adding to and subtracting from a number
respectively; see |CTRL-A| for more info on these commands.
alpha if included, single alphabetical characters will be
alpha If included, single alphabetical characters will be
incremented or decremented. This is useful for a list with a
letter index a), b), etc.
octal if included, numbers that start with a zero will be considered
octal If included, numbers that start with a zero will be considered
to be octal. Example: Using CTRL-A on "007" results in "010".
hex if included, numbers starting with "0x" or "0X" will be
hex If included, numbers starting with "0x" or "0X" will be
considered to be hexadecimal. Example: Using CTRL-X on
"0x100" results in "0x0ff".
Numbers which simply begin with a digit in the range 1-9 are always
@@ -4624,7 +4713,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{only available when compiled with the |+linebreak|
feature}
Minimal number of columns to use for the line number. Only relevant
when the 'number' option is set.
when the 'number' option is set or printing lines with a line number.
Since one space is always between the number and the text, there is
one less character for the number itself.
The value is the minimum width. A bigger width is used when needed to
@@ -4640,10 +4729,21 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the +eval
or +insert_expand feature}
This option specifies a function to be used for CTRL-X CTRL-O
completion. |i_CTRL-X_CTRL-O|
This option specifies a function to be used for Insert mode omni
completion with CTRL-X CTRL-O. |i_CTRL-X_CTRL-O|
See |complete-functions| for an explanation of how the function is
invoked and what it should return.
For the use of the function see 'completefunc'.
*'operatorfunc'* *'opfunc'*
'operatorfunc' 'opfunc' string (default: empty)
global
{not in Vi}
This option specifies a function to be called by the |g@| operator.
See |:map-operator| for more info and an example.
This option cannot be set from a |modeline| or in the |sandbox|, for
security reasons.
*'osfiletype'* *'oft'* *E366*
@@ -4942,6 +5042,17 @@ A jump table for the options with a short description can be found at |Q_op|.
global
When on a ":" prompt is used in Ex mode.
*'pumheight'* *'ph'*
'pumheight' 'ph' number (default 0)
global
{not available when compiled without the
|+insert_expand| feature}
{not in Vi}
Determines the maximum number of items to show in the popup menu.
When zero as much space as available is used.
|ins-completion-menu|.
*'quoteescape'* *'qe'*
'quoteescape' 'qe' string (default "\")
local to buffer
@@ -4968,6 +5079,9 @@ A jump table for the options with a short description can be found at |Q_op|.
global
Allows for mappings to work recursively. If you do not want this for
a single entry, use the :noremap[!] command.
NOTE: To avoid portability problems with Vim scripts, always keep
this option at the default "on". Only switch it off when working with
old Vi scripts.
*'report'*
'report' number (default 2)
@@ -5070,7 +5184,7 @@ A jump table for the options with a short description can be found at |Q_op|.
feature}
When this option is not empty, it determines the content of the ruler
string, as displayed for the 'ruler' option.
The format of this option, is like that of 'statusline'.
The format of this option is like that of 'statusline'.
The default ruler width is 17 characters. To make the ruler 15
characters wide, put "%15(" at the start and "%)" at the end.
Example: >
@@ -5121,6 +5235,7 @@ A jump table for the options with a short description can be found at |Q_op|.
menu.vim GUI menus |menu.vim|
plugin/ plugin scripts |write-plugin|
print/ files for printing |postscript-print-encoding|
spell/ spell checking files |spell|
syntax/ syntax files |mysyntaxfile|
tutor/ files for vimtutor |tutor|
@@ -5334,6 +5449,8 @@ A jump table for the options with a short description can be found at |Q_op|.
winsize window sizes
Don't include both "curdir" and "sesdir".
There is no option to include tab pages yet, only the current tab page
is stored in the session. |tab-page|
When "curdir" nor "sesdir" is included, file names are stored with
absolute paths.
"slash" and "unix" are useful on Windows when sharing session files
@@ -5662,7 +5779,9 @@ A jump table for the options with a short description can be found at |Q_op|.
The 'matchpairs' option can be used to specify the characters to show
matches for. 'rightleft' and 'revins' are used to look for opposite
matches.
Note: For the use of the short form parental guidance is advised.
Also see the matchparen plugin for highlighting the match when moving
around |pi_paren.txt|.
Note: Use of the short form is rated PG.
*'showmode'* *'smd'* *'noshowmode'* *'nosmd'*
'showmode' 'smd' boolean (Vim default: on, Vi default: off)
@@ -5676,6 +5795,21 @@ A jump table for the options with a short description can be found at |Q_op|.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
*'showtabline'* *'stal'*
'showtabline' 'stal' number (default 1)
global
{not in Vi}
{not available when compiled without the +windows
feature}
The value of this option specifies when the line with tab page labels
will be displayed:
0: never
1: only if there are at least two tab pages
2: always
This is both for the GUI and non-GUI implementation of the tab pages
line.
See |tab-page| for more information about tab pages.
*'sidescroll'* *'ss'*
'sidescroll' 'ss' number (default 0)
global
@@ -5753,11 +5887,12 @@ A jump table for the options with a short description can be found at |Q_op|.
global
{not in Vi}
When on, a <Tab> in front of a line inserts blanks according to
'shiftwidth'. 'tabstop' is used in other places. A <BS> will delete
a 'shiftwidth' worth of space at the start of the line.
When off a <Tab> always inserts blanks according to 'tabstop'.
'shiftwidth' is only used for shifting text left or right
|shift-left-right|.
'shiftwidth'. 'tabstop' or 'softtabstop' is used in other places. A
<BS> will delete a 'shiftwidth' worth of space at the start of the
line.
When off, a <Tab> always inserts blanks according to 'tabstop' or
'softtabstop'. 'shiftwidth' is only used for shifting text left or
right |shift-left-right|.
What gets inserted (a Tab or spaces) depends on the 'expandtab'
option. Also see |ins-expandtab|. When 'expandtab' is not set, the
number of spaces is minimized by using <Tab>s.
@@ -5862,9 +5997,14 @@ A jump table for the options with a short description can be found at |Q_op|.
files twice.
How the related spell files are found is explained here: |spell-load|.
If the |spellfile.vim| plugin is active and you use a language name
for which Vim cannot find the .spl file in 'runtimepath' the plugin
will ask you if you want to download the file.
After this option has been set successfully, Vim will source the files
"spell/LANG.vim" in 'runtimepath'. "LANG" is the value of 'spelllang'
up to the first comma, dot or underscore. See |set-spc-auto|.
up to the first comma, dot or underscore.
Also see |set-spc-auto|.
*'spellsuggest'* *'sps'*
@@ -5873,7 +6013,7 @@ A jump table for the options with a short description can be found at |Q_op|.
{not in Vi}
{not available when compiled without the |+syntax|
feature}
Methods used for spelling suggestions. Both for the |z?| command and
Methods used for spelling suggestions. Both for the |z=| command and
the |spellsuggest()| function. This is a comma-separated list of
items:
@@ -5892,7 +6032,7 @@ A jump table for the options with a short description can be found at |Q_op|.
character inserts/deletes/swaps. Works well for
simple typing mistakes.
{number} The maximum number of suggestions listed for |z?|.
{number} The maximum number of suggestions listed for |z=|.
Not used for |spellsuggest()|. The number of
suggestions is never more than the value of 'lines'
minus two.
@@ -5914,7 +6054,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Lists, each with a suggestion and a score.
Example:
[['the', 33], ['that', 44]]
Set 'verbose' and use |z?| to see the scores that the
Set 'verbose' and use |z=| to see the scores that the
internal methods use. A lower score is better.
This may invoke |spellsuggest()| if you temporarily
set 'spellsuggest' to exclude the "expr:" part.
@@ -5977,6 +6117,14 @@ A jump table for the options with a short description can be found at |Q_op|.
All fields except the {item} is optional. A single percent sign can
be given as "%%". Up to 80 items can be specified.
When the option starts with "%!" then it is used as an expression,
evaluated and the result is used as the option value. Example: >
:set statusline=%!MyStatusLine()
< The result can contain %{} items that will be evaluated too.
When there is error while evaluating the option then it will be made
empty to avoid further errors. Otherwise screen updating would loop.
Note that the only effect of 'ruler' when this option is set (and
'laststatus' is 2) is controlling the output of |CTRL-G|.
@@ -6035,14 +6183,24 @@ A jump table for the options with a short description can be found at |Q_op|.
percentage described for 'ruler'. Always 3 in length.
a S Argument list status as in default title. ({current} of {max})
Empty if the argument file count is zero or one.
{ NF Evaluate expression between '{' and '}' and substitute result.
{ NF Evaluate expression between '%{' and '}' and substitute result.
Note that there is no '%' before the closing '}'.
( - Start of item group. Can be used for setting the width and
alignment of a section. Must be followed by %) somewhere.
) - End of item group. No width fields allowed.
T N For 'tabline': start of tab page N label. Use %T after the last
label. This information is used for mouse clicks.
X N For 'tabline': start of close tab N label. Use %X after the
label, e.g.: %3Xclose%X. Use %999X for a "close current tab"
mark. This information is used for mouse clicks.
< - Where to truncate line if too long. Default is at the start.
No width fields allowed.
= - Separation point between left and right aligned items.
No width fields allowed.
# - Set highlight group. The name must follow and then a # again.
Thus use %#HLname# for highlight group HLname. The same
highlighting is used, also for the statusline of non-current
windows.
* - Set highlight group to User{N}, where {N} is taken from the
minwid field, e.g. %1*. Restore normal highlight with %* or %0*.
The difference between User{N} and StatusLine will be applied
@@ -6069,7 +6227,13 @@ A jump table for the options with a short description can be found at |Q_op|.
temporarily to that of the window (and buffer) whose statusline is
currently being drawn. The expression will evaluate in this context.
The variable "actual_curbuf" is set to the 'bufnr()' number of the
real current buffer. The expression is evaluated in the |sandbox|.
real current buffer.
The 'statusline' option may be evaluated in the |sandbox|, see
|sandbox-option|.
It is not allowed to change text or jump to another window while
evaluating 'statusline' |textlock|.
If the statusline is not updated when you want it (e.g., after setting
a variable that's used in an expression), you can force an update by
@@ -6204,9 +6368,15 @@ A jump table for the options with a short description can be found at |Q_op|.
Otherwise this option does not always reflect the current syntax (the
b:current_syntax variable does).
This option is most useful in a modeline, for a file which syntax is
not automatically recognized. Example, in an IDL file: >
/* vim: set syntax=idl : */
< To switch off syntax highlighting for the current file, use: >
not automatically recognized. Example, in an IDL file:
/* vim: set syntax=idl : */ ~
When a dot appears in the value then this separates two filetype
names. Example:
/* vim: set syntax=c.doxygen : */ ~
This will use the "c" syntax first, then the "doxygen" syntax.
Note that the second one must be prepared to be loaded as an addition,
otherwise it will be skipped. More than one dot may appear.
To switch off syntax highlighting for the current file, use: >
:set syntax=OFF
< To switch syntax highlighting on according to the current value of the
'filetype' option: >
@@ -6217,7 +6387,41 @@ A jump table for the options with a short description can be found at |Q_op|.
'S' flag in 'cpoptions'.
Only normal file name characters can be used, "/\*?[|<>" are illegal.
*'tabstop'* *'ts'*
*'tabline'* *'tal'*
'tabline' 'tal' string (default empty)
global
{not in Vi}
{not available when compiled without the +windows
feature}
When nonempty, this option determines the content of the tab pages
line at the top of the Vim window. When empty Vim will use a default
tab pages line. See |setting-tabline| for more info.
The tab pages line only appears as specified with the 'showtabline'
option and only when there is no GUI tab line. When 'e' is in
'guioptions' and the GUI supports a tab line 'guitablabel' is used
instead.
The value is evaluated like with 'statusline'. You can use
|tabpagenr()|, |tabpagewinnr()| and |tabpagebuflist()| to figure out
the text to be displayed. Use "%1T" for the first label, "%2T" for
the second one, etc. Use "%X" items for closing labels.
Keep in mind that only one of the tab pages is the current one, others
are invisible and you can't jump to their windows.
*'tabpagemax'* *'tpm'*
'tabpagemax' 'tpm' number (default 10)
global
{not in Vi}
{not available when compiled without the +windows
feature}
Maximum number of tab pages to be opened by the |-p| command line
argument or the ":tab all" command. |tabpage|
*'tabstop'* *'ts'*
'tabstop' 'ts' number (default 8)
local to buffer
Number of spaces that a <Tab> in the file counts for. Also see
@@ -6820,7 +7024,7 @@ A jump table for the options with a short description can be found at |Q_op|.
Currently, these messages are given:
>= 1 When the viminfo file is read or written.
>= 2 When a file is ":source"'ed.
>= 5 Every searched tags file.
>= 5 Every searched tags file and include file.
>= 8 Files for which a group of autocommands is executed.
>= 9 Every executed autocommand.
>= 12 Every executed function.
@@ -6997,10 +7201,22 @@ A jump table for the options with a short description can be found at |Q_op|.
block Allow virtual editing in Visual block mode.
insert Allow virtual editing in Insert mode.
all Allow virtual editing in all modes.
onemore Allow the cursor to move just past the end of the line
Virtual editing means that the cursor can be positioned where there is
no actual character. This can be halfway into a Tab or beyond the end
of the line. Useful for selecting a rectangle in Visual mode and
editing a table.
"onemore" is not the same, it will only allow moving the cursor just
after the last character of the line. This makes some commands more
consistent. Previously the cursor was always past the end of the line
if the line was empty. But it is far from Vi compatible. It may also
break some plugins or Vim scripts. For example because |l| can move
the cursor after the last character. Use with care!
Using the |$| command will move to the last character in the line, not
past it. This may actually move the cursor to the left!
It doesn't make sense to combine "all" with "onemore", but you will
not get a warning for it.
*'visualbell'* *'vb'* *'novisualbell'* *'novb'* *beep*
'visualbell' 'vb' boolean (default off)
@@ -7027,7 +7243,7 @@ A jump table for the options with a short description can be found at |Q_op|.
'weirdinvert' 'wiv' boolean (default off)
global
{not in Vi}
This option has the same effect as the 't_xs' termcap option.
This option has the same effect as the 't_xs' terminal option.
It is provided for backwards compatibility with version 4.x.
Setting 'weirdinvert' has the effect of making 't_xs' non-empty, and
vice versa. Has no effect when the GUI is running.
@@ -7042,8 +7258,8 @@ A jump table for the options with a short description can be found at |Q_op|.
char key mode ~
b <BS> Normal and Visual
s <Space> Normal and Visual
h "h" Normal and Visual
l "l" Normal and Visual
h "h" Normal and Visual (not recommended)
l "l" Normal and Visual (not recommended)
< <Left> Normal and Visual
> <Right> Normal and Visual
~ "~" Normal
@@ -7059,8 +7275,9 @@ A jump table for the options with a short description can be found at |Q_op|.
"dh". If you use this, you may also want to use the mapping
":map <BS> X" to make backspace delete the character in front of the
cursor.
When 'l' is included, you get a side effect: "yl" on an empty line
will include the <EOL>, so that "p" will insert a new line.
When 'l' is included and it is used after an operator at the end of a
line then it will not move to the next line. This makes "dl", "cl",
"yl" etc. work normally.
NOTE: This option is set to the Vi default value when 'compatible' is
set and to the Vim default value when 'compatible' is reset.
@@ -7264,6 +7481,16 @@ A jump table for the options with a short description can be found at |Q_op|.
|quickfix-window|.
The height may be changed anyway when running out of room.
*'winfixwidth'* *'wfw'* *'nowinfixwidth'* *'nowfw'*
'winfixwidth' 'wfw' boolean (default off)
local to window
{not in Vi}
{not available when compiled without the +windows
feature}
Keep the window width when windows are opened or closed and
'equalalways' is set.
The width may be changed anyway when running out of room.
*'winminheight'* *'wmh'*
'winminheight' 'wmh' number (default 1)
global

View File

@@ -1,4 +1,4 @@
*os_dos.txt* For Vim version 7.0aa. Last change: 2003 Dec 20
*os_dos.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -126,8 +126,8 @@ text. For example, to get grey text on a blue background: >
See |highlight-groups| for other groups that are available.
A DOS console does not support attributes like bold and underlining. You can
set the color used in five modes with nine termcap options. Note that this is
not necessary since you can set the color directly with the ":highlight"
set the color used in five modes with nine terminal options. Note that this
is not necessary since you can set the color directly with the ":highlight"
command; these options are for backward compatibility with older Vim versions.
The |'highlight'| option specifies which of the five modes is used for which
action. >

View File

@@ -1,4 +1,4 @@
*os_mac.txt* For Vim version 7.0aa. Last change: 2005 Mar 29
*os_mac.txt* For Vim version 7.0aa. Last change: 2006 Mar 09
VIM REFERENCE MANUAL by Bram Moolenaar et al.
@@ -33,9 +33,10 @@ Indianapolis IN 46220 USA
==============================================================================
1. Filename Convention *mac-filename*
You can use either the unix or mac path separator or a mix of both. In order
to determine if the specified filename is relative to the current folder or
absolute (i.e. relative to the "Desktop"), the following algorithm is used:
Starting with Vim version 7 you can just use the unix path separators with
Vim. In order to determine if the specified filename is relative to the
current folder or absolute (i.e. relative to the "Desktop"), the following
algorithm is used:
If the path start by a "/", the path is absolute
If the path start by a ":", the path is relative
@@ -58,10 +59,16 @@ You can use the |$VIM| and |$VIMRUNTIME| variable. >
==============================================================================
2. .vimrc and .vim files *mac-vimfile*
On the Mac files starting with a dot "." are discouraged, thus the rc files
are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files can be in
any format (mac, dos or unix). Vim can handle any file format when the
|'nocompatible'| option is set, otherwise it will only handle mac format
It is recommended to use Unix style line separators for Vim scripts, thus a
single newline character.
When starting up Vim will load the $VIMRUNTIME/macmap.vim script to define
default command-key mappings.
On older systems files starting with a dot "." are discouraged, thus the rc
files are named "vimrc" or "_vimrc" and "gvimrc" or "_gvimrc". These files
can be in any format (mac, dos or unix). Vim can handle any file format when
the |'nocompatible'| option is set, otherwise it will only handle mac format
files.
==============================================================================
@@ -80,14 +87,6 @@ A: Assuming that Vim.app is located in /Applications:
==============================================================================
4. Mac Lack *mac-lack*
The filenames containing both ":" and "/" are sometimes misinterpreted. (just
re-execute the command)
Scrollbar are not scrolling live, and when only the arrow or scroll area, a
limit of 32 line or page is scrolled.
Syntax highlighting works on 68k Macs but is _really_ slow.
In a terminal CTRL-^ needs to be entered as Shift-Control-6. CTRL-@ as
Shift-Control-2.

View File

@@ -1,4 +1,4 @@
*os_vms.txt* For Vim version 7.0aa. Last change: 2005 Jul 12
*os_vms.txt* For Vim version 7.0aa. Last change: 2006 Mar 02
VIM REFERENCE MANUAL
@@ -56,11 +56,14 @@ To use the precompiled binary version, you need one of these archives:
vim-XX-exe-vax-gui.zip VAX GUI executables
vim-XX-exe-vax-term.zip VAX console executables
and of course
and of course (optional)
vim-XX-runtime.zip runtime files
The binary archives contain: vim.exe, ctags.exe, xxd.exe files.
For GTK executables you will need GTKLIB that is available for
Alpha and IA64 platform.
==============================================================================
3. Compiling *vms-compiling*
@@ -121,10 +124,10 @@ Vim uses a special directory structure to hold the document and runtime files:
|- vim57
|----- doc
|----- syntax
|- vim60
|- vim62
|----- doc
|----- syntax
|- vim61
|- vim64
|----- doc
|----- syntax
vimrc (system rc files)
@@ -239,6 +242,17 @@ and to the SYS$STARTUP:SYLOGIN.COM >
It will set up a normal Vim work environment for every user on the system.
IMPORTANT: Vim on OpenVMS (and on other case insensitive system) command line
parameters are assumed to be lowecase. In order to indicate that a command
line parameter is uppercase "/" sign must be used.
Examples:
>
vim -R filename ! means: -r List swap files and exit
vim -/r filename ! means: -R Readonly mode (like "view")
vim -u <vimrc> ! means: -u Use <vimrc> instead of any .vimrc
vim -/u <gvimrc> ! means: -U Use <gvimrc> instead of any .gvimrc
==============================================================================
7. GUI mode questions *vms-gui*
@@ -653,7 +667,10 @@ start it with: >
9. VMS related changes *vms-changes*
Version 7.0
Version 7
- Improved low level char input (affects just console mode)
Version 6.4 (2005 Oct 15)
- GTKLIB and Vim build on IA64
- colors in terminal mode
- syntax highlighting in terminal mode

View File

@@ -1,4 +1,4 @@
*pattern.txt* For Vim version 7.0aa. Last change: 2005 Sep 12
*pattern.txt* For Vim version 7.0aa. Last change: 2006 Mar 06
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -16,8 +16,9 @@ explanations are in chapter 27 |usr_27.txt|.
5. Multi items |pattern-multi-items|
6. Ordinary atoms |pattern-atoms|
7. Ignoring case in a pattern |/ignorecase|
8. Compare with Perl patterns |perl-patterns|
9. Highlighting matches |match-highlight|
8. Composing characters |patterns-composing|
9. Compare with Perl patterns |perl-patterns|
10. Highlighting matches |match-highlight|
==============================================================================
1. Search commands *search-commands* *E486*
@@ -161,7 +162,7 @@ The offset gives the cursor position relative to the found match:
s[-num] [num] characters to the left of the start of the match
b[+num] [num] identical to s[+num] above (mnemonic: begin)
b[-num] [num] identical to s[-num] above (mnemonic: begin)
;{pattern} perform another searcn, see |//;|
;{pattern} perform another search, see |//;|
If a '-' or '+' is given but [num] is omitted, a count of one will be used.
When including an offset with 'e', the search becomes inclusive (the
@@ -256,9 +257,13 @@ switched off by setting the 's' flag in the 'shortmess' option. The highlight
method 'w' is used for this message (default: standout).
*search-range*
You cannot limit the search command "/" to a certain range of lines. A trick
to do this anyway is to use the ":substitute" command with the 'c' flag.
Example: >
You can limit the search command "/" to a certain range of lines by including
\%>l items. For example, to match the word "limit" below line 199 and above
line 300: >
/\%>199l\%<300llimit
Also see |/\%>l|.
Another way is to use the ":substitute" command with the 'c' flag. Example: >
:.,300s/Pattern//gc
This command will search from the cursor position until line 300 for
"Pattern". At the match, you will be asked to type a character. Type 'q' to
@@ -390,7 +395,9 @@ More explanation and examples below, follow the links.
|/\ze| \ze \ze anything, sets end of match
|/\%^| \%^ \%^ beginning of file |/zero-width| *E71*
|/\%$| \%$ \%$ end of file |/zero-width|
|/\%V| \%V \%V inside Visual area |/zero-width|
|/\%#| \%# \%# cursor position |/zero-width|
|/\%'m| \%'m \%'m mark m position |/zero-width|
|/\%l| \%23l \%23l in line 23 |/zero-width|
|/\%c| \%23c \%23c in column 23 |/zero-width|
|/\%v| \%23v \%23v in virtual column 23 |/zero-width|
@@ -784,6 +791,11 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
position after the first "VIM".
Searching from the end of the file backwards is easier!
*/\%V*
\%V Match inside the Visual area. When Visual mode has already been
stopped match in the area that |gv| would reselect.
Only works for the current buffer.
*/\%#* *cursor-position*
\%# Matches with the cursor position. Only works when matching in a
buffer displayed in a window. {not in Vi}
@@ -798,10 +810,24 @@ $ At end of pattern or in front of "\|" or "\)" ("|" or ")" after "\v"):
< When 'hlsearch' is set and you move the cursor around and make changes
this will clearly show when the match is updated or not.
*/\%'m* */\%<'m* */\%>'m*
\%'m Matches with the position of mark m.
\%<'m Matches before the position of mark m.
\%>'m Matches after the position of mark m.
Example, to highlight the text from mark 's to 'e: >
/.\%>'s.*\%<'e..
< Note that two dots are required to include mark 'e in the match. That
is because "\%<'e" matches at the character before the 'e mark, and
since it's a |/zero-width| match it doesn't include that character.
{not in Vi}
WARNING: When the mark is moved after the pattern was used, the result
becomes invalid. Vim doesn't automatically update the matches.
Similar to moving the cursor for "\%#" |/\%#|.
*/\%l* */\%>l* */\%<l*
\%23l Matches in a specific line.
\%<23l Matches above a specific line.
\%>23l Matches below a specific line.
\%<23l Matches above a specific line (lower line number).
\%>23l Matches below a specific line (higher line number).
These three can be used to match specific lines in a buffer. The "23"
can be any line number. The first line is 1. {not in Vi}
WARNING: When inserting or deleting lines Vim does not automatically
@@ -1079,12 +1105,6 @@ Examples:
\cfoo - - foo Foo FOO
foo\C - - foo
*/\Z*
When "\Z" appears anywhere in the pattern, composing characters are ignored.
Thus only the base characters need to match, the composing characters may be
different and the number of composing characters may differ. Only relevant
when 'encoding' is "utf-8".
Technical detail: *NL-used-for-Nul*
<Nul> characters in the file are stored as <NL> in memory. In the display
they are shown as "^@". The translation is done when reading and writing
@@ -1109,7 +1129,27 @@ expect. But invalid bytes may cause trouble, a pattern with an invalid byte
will probably never match.
==============================================================================
8. Compare with Perl patterns *perl-patterns*
8. Composing characters *patterns-composing*
*/\Z*
When "\Z" appears anywhere in the pattern, composing characters are ignored.
Thus only the base characters need to match, the composing characters may be
different and the number of composing characters may differ. Only relevant
when 'encoding' is "utf-8".
When a composing character appears at the start of the pattern of after an
item that doesn't include the composing character, a match is found at any
character that includes this composing character.
When using a dot and a composing character, this works the same as the
composing character by itself, except that it doesn't matter what comes before
this.
The order of composing characters matters, even though changing the order
doen't change what a character looks like. This may change in the future.
==============================================================================
9. Compare with Perl patterns *perl-patterns*
Vim's regexes are most similar to Perl's, in terms of what you can do. The
difference between them is mostly just notation; here's a summary of where
@@ -1119,7 +1159,7 @@ Capability in Vimspeak in Perlspeak ~
----------------------------------------------------------------
force case insensitivity \c (?i)
force case sensitivity \C (?-i)
backref-less grouping \%(atom) (?:atom)
backref-less grouping \%(atom\) (?:atom)
conservative quantifiers \{-n,m} *?, +?, ??, {}?
0-width match atom\@= (?=atom)
0-width non-match atom\@! (?!atom)
@@ -1152,10 +1192,10 @@ Finally, these constructs are unique to Perl:
- \& (which is to \| what "and" is to "or"; it forces several branches
to match at one spot)
- matching lines/columns by number: \%5l \%5c \%5v
- limiting the "return value" of a regex: \zs \ze
- setting the start and end of the match: \zs \ze
==============================================================================
9. Highlighting matches *match-highlight*
10. Highlighting matches *match-highlight*
*:mat* *:match*
:mat[ch] {group} /{pattern}/
@@ -1166,14 +1206,23 @@ Finally, these constructs are unique to Perl:
< Instead of // any character can be used to mark the start and
end of the {pattern}. Watch out for using special characters,
such as '"' and '|'.
{group} must exist at the moment this command is executed.
The match overrides the 'hlsearch' highlighting.
'ignorecase' does not apply, use |/\c| in the pattern to
ignore case. Otherwise case is not ignored.
The {group} highlighting still applies when a character is
to be highlighted for 'hlsearch'.
Note that highlighting the last used search pattern with
'hlsearch' is used in all windows, while the pattern defined
with ":match" only exists in the current window. It is kept
when switching to another buffer.
The |matchparen| plugin uses match highlighting, thus will
disable your ":match" command as soon as you move to a paren.
'ignorecase' does not apply, use |/\c| in the pattern to
ignore case. Otherwise case is not ignored.
Another example, which highlights all characters in virtual
column 72 and more: >
:highlight rightMargin term=bold ctermfg=blue guifg=blue
@@ -1188,4 +1237,20 @@ Finally, these constructs are unique to Perl:
:mat[ch] none
Clear a previously defined match pattern.
:2mat[ch] {group} /{pattern}/
:2mat[ch]
:2mat[ch] none
:3mat[ch] {group} /{pattern}/
:3mat[ch]
:3mat[ch] none
Just like |:match| above, but set a separate match. Thus
there can be three matches active at the same time. The match
with the lowest number has priority if several match at the
same position.
The ":3match" command is used by the |matchparen| plugin. You
are suggested to use ":match" for manual matching and
":2match" for another plugin.
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*pi_netrw.txt* For Vim version 7.0. Last change: Nov 28, 2005
*pi_netrw.txt* For Vim version 7.0. Last change: Mar 14, 2006
VIM REFERENCE MANUAL by Charles E. Campbell, Jr.
@@ -10,27 +10,29 @@
==============================================================================
0. Contents *netrw-contents*
1. Netrw Reference......................................|netrw-ref|
CONTROLLING EXTERNAL APPLICTIONS...................|netrw-externapp|
1. Starting With Netrw.................................|netrw-start|
2. Netrw Reference......................................|netrw-ref|
CONTROLLING EXTERNAL APPLICATIONS..................|netrw-externapp|
READING............................................|netrw-read|
WRITING............................................|netrw-write|
DIRECTORY LISTING..................................|netrw-dirlist|
CHANGING THE USERID AND PASSWORD...................|netrw-chgup|
VARIABLES..........................................|netrw-variables|
PATHS..............................................|netrw-path|
2. Network-Oriented File Transfer.......................|netrw-xfer|
3. Network-Oriented File Transfer.......................|netrw-xfer|
NETRC..............................................|netrw-netrc|
PASSWORD...........................................|netrw-passwd|
3. Activation...........................................|netrw-activate|
4. Transparent File Transfer............................|netrw-transparent|
5. Ex Commands..........................................|netrw-ex|
6. Variables and Options................................|netrw-var|
7. Directory Browsing...................................|netrw-browse| {{{1
4. Activation...........................................|netrw-activate|
5. Transparent File Transfer............................|netrw-transparent|
6. Ex Commands..........................................|netrw-ex|
7. Variables and Options................................|netrw-var|
8. Directory Browsing...................................|netrw-browse| {{{1
Maps...............................................|netrw-maps|
Exploring..........................................|netrw-explore-cmds|
Quick Reference Commands Table.....................|netrw-browse-cmds|
Netrw Browser Variables............................|netrw-browse-var|
Introduction To Directory Browsing.................|netrw-browse-intro|
Netrw Browsing And Option Incompatibilities........|netrw-incompatible|
Directory Exploring Commands.......................|netrw-explore|
Refreshing The Listing.............................|netrw-ctrl-l|
Going Up...........................................|netrw--|
@@ -38,10 +40,10 @@
Obtaining A File...................................|netrw-O|
Thin, Long, and Wide Listings......................|netrw-i|
Making A New Directory.............................|netrw-d|
Deleting Files Or Directories......................|netrw-delete|
Deleting Files Or Directories......................|netrw-D|
Renaming Files Or Directories......................|netrw-move|
Hiding Files Or Directories........................|netrw-a|
Edit File Or Directory Hiding List.................|netrw-h|
Edit File Or Directory Hiding List.................|netrw-ctrl-h|
Browsing With A Horizontally Split Window..........|netrw-o|
Preview Window.....................................|netrw-p|
Selecting Sorting Style............................|netrw-s|
@@ -56,19 +58,19 @@
Changing To A Bookmarked Directory.................|netrw-B| |netrw-NB|
Listing Bookmarks And History......................|netrw-q|
Improving Directory Browsing.......................|netrw-listhack| }}}1
8. Problems and Fixes...................................|netrw-problems|
9. Debugging............................................|netrw-debug|
10. History..............................................|netrw-history|
11. Credits..............................................|netrw-credits|
9. Problems and Fixes...................................|netrw-problems|
10. Debugging............................................|netrw-debug|
11. History..............................................|netrw-history|
12. Credits..............................................|netrw-credits|
The Netrw plugin is generally sourced automatically as it is a
|standard-plugin|. That said, to make use of netrw, one must
have plugins available which can be done with the following
two lines in your <.vimrc>:
two lines in your <.vimrc>: >
set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled
<
You can avoid loading this plugin by setting the "loaded_netrw" variable
in your <.vimrc> file: >
@@ -77,14 +79,66 @@ in your <.vimrc> file: >
{Vi does not have any of this}
==============================================================================
1. Netrw Reference *netrw-ref*
1. Starting With Netrw *netrw-start*
CONTROLLING EXTERNAL APPLICTIONS *netrw-externapp*
Netrw makes reading, writing, and browsing over a network connection easy!
First, make sure that you have plugins enabled, so you'll need to have at
least the following in your <.vimrc>: (or see |netrw-activate|) >
set nocp " 'compatible' is not set
filetype plugin on " plugins are enabled
<
(see |'cp'| and |:filetype-plugin-on|)
Netrw supports "transparent" editing of files on other machines using urls
(see |netrw-transparent|). As an example of this, let's assume you have an
account on some other machine; try >
vim scp://hostname/path/to/file
<
if you have an ssh connection. Want to make ssh/scp easier to use? Check
out |netrw-listhack|!
What if you have ftp, not ssh/scp? That's easy, too; try >
vim ftp://hostname/path/to/file
<
Want to make ftp simpler to use? See if your ftp supports a file called
<.netrc> -- typically it goes in your home directory, has read/write
permissions for only the user to read (ie. not group, world, other, etc),
and has lines resembling >
machine HOSTNAME login USERID password "PASSWORD"
machine HOSTNAME login USERID password "PASSWORD"
...
default login USERID password "PASSWORD"
<
How about browsing -- ie. you just want to look around before editing a
file. For browsing on your current host, just "edit" a directory: >
vim .
vim /home/userid/path
<
For browsing on a remote host, "edit" a directory (but make sure that
the directory name is followed by a "/"): >
vim scp://hostname/
vim ftp://hostname/path/to/dir/
<
See |netrw-browse| for more!
There's more protocols supported than scp and ftp, too: see the next
section, |netrw-externapp|.
==============================================================================
2. Netrw Reference *netrw-ref*
CONTROLLING EXTERNAL APPLICATIONS *netrw-externapp*
Protocol Variable Default Value
-------- ---------------- -------------
dav: *g:netrw_dav_cmd* = "cadaver"
fetch: *g:netrw_fetch_cmd* = "fetch -o"
fetch: *g:netrw_fetch_cmd* = "fetch -o" if fetch is available
ftp: *g:netrw_ftp_cmd* = "ftp"
http: *g:netrw_http_cmd* = "fetch -o" if fetch is available
http: g:netrw_http_cmd = "wget -q -O" If wget is available
@@ -191,7 +245,7 @@ file using root-relative paths, use the full path:
<
==============================================================================
2. Network-Oriented File Transfer *netrw-xfer*
3. Network-Oriented File Transfer *netrw-xfer*
Network-oriented file transfer under Vim is implemented by a VimL-based script
(<netrw.vim>) using plugin techniques. It currently supports both reading and
@@ -337,7 +391,7 @@ However, |netrw-listhack| can help with this problem.
==============================================================================
3. Activation *netrw-activate*
4. Activation *netrw-activate*
Network-oriented file transfers are available by default whenever
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
@@ -351,7 +405,7 @@ up vim. I suggest that, at a minimum, you have at least the following in your
<
==============================================================================
4. Transparent File Transfer *netrw-transparent*
5. Transparent File Transfer *netrw-transparent*
Transparent file transfers occur whenever a regular file read or write
(invoked via an |:autocmd| for |BufReadCmd| or |BufWriteCmd| events) is made.
@@ -365,7 +419,7 @@ See |netrw-activate| for more on how to encourage your vim to use plugins
such as netrw.
==============================================================================
5. Ex Commands *netrw-ex*
6. Ex Commands *netrw-ex*
The usual read/write commands are supported. There are also a couple of
additional commands available.
@@ -403,7 +457,7 @@ additional commands available.
==============================================================================
6. Variables and Options *netrw-options* *netrw-var*
7. Variables and Options *netrw-options* *netrw-var*
The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
behavior. These variables typically may be set in the user's <.vimrc> file:
@@ -476,10 +530,10 @@ variables listed below, and may be modified by the user.
transformed however they wish
by NetReadFixup()
g:netrw_dav_cmd variable ="cadaver"
g:netrw_fetch_cmd variable ="fetch -o"
g:netrw_fetch_cmd variable ="fetch -o" if fetch is available
g:netrw_ftp_cmd variable ="ftp"
g:netrw_http_cmd variable ="fetch -o" else if fetch is executable
g:netrw_http_cmd variable ="wget -O" if wget is executable
g:netrw_http_cmd variable ="fetch -o" if fetch is available
g:netrw_http_cmd variable ="wget -O" else if wget is available
g:netrw_list_cmd variable ="ssh HOSTNAME ls -Fa"
g:netrw_rcp_cmd variable ="rcp"
g:netrw_rsync_cmd variable ="rsync -a"
@@ -488,9 +542,10 @@ variables listed below, and may be modified by the user.
-------------------------------------------------------------------------
<
*netrw-ftp*
The first two options both help with certain ftp's that give trouble
otherwise. In order to best understand how to use these options if ftp is
giving you troubles, a bit of discussion follows on how netrw does ftp reads.
The first two options (netrw_ftp and NetReadFixup) both help with certain
ftp's that give trouble otherwise. In order to best understand how to use
these options if ftp is giving you troubles, a bit of discussion follows on
how netrw does ftp reads.
The g:netrw_..._cmd variables specify the external program to use handle the
associated protocol (rcp, ftp, etc), plus any options.
@@ -572,7 +627,7 @@ itself:
>
==============================================================================
7. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
8. Directory Browsing *netrw-browse* *netrw-dir* *netrw-list* *netrw-help*
MAPS *netrw-maps*
?................Help.......................................|netrw-help|
@@ -585,7 +640,7 @@ MAPS *netrw-maps*
c................Make Browsing Directory The Current Dir....|netrw-c|
d................Make A New Directory.......................|netrw-d|
D................Deleting Files or Directories..............|netrw-D|
<c-h>............Edit File/Directory Hiding List............|netrw-h|
<c-h>............Edit File/Directory Hiding List............|netrw-ctrl-h|
i................Long Listing...............................|netrw-i|
<c-l>............Refreshing the Listing.....................|netrw-ctrl-l|
o................Browsing with a Horizontal Split...........|netrw-o|
@@ -615,27 +670,38 @@ QUICK REFERENCE COMMANDS TABLE *netrw-browse-cmds*
Command Explanation
------- -----------
< ? Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
d Make a directory
D Netrw will attempt to remove the file(s)/directory(ies)
R Netrw will attempt to rename the file(s)/directory(ies)
- Makes Netrw go up one directory
a Toggles between normal display,
hiding (suppress display of files matching g:netrw_list_hide)
showing (display only files which match g:netrw_list_hide)
c Make current browsing directory the current directory
<c-h> Edit file hiding list
i Toggles between long and short listing
<c-l> Causes Netrw to refresh the directory listing
<cr> Netrw will enter the directory or read the file |netrw-cr|
<del> Netrw will attempt to remove the file/directory |netrw-del|
- Makes Netrw go up one directory |netrw--|
a Toggles between normal display, |netrw-a|
hiding (suppress display of files matching g:netrw_list_hide)
showing (display only files which match g:netrw_list_hide)
b bookmark current directory; use Nb if compact listing
in use |netrw-b|
B go to previous bookmarked directory; use Nb if compact
listing is in use |netrw-B|
c Make current browsing directory the current directory |netrw-c|
d Make a directory |netrw-d|
D Netrw will attempt to remove the file(s)/directory(ies) |netrw-D|
<c-h> Edit file hiding list |netrw-ctrl-h|
i Toggles between long and short listing |netrw-i|
<c-l> Causes Netrw to refresh the directory listing |netrw-ctrl-l|
Nb Same as b, but always available |netrw-Nb|
NB Same as B, but always available |netrw-NB|
o Enter the file/directory under the cursor in a new browser
window. A horizontal split is used.
p Preview the file
r Reverse sorting order
s Select sorting style: by name, time, or file size
window. A horizontal split is used. |netrw-o|
O Obtain a file specified by cursor |netrw-O|
p Preview the file |netrw-p|
P Browse in the previously used window |netrw-P|
r Reverse sorting order |netrw-r|
R Rename the designed file(s)/directory(ies) |netrw-R|
s Select sorting style: by name, time, or file size |netrw-s|
S Specify suffix priority for name-sorting |netrw-S|
u Change to recently-visited directory |netrw-u|
U Change to subsequently-visited directory |netrw-U|
v Enter the file/directory under the cursor in a new browser
window. A vertical split is used.
x Apply a function to a file.
window. A vertical split is used. |netrw-v|
x Apply a function to a file. (special browsers) |netrw-x|
NETRW BROWSER VARIABLES *netrw-browse-var*
>
@@ -650,6 +716,40 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
by setting this variable (see |netrw-v|)
default: =0
*g:netrw_browse_split* when browsing, <cr> will open the file by:
=0: re-using the same window
=1: horizontally splitting the window first
=2: vertically splitting the window first
*g:netrw_browsex_viewer* specify user's preference for a viewer: >
"kfmclient exec"
"gnome-open"
< If >
"-"
< is used, then netrwFileHandler() will look for
a script/function to handle the given
extension. (see |netrw_filehandler|).
*g:netrw_fastbrowse* =0: slow speed browsing, never re-use
directory listings; always obtain
directory listings.
=1: medium speed browsing, re-use directory
listings only when remote browsing.
(default value)
=2: fast browsing, only obtains directory
listings when the directory hasn't been
seen before (or |netrw-ctrl-l| is used).
Fast browsing retains old directory listing
buffers so that they don't need to be
re-acquired. This feature is especially
important for remote browsing. However, if
a file is introduced or deleted into or from
such directories, the old directory buffer
becomes out-of-date. One may always refresh
such a directory listing with |netrw-ctrl-l|.
This option gives the choice of the trade-off
between accuracy and speed to the user.
*g:netrw_ftp_browse_reject* ftp can produce a number of errors and warnings
that can show up as "directories" and "files"
in the listing. This pattern is used to
@@ -741,6 +841,12 @@ NETRW BROWSER VARIABLES *netrw-browse-var*
*g:netrw_winsize* specify initial size of new o/v windows
default: ""
*g:DrChipTopLvlMenu* This variable specifies the top level
submenu name; by default, its "DrChip.".
If you wish to change this, do so in your
.vimrc. It affects all of my plugins which
have menus.
INTRODUCTION TO DIRECTORY BROWSING *netrw-browse-intro*
Netrw supports the browsing of directories on the local system and on remote
@@ -765,6 +871,18 @@ For local directories, the trailing slash is not required.
If you'd like to avoid entering the password in for remote directory listings
with ssh or scp, see |netrw-listhack|.
NETRW BROWSING AND OPTION INCOMPATIBILITIES *netrw-incompatible*
Netrw will not work properly with >
:set acd
:set fo=...ta...
<
If either of these options are present when browsing is attempted, netrw
will change them by using noacd and removing the ta suboptions from the
|'formatoptions'|.
*netrw-explore* *netrw-pexplore*
*netrw-hexplore* *netrw-sexplore*
DIRECTORY EXPLORING COMMANDS *netrw-nexplore* *netrw-vexplore*
@@ -866,6 +984,11 @@ protocol given in the original read request.
or more spaces embedded in it, or any trailing spaces, then you'll need to
use the "thin" format to select it.
The |g:netrw_browse_split| option, which is zero by default, may be used to
cause the opening of files to be done in a new window. The splitting will
be done horizontally if the option is one and vertically if the option is
two.
OBTAINING A FILE *netrw-O*
@@ -921,7 +1044,7 @@ directory. Attempts to make a local directory that already exists (as either
a file or a directory) will be detected, reported on, and ignored.
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D*
DELETING FILES OR DIRECTORIES *netrw-delete* *netrw-D* *netrw-del*
Deleting/removing files and directories involves moving the cursor to the
file/directory to be deleted and pressing "D". Directories must be empty
@@ -971,7 +1094,7 @@ ways: ignore it, hide files which match, and show only those files which
match. The "a" map allows the user to cycle about these three ways.
The g:netrw_list_hide variable holds a comma delimited list of patterns (ex.
\.obj) which specify the hiding list. (also see |netrw-h|) To set the hiding
\.obj) which specify the hiding list. (also see |netrw-ctrl-h|) To set the hiding
list, use the <c-h> map. As an example, to hide files which begin with a ".",
one may use the <c-h> map to set the hiding list to '^\..*' (or one may put
let g:netrw_list_hide= '^\..*' in one's <.vimrc>). One may then use the "a"
@@ -979,7 +1102,7 @@ key to show all files, hide matching files, or to show only the matching
files.
EDIT FILE OR DIRECTORY HIDING LIST *netrw-h* *netrw-edithide*
EDIT FILE OR DIRECTORY HIDING LIST *netrw-ctrl-h* *netrw-edithide*
The "<ctrl-h>" map brings up a requestor allowing the user to change the
file/directory hiding list. The hiding list consists of one or more patterns
@@ -1009,6 +1132,20 @@ One may use a preview window (currently only for local browsing) by using the
"p" key when the cursor is atop the desired filename to be previewed.
PREVIOUS WINDOW *netrw-P* *netrw-prvwin*
To edit a file or directory in the previously used window (see :he |CTRL-W_P|),
press a "P". If there's only one window, then the one window will be
horizontally split (above/below splitting is controlled by |g:netrw_alto|,
and its initial size is controlled by |g:netrw_winsize|).
If there's more than one window, the previous window will be re-used on
the selected file/directory. If the previous window's associated buffer
has been modified, and there's only one window with that buffer, then
the user will be asked if s/he wishes to save the buffer first (yes,
no, or cancel).
SELECTING SORTING STYLE *netrw-s* *netrw-sort*
One may select the sorting style by name, time, or (file) size. The "s" map
@@ -1068,15 +1205,30 @@ window and cursor at the right, have
in your <.vimrc>.
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler*
CUSTOMIZING BROWSING WITH A USER FUNCTION *netrw-x* *netrw-handler* *gx*
One may "enter" a file with a special handler, thereby firing up a browser or
other application, for example, on a file by hitting the "x" key. The special
handler varies:
Certain files, such as html, gif, jpeg, (word/office) doc, etc, files, are
best seen with a special handler (ie. a tool provided with your computer).
Netrw allows one to invoke such special handlers by: >
* when Exploring, hit the "x" key
* when editing, hit gx with the cursor atop the special filename
<
Netrw determines which special handler by the following method:
* if |g:netrw_browsex_viewer| exists, then it will be used to attempt to
view files. Examples of useful settings (place into your <.vimrc>): >
:let g:netrw_browsex_viewer= "kfmclient exec"
< or >
:let g:netrw_browsex_viewer= "gnome-open"
<
If g:netrw_browsex_viewer == '-', then netrwFileHandler() will be
invoked first (see |netrw_filehandler|).
* for Windows 32 or 64, the url and FileProtocolHandler dlls are used.
* for KDE (with kfmclient): kfmclient is used.
* for Gnome (with gnome-open): gnome-open is used.
* for KDE (with kfmclient): kfmclient is used.
* otherwise the netrwFileHandler plugin is used.
The file's suffix is used by these various approaches to determine an
@@ -1084,6 +1236,7 @@ appropriate application to use to "handle" these files. Such things as
OpenOffice (*.sfx), visualization (*.jpg, *.gif, etc), and PostScript (*.ps,
*.eps) can be handled.
*netrw_filehandler*
The netrwFileHandler applies a user-defined function to a file, based on its
extension. Of course, the handler function must exist for it to be called!
>
@@ -1093,10 +1246,12 @@ extension. Of course, the handler function must exist for it to be called!
See the <plugin/netrwFileHandlers.vim> for an example of how to handle an html
file with mozilla.
One may write custom netrwFileHandlers; please look at the
plugin/netrwFileHandlers.vim script for examples. If its likely to be
generally useful, please feel free to forward a copy to me for future
inclusion in the distribution.
One may write custom netrwFileHandlers; please look at the >
plugin/netrwFileHandlers.vim
script for examples. If its likely to be generally useful, please feel free
to forward a copy to me for future inclusion in the distribution.
MAKING THE BROWSING DIRECTORY THE CURRENT DIRECTORY *netrw-c* *netrw-curdir*
@@ -1168,7 +1323,7 @@ help on what each of the variables do.
==============================================================================
8. Problems and Fixes *netrw-problems*
9. Problems and Fixes *netrw-problems*
(This section is likely to grow as I get feedback)
(also see |netrw-debug|)
@@ -1233,7 +1388,7 @@ help on what each of the variables do.
==============================================================================
9. Debugging *netrw-debug*
10. Debugging *netrw-debug*
The <netrw.vim> script is typically available as:
>
@@ -1282,8 +1437,35 @@ which is loaded automatically at startup (assuming :set nocp).
NdrOchip at ScampbellPfamily.AbizM - NOSPAM
==============================================================================
10. History *netrw-history*
11. History *netrw-history* {{{1
v81: * FocusGained also used to refresh/wipe local browser directory
buffers
* (bugfix) netrw was leaving [Scratch] buffers behind when the
the user had the "hidden" option set. The 'hidden' option is
now bypassed.
v80: * ShellCmdPost event used in conjunction with g:netrw_fastbrowse
to refresh/wipe local browser directory buffers.
v79: * directories are now displayed with nowrap
* (bugfix) if the column width was smaller than the largest
file's name, then netrw would hang when using wide-listing
mode - fixed
* g:netrw_fastbrowse introduced
v78: * progress has been made on allowing spaces inside directory
names for remote work (reading, writing, browsing). (scp)
v77: * Mikolaj Machowski fixed a bug in a substitute command
* g:netrw_browsex_viewer implemented
* Mikolaj Machowski pointed out that gnome-open is often
executable under KDE systems, although it is effectively
not functional. NetBrowseX now looks for "kicker" as
a running process to determine if KDE is actually the
really running.
* Explorer's O functionality was inadvertently left out.
Netrw now does the same thing, but with the "P" key.
* added g:netrw_browse_split option
* fixed a bug where the directory contained a "." but
the file didn't (was treating the dirname from "."
onwards as a suffix)
v76: * "directory is missing" error message now restores echo
highlighting
v75: * file://... now conforms to RFC2396 (thanks to S. Zacchiroli)
@@ -1475,7 +1657,7 @@ which is loaded automatically at startup (assuming :set nocp).
==============================================================================
11. Credits *netrw-credits*
11. Credits *netrw-credits* {{{1
Vim editor by Bram Moolenaar (Thanks, Bram!)
dav support by C Campbell

42
runtime/doc/pi_paren.txt Normal file
View File

@@ -0,0 +1,42 @@
*pi_paren.txt* For Vim version 7.0aa. Last change: 2006 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
Highlighting matching parens *matchparen*
The functionality mentioned here is a |standard-plugin|.
This plugin is only available if 'compatible' is not set.
You can avoid loading this plugin by setting the "loaded_matchparen" variable: >
:let loaded_matchparen = 1
The plugin installs CursorMoved autocommands to redefine the match
highlighting.
To disable the plugin after it was loaded use this command: >
:NoMatchParen
And to enable it again: >
:DoMatchParen
The highlighting used is MatchParen. You can specify different colors with
the ":highlight" command. Example: >
:hi MatchParen ctermbg=blue guibg=lightblue
The characters to be matched come from the 'matchpairs' option. You can
change the value to highlight different matches. Note that not everything is
possible. For example, you can't highlight single or double quotes, because
the start and end are equal.
The syntax highlighting attributes are used. When the cursor currently is not
in a string or comment syntax item, then matches inside string and comment
syntax items are ignored. Any syntax items with "string" or "comment"
somewhere in their name are considered string or comment items.
==============================================================================
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,9 +1,9 @@
*tar.txt* Tar File Interface Nov 22, 2005
*tar.txt* Tar File Interface Dec 21, 2005
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: The GPL (gnu public license) applies to *tar-copyright*
tarPlugin.vim, and tar.txt.
tarPlugin.vim, and pi_tar.txt.
No warranty, express or implied. Use At-Your-Own-Risk.
==============================================================================
@@ -23,6 +23,8 @@ Copyright: The GPL (gnu public license) applies to *tar-copyright*
==============================================================================
3. History *tar-history*
v6 Dec 21, 2005 * writing to files not in directories caused problems -
fixed (pointed out by Christian Robinson)
v5 Nov 22, 2005 * report option workaround installed
v3 Sep 16, 2005 * handles writing files in an archive back to the
archive

View File

@@ -1,4 +1,4 @@
*zip.txt* Zip File Interface Nov 22, 2005
*zip.txt* Zip File Interface Nov 28, 2005
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
@@ -6,10 +6,11 @@ Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 *zip-copyright*
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,
zip.vim and zipPlugin.vim are 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.
zip.vim, zipPlugin.vim, and pi_zip.txt are provided *as is*
and it 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.
==============================================================================
1. Contents *zip* *zip-contents*
@@ -28,6 +29,8 @@ Copyright: Copyright (C) 2005 Charles E. Campbell, Jr. {{{1 *zip-copyright*
==============================================================================
3. History *zip-history*
v6 Dec 21, 2005 * writing to files not in directories caused problems -
fixed (pointed out by Christian Robinson)
v5 Nov 22, 2005 * report option workaround installed
v3 Oct 18, 2005 * <amatch> used instead of <afile> in autocmds
v2 Sep 16, 2005 * silenced some commands (avoiding hit-enter prompt)

View File

@@ -1,4 +1,4 @@
*quickfix.txt* For Vim version 7.0aa. Last change: 2005 Sep 27
*quickfix.txt* For Vim version 7.0aa. Last change: 2006 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -42,7 +42,19 @@ easy way to do this is with the |:make| command (see below). The
'errorformat' option should be set to match the error messages from your
compiler (see |errorformat| below).
The following quickfix commands can be used:
*location-list* *E776*
A location list is similar to a quickfix list and contains a list of positions
in files. A location list is associated with a window and each window can
have a separate location list. A location list can be associated with only
one window. The location list is independent of the quickfix list.
When a window with a location list is split, the new window gets a copy of the
location list. When there are no references to a location list, the location
list is destroyed.
The following quickfix commands can be used. The location list commands are
similar to the quickfix commands, replacing the 'c' prefix in the quickfix
command with 'l'.
*:cc*
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
@@ -56,18 +68,32 @@ The following quickfix commands can be used:
The 'switchbuf' settings are respected when jumping
to a buffer.
*:ll*
:ll[!] [nr] Same as ":cc", except the location list for the
current window is used instead of the quickfix list.
*:cn* *:cnext* *E553*
:[count]cn[ext][!] Display the [count] next error in the list that
includes a file name. If there are no file names at
all, go to the [count] next error. See |:cc| for
[!] and 'switchbuf'.
*:lne* *:lnext*
:[count]lne[xt][!] Same as ":cnext", except the location list for the
current window is used instead of the quickfix list.
:[count]cN[ext][!] *:cp* *:cprevious* *:cN* *:cNext*
:[count]cp[revious][!] Display the [count] previous error in the list that
includes a file name. If there are no file names at
all, go to the [count] previous error. See |:cc| for
[!] and 'switchbuf'.
:[count]lN[ext][!] *:lp* *:lprevious* *:lN* *:lNext*
:[count]lp[revious][!] Same as ":cNext" and ":cprevious", except the location
list for the current window is used instead of the
quickfix list.
*:cnf* *:cnfile*
:[count]cnf[ile][!] Display the first error in the [count] next file in
the list that includes a file name. If there are no
@@ -75,6 +101,10 @@ The following quickfix commands can be used:
the [count] next error. See |:cc| for [!] and
'switchbuf'.
*:lnf* *:lnfile*
:[count]lnf[ile][!] Same as ":cnfile", except the location list for the
current window is used instead of the quickfix list.
:[count]cNf[ile][!] *:cpf* *:cpfile* *:cNf* *:cNfile*
:[count]cpf[ile][!] Display the last error in the [count] previous file in
the list that includes a file name. If there are no
@@ -82,17 +112,34 @@ The following quickfix commands can be used:
the [count] previous error. See |:cc| for [!] and
'switchbuf'.
:[count]lNf[ile][!] *:lpf* *:lpfile* *:lNf* *:lNfile*
:[count]lpf[ile][!] Same as ":cNfile" and ":cpfile", except the location
list for the current window is used instead of the
quickfix list.
*:crewind* *:cr*
:cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
error is displayed. See |:cc|.
*:lrewind* *:lr*
:lr[ewind][!] [nr] Same as ":crewind", except the location list for the
current window is used instead of the quickfix list.
*:cfirst* *:cfir*
:cfir[st][!] [nr] Same as ":crewind".
*:lfirst* *:lfir*
:lfir[st][!] [nr] Same as ":lrewind".
*:clast* *:cla*
:cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
error is displayed. See |:cc|.
*:llast* *:lla*
:lla[st][!] [nr] Same as ":clast", except the location list for the
current window is used instead of the quickfix list.
*:cq* *:cquit*
:cq[uit] Quit Vim with an error code, so that the compiler
will not compile the same file again.
@@ -105,16 +152,31 @@ The following quickfix commands can be used:
name of the errorfile, the 'errorfile' option will
be set to [errorfile]. See |:cc| for [!].
*:cg* *:cgetfile*
:cg[etfile][!] [errorfile]
*:lf* *:lfile*
:lf[ile][!] [errorfile] Same as ":cfile", except the location list for the
current window is used instead of the quickfix list.
You can not use the -q command-line option to set
the location list.
:cg[etfile][!] [errorfile] *:cg* *:cgetfile*
Read the error file. Just like ":cfile" but don't
jump to the first error.
*:cad* *:caddfile*
:cad[dfile] [errorfile] Read the error file and add the errors from the
:lg[etfile][!] [errorfile] *:lg* *:lgetfile*
Same as ":cgetfile", except the location list for the
current window is used instead of the quickfix list.
*:caddf* *:caddfile*
:caddf[ile] [errorfile] Read the error file and add the errors from the
errorfile to the current quickfix list. If a quickfix
list is not present, then a new list is created.
*:laddf* *:laddfile*
:laddf[ile] [errorfile] Same as ":caddfile", except the location list for the
current window is used instead of the quickfix list.
*:cb* *:cbuffer* *E681*
:cb[uffer] [bufnr] Read the error list from the current buffer.
When [bufnr] is given it must be the number of a
@@ -123,19 +185,52 @@ The following quickfix commands can be used:
A range can be specified for the lines to be used.
Otherwise all lines in the buffer are used.
*:cex* *:cexpr*
:cex[pr][!] {expr} Create a quickfix list using the result of {expr}.
If {expr} is a String, then each new-line terminated
line in the String is processed using 'errorformat'
and the result is added to the quickfix list.
If {expr} is a List, then each String item in the list
is processed and added to the quickfix list.
Non String items in the List are ignored. See |:cc|
*:lb* *:lbuffer*
:lb[uffer] [bufnr] Same as ":cbuffer", except the location list for the
current window is used instead of the quickfix list.
*:caddb* *:caddbuffer*
:caddb[uffer] [bufnr] Read the error list from the current buffer and add
the errors to the current quickfix list. If a
quickfix list is not present, then a new list is
created. Otherwise, same as ":cbuffer".
*:laddb* *:laddbuffer*
:laddb[uffer] [bufnr] Same as ":caddbuffer", except the location list for
the current window is used instead of the quickfix
list.
*:cex* *:cexpr* *E777*
:cex[pr][!] {expr} Create a quickfix list using the result of {expr} and
jump to the first error. If {expr} is a String, then
each new-line terminated line in the String is
processed using 'errorformat' and the result is added
to the quickfix list. If {expr} is a List, then each
String item in the list is processed and added to the
quickfix list. Non String items in the List are
ignored. See |:cc|
for [!].
Examples: >
:cexpr system('grep -n xyz *')
:cexpr getline(1, '$')
<
*:lex* *:lexpr*
:lex[pr][!] {expr} Same as ":cexpr", except the location list for the
current window is used instead of the quickfix list.
*:cad* *:caddexpr*
:cad[dexpr][!] {expr} Evaluate {expr} and add the resulting lines to the
current quickfix list. If a quickfix list is not
present, then a new list is created. The current
cursor position will not be changed. See |:cexpr| for
more information.
Example: >
:g/mypattern/caddexpr expand("%") . ":" . line(".") . ":" . getline(".")
<
*:lad* *:laddexpr*
:lad[dexpr][!] {expr} Same as ":caddexpr", except the location list for the
current window is used instead of the quickfix list.
*:cl* *:clist*
:cl[ist] [from] [, [to]]
List all errors that are valid |quickfix-valid|.
@@ -148,6 +243,15 @@ The following quickfix commands can be used:
:cl[ist]! [from] [, [to]]
List all errors.
*:lli* *:llist*
:lli[st] [from] [, [to]]
Same as ":clist", except the location list for the
current window is used instead of the quickfix list.
:lli[st]! [from] [, [to]]
List all the entries in the location list for the
current window.
If you insert or delete lines, mostly the correct error location is still
found because hidden marks are used. Sometimes, when the mark has been
deleted for some reason, the message "line changed" is shown to warn you that
@@ -172,14 +276,28 @@ on) is executed. See |QuickFixCmdPre| and |QuickFixCmdPost| for details.
the current window. It is not possible to open a
second quickfix window.
*:lop* *:lopen*
:lop[en] [height] Open a window to show the location list for the
current window. Works only when the location list for
the current window is present. You can have more than
one location window opened at a time. Otherwise, it
acts the same as ":copen".
*:ccl* *:cclose*
:ccl[ose] Close the quickfix window.
*:lcl* *:lclose*
:lcl[ose] Close the window showing the location list for the
current window.
*:cw* *:cwindow*
:cw[indow] [height] Open the quickfix window when there are recognized
errors. If the window is already open and there are
no recognized errors, close the window.
*:lw* *:lwindow*
:lw[indow] [height] Same as ":cwindow", except use the window showing the
location list for the current window.
Normally the quickfix window is at the bottom of the screen. If there are
vertical splits, it's at the bottom of the rightmost column of windows. To
@@ -204,14 +322,17 @@ You can use CTRL-W <Enter> to open a new window and jump to the error there.
When the quickfix window has been filled, two autocommand events are
triggered. First the 'filetype' option is set to "qf", which triggers the
FileType event. Then the BufReadPost event is triggered. This can be used to
perform some action on the listed errors. Example: >
au BufReadPost quickfix setlocal nomodifiable
\ | silent g/^/s//\=line(".")." "/
\ | setlocal modifiable
FileType event. Then the BufReadPost event is triggered, using "quickfix" for
the buffer name. This can be used to perform some action on the listed
errors. Example: >
au BufReadPost quickfix setlocal modifiable
\ | silent exe 'g/^/s//\=line(".")." "/'
\ | setlocal nomodifiable
This prepends the line number to each line. Note the use of "\=" in the
substitute string of the ":s" command, which is used to evaluate an
expression.
The BufWinEnter event is also triggered, again using "quickfix" for the buffer
name.
Note: Making changes in the quickfix window has no effect on the list of
errors. 'modifiable' is off to avoid making changes. If you delete or insert
@@ -220,6 +341,29 @@ If you really want to do this, you could write the contents of the quickfix
window to a file and use ":cfile" to have it parsed and used as the new error
list.
*location-list-window*
The location list window displays the entries in a location list. When you
open a location list window, it is created below the current window and
displays the location list for the current window. The location list window
is similar to the quickfix window, except that you can have more than one
location list window open at a time. When you use a location list command in
this window, the displayed location list is used.
When you select a file from the location list window, the following steps are
used to find a window to edit the file:
1. If a window with the location list displayed in the location list window is
present, then the file is opened in that window.
2. If the above step fails and if the file is already opened in another
window, then that window is used.
3. If the above step fails then an existing window showing a buffer with
'buftype' not set is used.
4. If the above step fails, then the file is edited in a new window.
In all of the above cases, if the location list for the selected window is not
yet set, then it is set to the location list displayed in the location list
window.
=============================================================================
3. Using more than one list of errors *quickfix-error-lists*
@@ -233,11 +377,19 @@ lists. They set one of the existing error lists as the current one.
this [count] times. When already at the oldest error
list, an error message is given.
*:lolder* *:lol*
:lol[der] [count] Same as ":colder", except use the location list for
the current window instead of the quickfix list.
*:cnewer* *:cnew* *E381*
:cnew[er] [count] Go to newer error list. When [count] is given, do
this [count] times. When already at the newest error
list, an error message is given.
*:lnewer* *:lnew*
:lnew[er] [count] Same as ":cnewer", except use the location list for
the current window instead of the quickfix list.
When adding a new error list, it becomes the current list.
When ":colder" has been used and ":make" or ":grep" is used to add a new error
@@ -271,6 +423,11 @@ lists, use ":cnewer 99" first.
This command does not accept a comment, any "
characters are considered part of the arguments.
*:lmak* *:lmake*
:lmak[e][!] [arguments]
Same as ":make", except the location list for the
current window is used instead of the quickfix list.
The ":make" command executes the command given with the 'makeprg' option.
This is done by passing the command to the shell given with the 'shell'
option. This works almost like typing
@@ -321,8 +478,13 @@ advantages are:
- Uses Vim search patterns. Multi-line patterns can be used.
- When plugins are enabled: compressed and remote files can be searched.
|gzip| |netrw|
- When 'hidden' is set the files are kept loaded, thus repeating a search is
much faster. Uses a lot of memory though!
To be able to do this Vim loads each file as if it is being edited. When
there is no match in the file the associated buffer is wiped out again. The
'hidden' option is ignored here to avoid running out of memory or file
descriptors when searching many files. However, when the |:hide| command
modifier is used the buffers are kept loaded. This makes following searches
in the same files a lot faster.
5.1 using Vim's internal grep
@@ -342,6 +504,12 @@ advantages are:
pattern to ignore case or |/\C| to match case.
'smartcase' is not used.
When a number is put before the command this is used
as the maximum number of matches to find. Use
":1vimgrep pattern file" to find only the first.
Useful if you only want to check if there is a match
and quit quickly when it's found.
Without the 'j' flag Vim jumps to the first match.
With 'j' only the quickfix list is updated.
With the [!] any changes in the current buffer are
@@ -362,6 +530,12 @@ advantages are:
Example: >
:vimgrep Error *.c
<
*:lv* *:lvimgrep*
:lv[imgrep][!] /{pattern}/[g][j] {file} ...
:lv[imgrep][!] {pattern} {file} ...
Same as ":vimgrep", except the location list for the
current window is used instead of the quickfix list.
*:vimgrepa* *:vimgrepadd*
:vimgrepa[dd][!] /{pattern}/[g][j] {file} ...
:vimgrepa[dd][!] {pattern} {file} ...
@@ -369,6 +543,12 @@ advantages are:
of errors the matches are appended to the current
list.
*:lvimgrepa* *:lvimgrepadd*
:lvimgrepa[dd][!] /{pattern}/[g][j] {file} ...
:lvimgrepa[dd][!] {pattern} {file} ...
Same as ":vimgrepadd", except the location list for
the current window is used instead of the quickfix
list.
5.2 External grep
@@ -384,6 +564,11 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
When 'grepprg' is "internal" this works like
|:vimgrep|. Note that the pattern needs to be
enclosed in separator characters then.
*:lgr* *:lgrep*
:lgr[ep][!] [arguments] Same as ":grep", except the location list for the
current window is used instead of the quickfix list.
*:grepa* *:grepadd*
:grepa[dd][!] [arguments]
Just like ":grep", but instead of making a new list of
@@ -397,6 +582,11 @@ id-utils) in a similar way to its compiler integration (see |:make| above).
":grepadd" jumps to the first error, which is not
allowed with |:bufdo|.
*:lgrepa* *:lgrepadd*
:lgrepa[dd][!] [arguments]
Same as ":grepadd", except the location list for the
current window is used instead of the quickfix list.
5.3 Setting up external grep
If you have a standard "grep" program installed, the :grep command may work
@@ -688,17 +878,20 @@ prefixes are:
%W start of a multi-line warning message
%I start of a multi-line informational message
%A start of a multi-line message (unspecified type)
%> for next line start with current pattern again |efm-%>|
%C continuation of a multi-line message
%Z end of a multi-line message
These can be used with '+' and '-', see |efm-ignore| below.
Using "\n" in the pattern won't work to match multi-line messages.
Example: Your compiler happens to write out errors in the following format
(leading line numbers not being part of the actual output):
1 Error 275
2 line 42
3 column 3
4 ' ' expected after '--'
1 Error 275 ~
2 line 42 ~
3 column 3 ~
4 ' ' expected after '--' ~
The appropriate error format string has to look like this: >
:set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
@@ -737,6 +930,27 @@ starting with a space, followed by any characters to the end of the line,
it also hides line 7 which would trigger a separate error message otherwise.
Error format strings are always parsed pattern by pattern until the first
match occurs.
*efm-%>*
The %> item can be used to avoid trying patterns that appear earlier in
'errorformat'. This is useful for patterns that match just about anything.
For example, if the error looks like this:
Error in line 123 of foo.c: ~
unknown variable "i" ~
This can be found with: >
:set efm=xxx,%E%>Error in line %l of %f:,%Z%m
Where "xxx" has a pattern that would also match the second line.
Important: There is no memory of what part of the errorformat matched before;
every line in the error file gets a complete new run through the error format
lines. For example, if one has: >
setlocal efm=aa,bb,cc,dd,ee
Where aa, bb, etc. are error format strings. Each line of the error file will
be matched to the pattern aa, then bb, then cc, etc. Just because cc matched
the previous error line does _not_ mean that dd will be tried first on the
current line, even if cc and dd are multi-line errorformat strings.
Separate file name *errorformat-separate-filename*
@@ -804,14 +1018,16 @@ with previous versions of Vim. However, it is also possible to specify
Since meta characters of the regular expression language can be part of
ordinary matching strings or file names (and therefore internally have to
be escaped), meta symbols have to be written with leading '%':
%\ the single '\' character. Note that this has to be
%\ The single '\' character. Note that this has to be
escaped ("%\\") in ":set errorformat=" definitions.
%. the single '.' character.
%# the single '*'(!) character.
%^ the single '^' character.
%$ the single '$' character.
%[ the single '[' character for a [] character range.
%~ the single '~' character.
%. The single '.' character.
%# The single '*'(!) character.
%^ The single '^' character. Note that this is not
useful, the pattern already matches start of line.
%$ The single '$' character. Note that this is not
useful, the pattern already matches end of line.
%[ The single '[' character for a [] character range.
%~ The single '~' character.
When using character classes in expressions (see |/\i| for an overview),
terms containing the "\+" quantifier can be written in the scanf() "%*"
notation. Example: "%\\d%\\+" ("\d\+", "any number") is equivalent to "%*\\d".

View File

@@ -1,4 +1,4 @@
*quickref.txt* For Vim version 7.0aa. Last change: 2005 Nov 25
*quickref.txt* For Vim version 7.0aa. Last change: 2006 Mar 18
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -211,6 +211,8 @@ N is used to indicate an optional count that can be given before the command.
|:ts| :ts[elect][!] [tag] List matching tags and select one to jump to
|:tjump| :tj[ump][!] [tag] Jump to tag [tag] or select from list when
there are multiple matches
|:ltag| :lt[ag][!] [tag] Jump to tag [tag] and add matching tags to the
location list.
|:tags| :tags Print tag list
|CTRL-T| N CTRL-T Jump back from Nth older tag in tag list
@@ -586,335 +588,346 @@ In Insert or Command-line mode:
the help.
Short explanation of each option: *option-list*
|'aleph'| |'al'| ASCII code of the letter Aleph (Hebrew)
|'allowrevins'| |'ari'| allow CTRL-_ in Insert and Command-line mode
|'altkeymap'| |'akm'| for default second language (Farsi/Hebrew)
|'ambiwidth'| |'ambw'| what to do with Unicode chars of ambiguous width
|'antialias'| |'anti'| Mac OS X: use smooth, antialiased fonts
|'autochdir'| |'acd'| change directory to the file in the current window
|'arabic'| |'arab'| for Arabic as a default second language
|'arabicshape'| |'arshape'| do shaping for Arabic characters
|'autoindent'| |'ai'| take indent for new line from previous line
|'autoread'| |'ar'| autom. read file when changed outside of Vim
|'autowrite'| |'aw'| automatically write file if changed
|'autowriteall'| |'awa'| as 'autowrite', but works with more commands
|'background'| |'bg'| "dark" or "light", used for highlight colors
|'backspace'| |'bs'| how backspace works at start of line
|'backup'| |'bk'| keep backup file after overwriting a file
|'backupcopy'| |'bkc'| make backup as a copy, don't rename the file
|'backupdir'| |'bdir'| list of directories for the backup file
|'backupext'| |'bex'| extension used for the backup file
|'backupskip'| |'bsk'| no backup for files that match these patterns
|'balloondelay'| |'bdlay'| delay in mS before a balloon may pop up
|'ballooneval'| |'beval'| switch on balloon evaluation
|'balloonexpr'| |'bexpr'| expression to show in balloon
|'binary'| |'bin'| read/write/edit file in binary mode
|'bioskey'| |'biosk'| MS-DOS: use bios calls for input characters
|'bomb'| prepend a Byte Order Mark to the file
|'breakat'| |'brk'| characters that may cause a line break
|'browsedir'| |'bsdir'| which directory to start browsing in
|'bufhidden'| |'bh'| what to do when buffer is no longer in window
|'buflisted'| |'bl'| whether the buffer shows up in the buffer list
|'buftype'| |'bt'| special type of buffer
|'casemap'| |'cmp'| specifies how case of letters is changed
|'cdpath'| |'cd'| list of directories searched with ":cd"
|'cedit'| key used to open the command-line window
|'charconvert'| |'ccv'| expression for character encoding conversion
|'cindent'| |'cin'| do C program indenting
|'cinkeys'| |'cink'| keys that trigger indent when 'cindent' is set
|'cinoptions'| |'cino'| how to do indenting when 'cindent' is set
|'cinwords'| |'cinw'| words where 'si' and 'cin' add an indent
|'clipboard'| |'cb'| use the clipboard as the unnamed register
|'cmdheight'| |'ch'| number of lines to use for the command-line
|'cmdwinheight'| |'cwh'| height of the command-line window
|'columns'| |'co'| number of columns in the display
|'comments'| |'com'| patterns that can start a comment line
|'commentstring'| |'cms'| template for comments; used for fold marker
|'compatible'| |'cp'| behave Vi-compatible as much as possible
|'complete'| |'cpt'| specify how Insert mode completion works
|'completefunc'| |'cfu'| function to be used for Insert mode completion
|'completeopt'| |'cot'| options for Insert mode completion
|'confirm'| |'cf'| ask what to do about unsaved/read-only files
|'conskey'| |'consk'| get keys directly from console (MS-DOS only)
|'copyindent'| |'ci'| make 'autoindent' use existing indent structure
|'cpoptions'| |'cpo'| flags for Vi-compatible behavior
|'cscopepathcomp'| |'cspc'| how many components of the path to show
|'cscopeprg'| |'csprg'| command to execute cscope
|'cscopequickfix'| |'csqf'| use quickfix window for cscope results
|'cscopetag'| |'cst'| use cscope for tag commands
|'cscopetagorder'| |'csto'| determines ":cstag" search order
|'cscopeverbose'| |'csverb'| give messages when adding a cscope database
|'debug'| set to "msg" to see all error messages
|'define'| |'def'| pattern to be used to find a macro definition
|'delcombine'| |'deco'| delete combining characters on their own
|'dictionary'| |'dict'| list of file names used for keyword completion
|'diff'| use diff mode for the current window
|'diffexpr'| |'dex'| expression used to obtain a diff file
|'diffopt'| |'dip'| options for using diff mode
|'digraph'| |'dg'| enable the entering of digraphs in Insert mode
|'directory'| |'dir'| list of directory names for the swap file
|'display'| |'dy'| list of flags for how to display text
|'eadirection'| |'ead'| in which direction 'equalalways' works
|'edcompatible'| |'ed'| toggle flags of ":substitute" command
|'encoding'| |'enc'| encoding used internally
|'endofline'| |'eol'| write <EOL> for last line in file
|'equalalways'| |'ea'| windows are automatically made the same size
|'equalprg'| |'ep'| external program to use for "=" command
|'errorbells'| |'eb'| ring the bell for error messages
|'errorfile'| |'ef'| name of the errorfile for the QuickFix mode
|'errorformat'| |'efm'| description of the lines in the error file
|'esckeys'| |'ek'| recognize function keys in Insert mode
|'eventignore'| |'ei'| autocommand events that are ignored
|'expandtab'| |'et'| use spaces when <Tab> is inserted
|'exrc'| |'ex'| read .vimrc and .exrc in the current directory
|'fileencoding'| |'fenc'| file encoding for multi-byte text
|'fileencodings'| |'fencs'| automatically detected character encodings
|'fileformat'| |'ff'| file format used for file I/O
|'fileformats'| |'ffs'| automatically detected values for 'fileformat'
|'filetype'| |'ft'| type of file, used for autocommands
|'fillchars'| |'fcs'| characters to use for displaying special items
|'fkmap'| |'fk'| Farsi keyboard mapping
|'foldclose'| |'fcl'| close a fold when the cursor leaves it
|'foldcolumn'| |'fdc'| width of the column used to indicate folds
|'foldenable'| |'fen'| set to display all folds open
|'foldexpr'| |'fde'| expression used when 'foldmethod' is "expr"
|'foldignore'| |'fdi'| ignore lines when 'foldmethod' is "indent"
|'foldlevel'| |'fdl'| close folds with a level higher than this
|'foldlevelstart'| |'fdls'| 'foldlevel' when starting to edit a file
|'foldmarker'| |'fmr'| markers used when 'foldmethod' is "marker"
|'foldmethod'| |'fdm'| folding type
|'foldminlines'| |'fml'| minimum number of lines for a fold to be closed
|'foldnestmax'| |'fdn'| maximum fold depth
|'foldopen'| |'fdo'| for which commands a fold will be opened
|'foldtext'| |'fdt'| expression used to display for a closed fold
|'formatlistpat'| |'flp'| pattern used to recognize a list header
|'formatoptions'| |'fo'| how automatic formatting is to be done
|'formatprg'| |'fp'| name of external program used with "gq" command
|'fsync'| |'fs'| whether to invoke fsync() after file write
|'gdefault'| |'gd'| the ":substitute" flag 'g' is default on
|'grepformat'| |'gfm'| format of 'grepprg' output
|'grepprg'| |'gp'| program to use for ":grep"
|'guicursor'| |'gcr'| GUI: settings for cursor shape and blinking
|'guifont'| |'gfn'| GUI: Name(s) of font(s) to be used
|'guifontset'| |'gfs'| GUI: Names of multi-byte fonts to be used
|'guifontwide'| |'gfw'| list of font names for double-wide characters
|'guiheadroom'| |'ghr'| GUI: pixels room for window decorations
|'guioptions'| |'go'| GUI: Which components and options are used
|'guipty'| GUI: try to use a pseudo-tty for ":!" commands
|'helpfile'| |'hf'| full path name of the main help file
|'helpheight'| |'hh'| minimum height of a new help window
|'helplang'| |'hlg'| preferred help languages
|'hidden'| |'hid'| don't unload buffer when it is |abandon|ed
|'highlight'| |'hl'| sets highlighting mode for various occasions
|'hlsearch'| |'hls'| highlight matches with last search pattern
|'history'| |'hi'| number of command-lines that are remembered
|'hkmap'| |'hk'| Hebrew keyboard mapping
|'hkmapp'| |'hkp'| phonetic Hebrew keyboard mapping
|'icon'| let Vim set the text of the window icon
|'iconstring'| string to use for the Vim icon text
|'ignorecase'| |'ic'| ignore case in search patterns
|'imactivatekey'| |'imak'| key that activates the X input method
|'imcmdline'| |'imc'| use IM when starting to edit a command line
|'imdisable'| |'imd'| do not use the IM in any mode
|'iminsert'| |'imi'| use :lmap or IM in Insert mode
|'imsearch'| |'ims'| use :lmap or IM when typing a search pattern
|'include'| |'inc'| pattern to be used to find an include file
|'includeexpr'| |'inex'| expression used to process an include line
|'incsearch'| |'is'| highlight match while typing search pattern
|'indentexpr'| |'inde'| expression used to obtain the indent of a line
|'indentkeys'| |'indk'| keys that trigger indenting with 'indentexpr'
|'infercase'| |'inf'| adjust case of match for keyword completion
|'insertmode'| |'im'| start the edit of a file in Insert mode
|'isfname'| |'isf'| characters included in file names and pathnames
|'isident'| |'isi'| characters included in identifiers
|'iskeyword'| |'isk'| characters included in keywords
|'isprint'| |'isp'| printable characters
|'joinspaces'| |'js'| two spaces after a period with a join command
|'key'| encryption key
|'keymap'| |'kmp'| name of a keyboard mapping
|'keymodel'| |'km'| enable starting/stopping selection with keys
|'keywordprg'| |'kp'| program to use for the "K" command
|'langmap'| |'lmap'| alphabetic characters for other language mode
|'langmenu'| |'lm'| language to be used for the menus
|'laststatus'| |'ls'| tells when last window has status lines
|'lazyredraw'| |'lz'| don't redraw while executing macros
|'linebreak'| |'lbr'| wrap long lines at a blank
|'lines'| number of lines in the display
|'linespace'| |'lsp'| number of pixel lines to use between characters
|'lisp'| automatic indenting for Lisp
|'lispwords'| |'lw'| words that change how lisp indenting works
|'list'| show <Tab> and <EOL>
|'listchars'| |'lcs'| characters for displaying in list mode
|'loadplugins'| |'lpl'| load plugin scripts when starting up
|'magic'| changes special characters in search patterns
|'makeef'| |'mef'| name of the errorfile for ":make"
|'makeprg'| |'mp'| program to use for the ":make" command
|'matchpairs'| |'mps'| pairs of characters that "%" can match
|'matchtime'| |'mat'| tenths of a second to show matching paren
|'maxfuncdepth'| |'mfd'| maximum recursive depth for user functions
|'maxmapdepth'| |'mmd'| maximum recursive depth for mapping
|'maxmem'| |'mm'| maximum memory (in Kbyte) used for one buffer
|'maxmempattern'| |'mmp'| maximum memory (in Kbyte) used for pattern search
|'maxmemtot'| |'mmt'| maximum memory (in Kbyte) used for all buffers
|'menuitems'| |'mis'| maximum number of items in a menu
|'mkspellmem'| |'msm'| memory used before |:mkspell| compresses the tree
|'modeline'| |'ml'| recognize modelines at start or end of file
|'modelines'| |'mls'| number of lines checked for modelines
|'modifiable'| |'ma'| changes to the text are not possible
|'modified'| |'mod'| buffer has been modified
|'more'| pause listings when the whole screen is filled
|'mouse'| enable the use of mouse clicks
|'mousefocus'| |'mousef'| keyboard focus follows the mouse
|'mousehide'| |'mh'| hide mouse pointer while typing
|'mousemodel'| |'mousem'| changes meaning of mouse buttons
|'mouseshape'| |'mouses'| shape of the mouse pointer in different modes
|'mousetime'| |'mouset'| max time between mouse double-click
|'mzquantum'| |'mzq'| the interval between polls for MzScheme threads
|'nrformats'| |'nf'| number formats recognized for CTRL-A command
|'number'| |'nu'| print the line number in front of each line
|'numberwidth'| |'nuw'| number of columns used for the line number
|'omnifunc'| |'ofu'| function for filetype-specific completion
|'osfiletype'| |'oft'| operating system-specific filetype information
|'paragraphs'| |'para'| nroff macros that separate paragraphs
|'paste'| allow pasting text
|'pastetoggle'| |'pt'| key code that causes 'paste' to toggle
|'patchexpr'| |'pex'| expression used to patch a file
|'patchmode'| |'pm'| keep the oldest version of a file
|'path'| |'pa'| list of directories searched with "gf" et.al.
|'preserveindent'| |'pi'| preserve the indent structure when reindenting
|'previewheight'| |'pvh'| height of the preview window
|'previewwindow'| |'pvw'| identifies the preview window
|'printdevice'| |'pdev'| name of the printer to be used for :hardcopy
|'printencoding'| |'penc'| encoding to be used for printing
|'printexpr'| |'pexpr'| expression used to print PostScript for :hardcopy
|'printfont'| |'pfn'| name of the font to be used for :hardcopy
|'printheader'| |'pheader'| format of the header used for :hardcopy
|'printmbcharset'| |'pmbcs'| CJK character set to be used for :hardcopy
|'printmbfont'| |'pmbfn'| font names to be used for CJK output of :hardcopy
|'printoptions'| |'popt'| controls the format of :hardcopy output
|'quoteescape'| |'qe'| escape characters used in a string
|'readonly'| |'ro'| disallow writing the buffer
|'remap'| allow mappings to work recursively
|'report'| threshold for reporting nr. of lines changed
|'restorescreen'| |'rs'| Win32: restore screen when exiting
|'revins'| |'ri'| inserting characters will work backwards
|'rightleft'| |'rl'| window is right-to-left oriented
|'rightleftcmd'| |'rlc'| commands for which editing works right-to-left
|'ruler'| |'ru'| show cursor line and column in the status line
|'rulerformat'| |'ruf'| custom format for the ruler
|'runtimepath'| |'rtp'| list of directories used for runtime files
|'scroll'| |'scr'| lines to scroll with CTRL-U and CTRL-D
|'scrollbind'| |'scb'| scroll in window as other windows scroll
|'scrolljump'| |'sj'| minimum number of lines to scroll
|'scrolloff'| |'so'| minimum nr. of lines above and below cursor
|'scrollopt'| |'sbo'| how 'scrollbind' should behave
|'sections'| |'sect'| nroff macros that separate sections
|'secure'| secure mode for reading .vimrc in current dir
|'selection'| |'sel'| what type of selection to use
|'selectmode'| |'slm'| when to use Select mode instead of Visual mode
|'sessionoptions'| |'ssop'| options for |:mksession|
|'shell'| |'sh'| name of shell to use for external commands
|'shellcmdflag'| |'shcf'| flag to shell to execute one command
|'shellpipe'| |'sp'| string to put output of ":make" in error file
|'shellquote'| |'shq'| quote character(s) for around shell command
|'shellredir'| |'srr'| string to put output of filter in a temp file
|'shellslash'| |'ssl'| use forward slash for shell file names
|'shelltemp'| |'stmp'| whether to use a temp file for shell commands
|'shelltype'| |'st'| Amiga: influences how to use a shell
|'shellxquote'| |'sxq'| like 'shellquote', but include redirection
|'shiftround'| |'sr'| round indent to multiple of shiftwidth
|'shiftwidth'| |'sw'| number of spaces to use for (auto)indent step
|'shortmess'| |'shm'| list of flags, reduce length of messages
|'shortname'| |'sn'| non-MS-DOS: Filenames assumed to be 8.3 chars
|'showbreak'| |'sbr'| string to use at the start of wrapped lines
|'showcmd'| |'sc'| show (partial) command in status line
|'showfulltag'| |'sft'| show full tag pattern when completing tag
|'showmatch'| |'sm'| briefly jump to matching bracket if insert one
|'showmode'| |'smd'| message on status line to show current mode
|'sidescroll'| |'ss'| minimum number of columns to scroll horizontal
|'sidescrolloff'| |'siso'| min. nr. of columns to left and right of cursor
|'smartcase'| |'scs'| no ignore case when pattern has uppercase
|'smartindent'| |'si'| smart autoindenting for C programs
|'smarttab'| |'sta'| use 'shiftwidth' when inserting <Tab>
|'softtabstop'| |'sts'| number of spaces that <Tab> uses while editing
|'spell'| enable spell checking
|'spellcapcheck'| |'spc'| pattern to locate end of a sentence
|'spellfile'| |'spf'| files where |zg| and |zw| store words
|'spelllang'| |'spl'| language(s) to do spell checking for
|'spellsuggest'| |'sps'| method(s) used to suggest spelling corrections
|'splitbelow'| |'sb'| new window from split is below the current one
|'splitright'| |'spr'| new window is put right of the current one
|'startofline'| |'sol'| commands move cursor to first blank in line
|'statusline'| |'stl'| custom format for the status line
|'suffixes'| |'su'| suffixes that are ignored with multiple match
|'suffixesadd'| |'sua'| suffixes added when searching for a file
|'swapfile'| |'swf'| whether to use a swapfile for a buffer
|'swapsync'| |'sws'| how to sync the swap file
|'switchbuf'| |'swb'| sets behavior when switching to another buffer
|'synmaxcol'| |'smc'| maximum column to find syntax items
|'syntax'| |'syn'| syntax to be loaded for current buffer
|'tabstop'| |'ts'| number of spaces that <Tab> in file uses
|'tagbsearch'| |'tbs'| use binary searching in tags files
|'taglength'| |'tl'| number of significant characters for a tag
|'tagrelative'| |'tr'| file names in tag file are relative
|'tags'| |'tag'| list of file names used by the tag command
|'tagstack'| |'tgst'| push tags onto the tag stack
|'term'| name of the terminal
|'termbidi'| |'tbidi'| terminal takes care of bi-directionality
|'termencoding'| |'tenc'| character encoding used by the terminal
|'terse'| shorten some messages
|'textauto'| |'ta'| obsolete, use 'fileformats'
|'textmode'| |'tx'| obsolete, use 'fileformat'
|'textwidth'| |'tw'| maximum width of text that is being inserted
|'thesaurus'| |'tsr'| list of thesaurus files for keyword completion
|'tildeop'| |'top'| tilde command "~" behaves like an operator
|'timeout'| |'to'| time out on mappings and key codes
|'timeoutlen'| |'tm'| time out time in milliseconds
|'title'| let Vim set the title of the window
|'titlelen'| percentage of 'columns' used for window title
|'titleold'| old title, restored when exiting
|'titlestring'| string to use for the Vim window title
|'toolbar'| |'tb'| GUI: which items to show in the toolbar
|'toolbariconsize'| |'tbis'| size of the toolbar icons (for GTK 2 only)
|'ttimeout'| time out on mappings
|'ttimeoutlen'| |'ttm'| time out time for key codes in milliseconds
|'ttybuiltin'| |'tbi'| use built-in termcap before external termcap
|'ttyfast'| |'tf'| indicates a fast terminal connection
|'ttymouse'| |'ttym'| type of mouse codes generated
|'ttyscroll'| |'tsl'| maximum number of lines for a scroll
|'ttytype'| |'tty'| alias for 'term'
|'undolevels'| |'ul'| maximum number of changes that can be undone
|'updatecount'| |'uc'| after this many characters flush swap file
|'updatetime'| |'ut'| after this many milliseconds flush swap file
|'verbose'| |'vbs'| give informative messages
|'verbosefile'| |'vfile'| file to write messages in
|'viewdir'| |'vdir'| directory where to store files with :mkview
|'viewoptions'| |'vop'| specifies what to save for :mkview
|'viminfo'| |'vi'| use .viminfo file upon startup and exiting
|'virtualedit'| |'ve'| when to use virtual editing
|'visualbell'| |'vb'| use visual bell instead of beeping
|'warn'| warn for shell command when buffer was changed
|'weirdinvert'| |'wi'| for terminals that have weird inversion method
|'whichwrap'| |'ww'| allow specified keys to cross line boundaries
|'wildchar'| |'wc'| command-line character for wildcard expansion
|'wildcharm'| |'wcm'| like 'wildchar' but also works when mapped
|'wildignore'| |'wig'| files matching these patterns are not completed
|'wildmenu'| |'wmnu'| use menu for command line completion
|'wildmode'| |'wim'| mode for 'wildchar' command-line expansion
|'wildoptions'| |'wop'| specifies how command line completion is done.
|'winaltkeys'| |'wak'| when the windows system handles ALT keys
|'winheight'| |'wh'| minimum number of lines for the current window
|'winfixheight'| |'wfh'| keep window height when opening/closing windows
|'winminheight'| |'wmh'| minimum number of lines for any window
|'winminwidth'| |'wmw'| minimal number of columns for any window
|'winwidth'| |'wiw'| minimal number of columns for current window
|'wrap'| long lines wrap and continue on the next line
|'wrapmargin'| |'wm'| chars from the right where wrapping starts
|'wrapscan'| |'ws'| searches wrap around the end of the file
|'write'| writing to a file is allowed
|'writeany'| |'wa'| write to file with no need for "!" override
|'writebackup'| |'wb'| make a backup before overwriting a file
|'writedelay'| |'wd'| delay this many msec for each char (for debug)
'aleph' 'al' ASCII code of the letter Aleph (Hebrew)
'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
'altkeymap' 'akm' for default second language (Farsi/Hebrew)
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
'antialias' 'anti' Mac OS X: use smooth, antialiased fonts
'autochdir' 'acd' change directory to the file in the current window
'arabic' 'arab' for Arabic as a default second language
'arabicshape' 'arshape' do shaping for Arabic characters
'autoindent' 'ai' take indent for new line from previous line
'autoread' 'ar' autom. read file when changed outside of Vim
'autowrite' 'aw' automatically write file if changed
'autowriteall' 'awa' as 'autowrite', but works with more commands
'background' 'bg' "dark" or "light", used for highlight colors
'backspace' 'bs' how backspace works at start of line
'backup' 'bk' keep backup file after overwriting a file
'backupcopy' 'bkc' make backup as a copy, don't rename the file
'backupdir' 'bdir' list of directories for the backup file
'backupext' 'bex' extension used for the backup file
'backupskip' 'bsk' no backup for files that match these patterns
'balloondelay' 'bdlay' delay in mS before a balloon may pop up
'ballooneval' 'beval' switch on balloon evaluation
'balloonexpr' 'bexpr' expression to show in balloon
'binary' 'bin' read/write/edit file in binary mode
'bioskey' 'biosk' MS-DOS: use bios calls for input characters
'bomb' prepend a Byte Order Mark to the file
'breakat' 'brk' characters that may cause a line break
'browsedir' 'bsdir' which directory to start browsing in
'bufhidden' 'bh' what to do when buffer is no longer in window
'buflisted' 'bl' whether the buffer shows up in the buffer list
'buftype' 'bt' special type of buffer
'casemap' 'cmp' specifies how case of letters is changed
'cdpath' 'cd' list of directories searched with ":cd"
'cedit' key used to open the command-line window
'charconvert' 'ccv' expression for character encoding conversion
'cindent' 'cin' do C program indenting
'cinkeys' 'cink' keys that trigger indent when 'cindent' is set
'cinoptions' 'cino' how to do indenting when 'cindent' is set
'cinwords' 'cinw' words where 'si' and 'cin' add an indent
'clipboard' 'cb' use the clipboard as the unnamed register
'cmdheight' 'ch' number of lines to use for the command-line
'cmdwinheight' 'cwh' height of the command-line window
'columns' 'co' number of columns in the display
'comments' 'com' patterns that can start a comment line
'commentstring' 'cms' template for comments; used for fold marker
'compatible' 'cp' behave Vi-compatible as much as possible
'complete' 'cpt' specify how Insert mode completion works
'completefunc' 'cfu' function to be used for Insert mode completion
'completeopt' 'cot' options for Insert mode completion
'confirm' 'cf' ask what to do about unsaved/read-only files
'conskey' 'consk' get keys directly from console (MS-DOS only)
'copyindent' 'ci' make 'autoindent' use existing indent structure
'cpoptions' 'cpo' flags for Vi-compatible behavior
'cscopepathcomp' 'cspc' how many components of the path to show
'cscopeprg' 'csprg' command to execute cscope
'cscopequickfix' 'csqf' use quickfix window for cscope results
'cscopetag' 'cst' use cscope for tag commands
'cscopetagorder' 'csto' determines ":cstag" search order
'cscopeverbose' 'csverb' give messages when adding a cscope database
'cursorcolumn' 'cuc' highlight the screen column of the cursor
'cursorline' 'cul' highlight the screen line of the cursor
'debug' set to "msg" to see all error messages
'define' 'def' pattern to be used to find a macro definition
'delcombine' 'deco' delete combining characters on their own
'dictionary' 'dict' list of file names used for keyword completion
'diff' use diff mode for the current window
'diffexpr' 'dex' expression used to obtain a diff file
'diffopt' 'dip' options for using diff mode
'digraph' 'dg' enable the entering of digraphs in Insert mode
'directory' 'dir' list of directory names for the swap file
'display' 'dy' list of flags for how to display text
'eadirection' 'ead' in which direction 'equalalways' works
'edcompatible' 'ed' toggle flags of ":substitute" command
'encoding' 'enc' encoding used internally
'endofline' 'eol' write <EOL> for last line in file
'equalalways' 'ea' windows are automatically made the same size
'equalprg' 'ep' external program to use for "=" command
'errorbells' 'eb' ring the bell for error messages
'errorfile' 'ef' name of the errorfile for the QuickFix mode
'errorformat' 'efm' description of the lines in the error file
'esckeys' 'ek' recognize function keys in Insert mode
'eventignore' 'ei' autocommand events that are ignored
'expandtab' 'et' use spaces when <Tab> is inserted
'exrc' 'ex' read .vimrc and .exrc in the current directory
'fileencoding' 'fenc' file encoding for multi-byte text
'fileencodings' 'fencs' automatically detected character encodings
'fileformat' 'ff' file format used for file I/O
'fileformats' 'ffs' automatically detected values for 'fileformat'
'filetype' 'ft' type of file, used for autocommands
'fillchars' 'fcs' characters to use for displaying special items
'fkmap' 'fk' Farsi keyboard mapping
'foldclose' 'fcl' close a fold when the cursor leaves it
'foldcolumn' 'fdc' width of the column used to indicate folds
'foldenable' 'fen' set to display all folds open
'foldexpr' 'fde' expression used when 'foldmethod' is "expr"
'foldignore' 'fdi' ignore lines when 'foldmethod' is "indent"
'foldlevel' 'fdl' close folds with a level higher than this
'foldlevelstart' 'fdls' 'foldlevel' when starting to edit a file
'foldmarker' 'fmr' markers used when 'foldmethod' is "marker"
'foldmethod' 'fdm' folding type
'foldminlines' 'fml' minimum number of lines for a fold to be closed
'foldnestmax' 'fdn' maximum fold depth
'foldopen' 'fdo' for which commands a fold will be opened
'foldtext' 'fdt' expression used to display for a closed fold
'formatlistpat' 'flp' pattern used to recognize a list header
'formatoptions' 'fo' how automatic formatting is to be done
'formatprg' 'fp' name of external program used with "gq" command
'formatexpr' 'fex' expression used with "gq" command
'fsync' 'fs' whether to invoke fsync() after file write
'gdefault' 'gd' the ":substitute" flag 'g' is default on
'grepformat' 'gfm' format of 'grepprg' output
'grepprg' 'gp' program to use for ":grep"
'guicursor' 'gcr' GUI: settings for cursor shape and blinking
'guifont' 'gfn' GUI: Name(s) of font(s) to be used
'guifontset' 'gfs' GUI: Names of multi-byte fonts to be used
'guifontwide' 'gfw' list of font names for double-wide characters
'guiheadroom' 'ghr' GUI: pixels room for window decorations
'guioptions' 'go' GUI: Which components and options are used
'guipty' GUI: try to use a pseudo-tty for ":!" commands
'guitablabel' 'gtl' GUI: custom label for a tab page
'helpfile' 'hf' full path name of the main help file
'helpheight' 'hh' minimum height of a new help window
'helplang' 'hlg' preferred help languages
'hidden' 'hid' don't unload buffer when it is |abandon|ed
'highlight' 'hl' sets highlighting mode for various occasions
'hlsearch' 'hls' highlight matches with last search pattern
'history' 'hi' number of command-lines that are remembered
'hkmap' 'hk' Hebrew keyboard mapping
'hkmapp' 'hkp' phonetic Hebrew keyboard mapping
'icon' let Vim set the text of the window icon
'iconstring' string to use for the Vim icon text
'ignorecase' 'ic' ignore case in search patterns
'imactivatekey' 'imak' key that activates the X input method
'imcmdline' 'imc' use IM when starting to edit a command line
'imdisable' 'imd' do not use the IM in any mode
'iminsert' 'imi' use :lmap or IM in Insert mode
'imsearch' 'ims' use :lmap or IM when typing a search pattern
'include' 'inc' pattern to be used to find an include file
'includeexpr' 'inex' expression used to process an include line
'incsearch' 'is' highlight match while typing search pattern
'indentexpr' 'inde' expression used to obtain the indent of a line
'indentkeys' 'indk' keys that trigger indenting with 'indentexpr'
'infercase' 'inf' adjust case of match for keyword completion
'insertmode' 'im' start the edit of a file in Insert mode
'isfname' 'isf' characters included in file names and pathnames
'isident' 'isi' characters included in identifiers
'iskeyword' 'isk' characters included in keywords
'isprint' 'isp' printable characters
'joinspaces' 'js' two spaces after a period with a join command
'key' encryption key
'keymap' 'kmp' name of a keyboard mapping
'keymodel' 'km' enable starting/stopping selection with keys
'keywordprg' 'kp' program to use for the "K" command
'langmap' 'lmap' alphabetic characters for other language mode
'langmenu' 'lm' language to be used for the menus
'laststatus' 'ls' tells when last window has status lines
'lazyredraw' 'lz' don't redraw while executing macros
'linebreak' 'lbr' wrap long lines at a blank
'lines' number of lines in the display
'linespace' 'lsp' number of pixel lines to use between characters
'lisp' automatic indenting for Lisp
'lispwords' 'lw' words that change how lisp indenting works
'list' show <Tab> and <EOL>
'listchars' 'lcs' characters for displaying in list mode
'loadplugins' 'lpl' load plugin scripts when starting up
'magic' changes special characters in search patterns
'makeef' 'mef' name of the errorfile for ":make"
'makeprg' 'mp' program to use for the ":make" command
'matchpairs' 'mps' pairs of characters that "%" can match
'matchtime' 'mat' tenths of a second to show matching paren
'maxcombine' 'mco' maximum nr of combining characters displayed
'maxfuncdepth' 'mfd' maximum recursive depth for user functions
'maxmapdepth' 'mmd' maximum recursive depth for mapping
'maxmem' 'mm' maximum memory (in Kbyte) used for one buffer
'maxmempattern' 'mmp' maximum memory (in Kbyte) used for pattern search
'maxmemtot' 'mmt' maximum memory (in Kbyte) used for all buffers
'menuitems' 'mis' maximum number of items in a menu
'mkspellmem' 'msm' memory used before |:mkspell| compresses the tree
'modeline' 'ml' recognize modelines at start or end of file
'modelines' 'mls' number of lines checked for modelines
'modifiable' 'ma' changes to the text are not possible
'modified' 'mod' buffer has been modified
'more' pause listings when the whole screen is filled
'mouse' enable the use of mouse clicks
'mousefocus' 'mousef' keyboard focus follows the mouse
'mousehide' 'mh' hide mouse pointer while typing
'mousemodel' 'mousem' changes meaning of mouse buttons
'mouseshape' 'mouses' shape of the mouse pointer in different modes
'mousetime' 'mouset' max time between mouse double-click
'mzquantum' 'mzq' the interval between polls for MzScheme threads
'nrformats' 'nf' number formats recognized for CTRL-A command
'number' 'nu' print the line number in front of each line
'numberwidth' 'nuw' number of columns used for the line number
'omnifunc' 'ofu' function for filetype-specific completion
'operatorfunc' 'opfunc' funtion to be called for |g@| operator
'osfiletype' 'oft' operating system-specific filetype information
'paragraphs' 'para' nroff macros that separate paragraphs
'paste' allow pasting text
'pastetoggle' 'pt' key code that causes 'paste' to toggle
'patchexpr' 'pex' expression used to patch a file
'patchmode' 'pm' keep the oldest version of a file
'path' 'pa' list of directories searched with "gf" et.al.
'preserveindent' 'pi' preserve the indent structure when reindenting
'previewheight' 'pvh' height of the preview window
'previewwindow' 'pvw' identifies the preview window
'printdevice' 'pdev' name of the printer to be used for :hardcopy
'printencoding' 'penc' encoding to be used for printing
'printexpr' 'pexpr' expression used to print PostScript for :hardcopy
'printfont' 'pfn' name of the font to be used for :hardcopy
'printheader' 'pheader' format of the header used for :hardcopy
'printmbcharset' 'pmbcs' CJK character set to be used for :hardcopy
'printmbfont' 'pmbfn' font names to be used for CJK output of :hardcopy
'printoptions' 'popt' controls the format of :hardcopy output
'pumheight'' 'ph' maximum height of the popup menu
'quoteescape' 'qe' escape characters used in a string
'readonly' 'ro' disallow writing the buffer
'remap' allow mappings to work recursively
'report' threshold for reporting nr. of lines changed
'restorescreen' 'rs' Win32: restore screen when exiting
'revins' 'ri' inserting characters will work backwards
'rightleft' 'rl' window is right-to-left oriented
'rightleftcmd' 'rlc' commands for which editing works right-to-left
'ruler' 'ru' show cursor line and column in the status line
'rulerformat' 'ruf' custom format for the ruler
'runtimepath' 'rtp' list of directories used for runtime files
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
'scrollbind' 'scb' scroll in window as other windows scroll
'scrolljump' 'sj' minimum number of lines to scroll
'scrolloff' 'so' minimum nr. of lines above and below cursor
'scrollopt' 'sbo' how 'scrollbind' should behave
'sections' 'sect' nroff macros that separate sections
'secure' secure mode for reading .vimrc in current dir
'selection' 'sel' what type of selection to use
'selectmode' 'slm' when to use Select mode instead of Visual mode
'sessionoptions' 'ssop' options for |:mksession|
'shell' 'sh' name of shell to use for external commands
'shellcmdflag' 'shcf' flag to shell to execute one command
'shellpipe' 'sp' string to put output of ":make" in error file
'shellquote' 'shq' quote character(s) for around shell command
'shellredir' 'srr' string to put output of filter in a temp file
'shellslash' 'ssl' use forward slash for shell file names
'shelltemp' 'stmp' whether to use a temp file for shell commands
'shelltype' 'st' Amiga: influences how to use a shell
'shellxquote' 'sxq' like 'shellquote', but include redirection
'shiftround' 'sr' round indent to multiple of shiftwidth
'shiftwidth' 'sw' number of spaces to use for (auto)indent step
'shortmess' 'shm' list of flags, reduce length of messages
'shortname' 'sn' non-MS-DOS: Filenames assumed to be 8.3 chars
'showbreak' 'sbr' string to use at the start of wrapped lines
'showcmd' 'sc' show (partial) command in status line
'showfulltag' 'sft' show full tag pattern when completing tag
'showmatch' 'sm' briefly jump to matching bracket if insert one
'showmode' 'smd' message on status line to show current mode
'showtabline' 'stal' tells when the tab pages line is displayed
'sidescroll' 'ss' minimum number of columns to scroll horizontal
'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor
'smartcase' 'scs' no ignore case when pattern has uppercase
'smartindent' 'si' smart autoindenting for C programs
'smarttab' 'sta' use 'shiftwidth' when inserting <Tab>
'softtabstop' 'sts' number of spaces that <Tab> uses while editing
'spell' enable spell checking
'spellcapcheck' 'spc' pattern to locate end of a sentence
'spellfile' 'spf' files where |zg| and |zw| store words
'spelllang' 'spl' language(s) to do spell checking for
'spellsuggest' 'sps' method(s) used to suggest spelling corrections
'splitbelow' 'sb' new window from split is below the current one
'splitright' 'spr' new window is put right of the current one
'startofline' 'sol' commands move cursor to first blank in line
'statusline' 'stl' custom format for the status line
'suffixes' 'su' suffixes that are ignored with multiple match
'suffixesadd' 'sua' suffixes added when searching for a file
'swapfile' 'swf' whether to use a swapfile for a buffer
'swapsync' 'sws' how to sync the swap file
'switchbuf' 'swb' sets behavior when switching to another buffer
'synmaxcol' 'smc' maximum column to find syntax items
'syntax' 'syn' syntax to be loaded for current buffer
'tabstop' 'ts' number of spaces that <Tab> in file uses
'tabline' 'tal' custom format for the console tab pages line
'tabpagemax' 'tpm' maximum number of tab pages for |-p| and "tab all"
'tagbsearch' 'tbs' use binary searching in tags files
'taglength' 'tl' number of significant characters for a tag
'tagrelative' 'tr' file names in tag file are relative
'tags' 'tag' list of file names used by the tag command
'tagstack' 'tgst' push tags onto the tag stack
'term' name of the terminal
'termbidi' 'tbidi' terminal takes care of bi-directionality
'termencoding' 'tenc' character encoding used by the terminal
'terse' shorten some messages
'textauto' 'ta' obsolete, use 'fileformats'
'textmode' 'tx' obsolete, use 'fileformat'
'textwidth' 'tw' maximum width of text that is being inserted
'thesaurus' 'tsr' list of thesaurus files for keyword completion
'tildeop' 'top' tilde command "~" behaves like an operator
'timeout' 'to' time out on mappings and key codes
'timeoutlen' 'tm' time out time in milliseconds
'title' let Vim set the title of the window
'titlelen' percentage of 'columns' used for window title
'titleold' old title, restored when exiting
'titlestring' string to use for the Vim window title
'toolbar' 'tb' GUI: which items to show in the toolbar
'toolbariconsize' 'tbis' size of the toolbar icons (for GTK 2 only)
'ttimeout' time out on mappings
'ttimeoutlen' 'ttm' time out time for key codes in milliseconds
'ttybuiltin' 'tbi' use built-in termcap before external termcap
'ttyfast' 'tf' indicates a fast terminal connection
'ttymouse' 'ttym' type of mouse codes generated
'ttyscroll' 'tsl' maximum number of lines for a scroll
'ttytype' 'tty' alias for 'term'
'undolevels' 'ul' maximum number of changes that can be undone
'updatecount' 'uc' after this many characters flush swap file
'updatetime' 'ut' after this many milliseconds flush swap file
'verbose' 'vbs' give informative messages
'verbosefile' 'vfile' file to write messages in
'viewdir' 'vdir' directory where to store files with :mkview
'viewoptions' 'vop' specifies what to save for :mkview
'viminfo' 'vi' use .viminfo file upon startup and exiting
'virtualedit' 've' when to use virtual editing
'visualbell' 'vb' use visual bell instead of beeping
'warn' warn for shell command when buffer was changed
'weirdinvert' 'wi' for terminals that have weird inversion method
'whichwrap' 'ww' allow specified keys to cross line boundaries
'wildchar' 'wc' command-line character for wildcard expansion
'wildcharm' 'wcm' like 'wildchar' but also works when mapped
'wildignore' 'wig' files matching these patterns are not completed
'wildmenu' 'wmnu' use menu for command line completion
'wildmode' 'wim' mode for 'wildchar' command-line expansion
'wildoptions' 'wop' specifies how command line completion is done.
'winaltkeys' 'wak' when the windows system handles ALT keys
'winheight' 'wh' minimum number of lines for the current window
'winfixheight' 'wfh' keep window height when opening/closing windows
'winfixwidth' 'wfw' keep window width when opening/closing windows
'winminheight' 'wmh' minimum number of lines for any window
'winminwidth' 'wmw' minimal number of columns for any window
'winwidth' 'wiw' minimal number of columns for current window
'wrap' long lines wrap and continue on the next line
'wrapmargin' 'wm' chars from the right where wrapping starts
'wrapscan' 'ws' searches wrap around the end of the file
'write' writing to a file is allowed
'writeany' 'wa' write to file with no need for "!" override
'writebackup' 'wb' make a backup before overwriting a file
'writedelay' 'wd' delay this many msec for each char (for debug)
------------------------------------------------------------------------------
*Q_ur* Undo/Redo commands
@@ -937,7 +950,9 @@ Short explanation of each option: *option-list*
|:clist| :cl list all errors
|:cfile| :cf read errors from the file 'errorfile'
|:cgetfile| :cg like :cfile but don't jump to the first error
|:caddfile| :cad add errors from the error file to the current
|:caddfile| :caddf add errors from the error file to the current
quickfix list
|:caddexpr| :cad add errors from an expression to the current
quickfix list
|:cbuffer| :cb read errors from text in a buffer
|:cexpr| :cex read errors from an expression

View File

@@ -1,4 +1,4 @@
*recover.txt* For Vim version 7.0aa. Last change: 2005 Feb 10
*recover.txt* For Vim version 7.0aa. Last change: 2005 Dec 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -126,6 +126,28 @@ command:
A Vim swap file can be recognized by the first six characters: "b0VIM ".
After that comes the version number, e.g., "3.0".
Links and symbolic links ~
On Unix it is possible to have two names for the same file. This can be done
with hard links and with symbolic links (symlinks).
For hard links Vim does not know the other name of the file. Therefore, the
name of the swapfile will be based on the name you used to edit the file.
There is no check for editing the same file by the other name too, because Vim
cannot find the other swapfile (except for searching all of your harddisk,
which would be very slow).
For symbolic links Vim resolves the links to find the name of the actual file.
The swap file name is based on that name. Thus it doesn't matter by what name
you edit the file, the swap file name will normally be the same. However,
there are exceptions:
- When the directory of the actual file is not writable the swapfile is put
elsewhere.
- When the symbolic links somehow create a loop you get an *E773* error
message and the unmodified file name will be used. You won't be able to
save your file normally.
==============================================================================
2. Recovery *recovery* *E308* *E311*

View File

@@ -1,4 +1,4 @@
*remote.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
*remote.txt* For Vim version 7.0aa. Last change: 2006 Mar 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -45,6 +45,19 @@ The following command line arguments are available:
--remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
As --remote-wait, but don't complain if there
is no server.
*--remote-tab*
--remote-tab Like --remote but open each file in a new
tabpage.
*--remote-tab-silent*
--remote-tab-silent Like --remote-silent but open each file in a
new tabpage.
*--remote-tab-wait*
--remote-tab-wait Like --remote-wait but open each file in a new
tabpage.
*--remote-tab-wait-silent*
--remote-tab-wait-silent Like --remote-wait-silent but open each file
in a new tabpage.
*--servername*
--servername {name} Become the server {name}. When used together
with one of the --remote commands: connect to
@@ -53,8 +66,8 @@ The following command line arguments are available:
*--remote-send*
--remote-send {keys} Send {keys} to server and exit.
*--remote-expr*
--remote-expr {expr} Evaluate {expr} in server and
print the result on stdout.
--remote-expr {expr} Evaluate {expr} in server and print the result
on stdout.
*--serverlist*
--serverlist Output a list of server names.

View File

@@ -1,4 +1,4 @@
*repeat.txt* For Vim version 7.0aa. Last change: 2005 Jun 26
*repeat.txt* For Vim version 7.0aa. Last change: 2006 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -144,6 +144,7 @@ For writing a Vim script, see chapter 41 of the user manual |usr_41.txt|.
*:so* *:source* *load-vim-script*
:so[urce] {file} Read Ex commands from {file}. These are commands that
start with a ":".
Triggers the |SourcePre| autocommand.
:so[urce]! {file} Read Vim commands from {file}. These are commands
that are executed from Normal mode, like you type
@@ -562,9 +563,17 @@ It is only included when Vim was compiled with "huge" features.
:prof[ile] start {fname} *:prof* *:profile* *E750*
Start profiling, write the output in {fname} upon exit.
If {fname} already exists it will be overwritten.
If {fname} already exists it will be silently overwritten.
The variable |v:profiling| is set to one.
:prof[ile] pause
Don't profile until the following ":profile continue". Can be
used when doing something that should not be counted (e.g., an
external command). Does not nest.
:prof[ile] continue
Continue profiling after ":profile pause".
:prof[ile] func {pattern}
Profile function that matches the pattern {pattern}.
See |:debug-name| for how {pattern} is used.

View File

@@ -1,4 +1,4 @@
*scroll.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
*scroll.txt* For Vim version 7.0aa. Last change: 2005 Dec 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -153,31 +153,39 @@ to the closest character that is on the screen. The value of 'sidescroll' is
not used.
z<Right> or *zl* *z<Right>*
zl Scroll the screen [count] characters to the left.
This only works when 'wrap' is off. {not in Vi}
zl Move the view on the text [count] characters to the
right, thus scroll the text [count] characters to the
left. This only works when 'wrap' is off. {not in
Vi}
z<Left> or *zh* *z<Left>*
zh Scroll the screen [count] characters to the right.
This only works when 'wrap' is off. {not in Vi}
zh Move the view on the text [count] characters to the
left, thus scroll the text [count] characters to the
right. This only works when 'wrap' is off. {not in
Vi}
*zL*
zL Scroll the screen half a screenwidth to the left.
This only works when 'wrap' is off. {not in Vi}
zL Move the view on the text half a screenwidth to the
right, thus scroll the text half a screenwidth to the
left. This only works when 'wrap' is off. {not in
Vi}
*zH*
zH Scroll the screen half a screenwidth to the right.
This only works when 'wrap' is off. {not in Vi}
zH Move the view on the text half a screenwidth to the
left, thus scroll the text half a screenwidth to the
right. This only works when 'wrap' is off. {not in
Vi}
For the following two commands the cursor is not moved in the text, only the
text scrolls on the screen.
*zs*
zs Scroll the screen horizontally to position the cursor
zs Scroll the text horizontally to position the cursor
at the start (left side) of the screen. This only
works when 'wrap' is off. {not in Vi}
*ze*
ze Scroll the screen horizontally to position the cursor
ze Scroll the text horizontally to position the cursor
at the end (right side) of the screen. This only
works when 'wrap' is off. {not in Vi}

View File

@@ -1,4 +1,4 @@
*spell.txt* For Vim version 7.0aa. Last change: 2005 Dec 09
*spell.txt* For Vim version 7.0aa. Last change: 2006 Mar 10
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -84,28 +84,45 @@ zG Like "zg" but add the word to the internal word list
*zw*
zw Like "zg" but mark the word as a wrong (bad) word.
If the word already appears in 'spellfile' it is
turned into a comment line. See |spellfile-cleanup|
for getting rid of those.
*zW*
zW Like "zw" but add the word to the internal word list
|internal-wordlist|.
zuw *zug* *zuw*
zug Undo |zw| and |zg|, remove the word from the entry in
'spellfile'. Count used as with |zg|.
zuW *zuG* *zuW*
zuG Undo |zW| and |zG|, remove the word from the internal
word list. Count used as with |zg|.
*:spe* *:spellgood*
:[count]spe[llgood] {word}
Add {word} as a good word to 'spellfile', like with
"zg". Without count the first name is used, with a
|zg|. Without count the first name is used, with a
count of two the second entry, etc.
:spe[llgood]! {word} Add {word} as a good word to the internal word list,
like with "zG".
like with |zG|.
*:spellw* *:spellwrong*
:[count]spellw[rong] {word}
Add {word} as a wrong (bad) word to 'spellfile', as
with "zw". Without count the first name is used, with
with |zw|. Without count the first name is used, with
a count of two the second entry, etc.
:spellw[rong]! {word} Add {word} as a wrong (bad) word to the internal word
list.
list, like with |zW|.
:[count]spellu[ndo] {word} *:spellu* *:spellundo*
Like |zuw|. [count] used as with |:spellgood|.
:spellu[ndo]! {word} Like |zuW|. [count] used as with |:spellgood|.
After adding a word to 'spellfile' with the above commands its associated
".spl" file will automatically be updated and reloaded. If you change
@@ -129,8 +146,10 @@ z= For the word under/after the cursor suggest correctly
spelled words. This also works to find alternatives
for a word that is not highlighted as a bad word,
e.g., when the word after it is bad.
The results are sorted on similarity to the word
under/after the cursor.
In Visual mode the highlighted text is taken as the
word to be replaced.
The results are sorted on similarity to the word being
replaced.
This may take a long time. Hit CTRL-C when you get
bored.
@@ -172,6 +191,12 @@ When there is a line break right after a sentence the highlighting of the next
line may be postponed. Use |CTRL-L| when needed. Also see |set-spc-auto| for
how it can be set automatically when 'spelllang' is set.
Vim counts the number of times a good word is encountered. This is used to
sort the suggestions: words that have been seen before get a small bonus,
words that have been seen often get a bigger bonus. The COMMON item in the
affix file can be used to define common words, so that this mechanism also
works in a new or short file |spell-COMMON|.
==============================================================================
2. Remarks on spell checking *spell-remarks*
@@ -253,6 +278,10 @@ Only the first file is loaded, the one that is first in 'runtimepath'. If
this succeeds then additionally files with the name LL.EEE.add.spl are loaded.
All the ones that are found are used.
If no spell file is found the |SpellFileMissing| autocommand event is
triggered. This may trigger the |spellfile.vim| plugin to offer you
downloading the spell file.
Additionally, the files related to the names in 'spellfile' are loaded. These
are the files that |zg| and |zw| add good and wrong words to.
@@ -296,12 +325,36 @@ A spell file might not be available in the current 'encoding'. See
|spell-mkspell| about how to create a spell file. Converting a spell file
with "iconv" will NOT work!
*E758* *E759*
*spell-sug-file* *E781*
If there is a file with exactly the same name as the ".spl" file but ending in
".sug", that file will be used for giving better suggestions. It isn't loaded
before suggestions are made to reduce memory use.
*E758* *E759* *E778* *E779* *E780* *E782*
When loading a spell file Vim checks that it is properly formatted. If you
get an error the file may be truncated, modified or intended for another Vim
version.
SPELLFILE CLEANUP *spellfile-cleanup*
The |zw| command turns existing entries in 'spellfile' into comment lines.
This avoids having to write a new file every time, but results in the file
only getting longer, never shorter. To clean up the comment lines in all
".add" spell files do this: >
:runtime spell/cleanadd.vim
This deletes all comment lines, except the ones that start with "##". Use
"##" lines to add comments that you want to keep.
You can invoke this script as often as you like. A variable is provided to
skip updating files that have been changed recently. Set it to the number of
seconds that has passed since a file was changed before it will be cleaned.
For example, to clean only files that were not changed in the last hour: >
let g:spell_clean_limit = 60 * 60
The default is one second.
WORDS
Vim uses a fixed method to recognize a word. This is independent of
@@ -531,6 +584,11 @@ used spelling files, use this command:
Note: For some languages the result may be enormous,
causing Vim to run out of memory.
:spelld[ump]! Like ":spelldump" and include the word count. This is
the number of times the word was found while
updating the screen. Words that are in COMMON items
get a starting count of 10.
The format of the word list is used |spell-wordlist-format|. You should be
able to read it with ":mkspell" to generate one .spl file that includes all
the words.
@@ -542,6 +600,48 @@ for the current region are included and no "/regions" line is generated.
Comment lines with the name of the .spl file are used as a header above the
words that were generated from that .spl file.
SPELL FILE MISSING *spell-SpellFileMissing* *spellfile.vim*
If the spell file for the language you are using is not available, you will
get an error message. But if the "spellfile.vim" plugin is active it will
offer you to download the spell file. Just follow the instructions, it will
ask you where to write the file.
The plugin has a default place where to look for spell files, on the Vim ftp
server. If you want to use another location or another protocol, set the
g:spellfile_URL variable to the directory that holds the spell files. The
|netrw| plugin is used for getting the file, look there for the speficic
syntax of the URL. Example: >
let g:spellfile_URL = 'http://ftp.vim.org/vim/runtime/spell'
You may need to escape special characters.
The plugin will only ask about downloading a language once. If you want to
try again anyway restart Vim, or set g:spellfile_URL to another value (e.g.,
prepend a space).
To avoid using the "spellfile.vim" plugin do this in your vimrc file: >
let loaded_spellfile_plugin = 1
Instead of using the plugin you can define a |SpellFileMissing| autocommand to
handle the missing file yourself. You can use it like this: >
:au SpellFileMissing * call Download_spell_file(expand('<amatch>'))
Thus the <amatch> item contains the name of the language. Another important
value is 'encoding', since every encoding has its own spell file. With two
exceptions:
- For ISO-8859-15 (latin9) the name "latin1" is used (the encodings only
differ in characters not used in dictionary words).
- The name "ascii" may also be used for some languages where the words use
only ASCII letters for most of the words.
The default "spellfile.vim" plugin uses this autocommand, if you define your
autocommand afterwars you may want to use ":au! SpellFileMissing" to overrule
it. If you define your autocommand before the plugin is loaded it will notice
this and not do anything.
==============================================================================
4. Spell file format *spell-file-format*
@@ -569,13 +669,16 @@ Additionally the following items are recognized:
- Empty and blank lines are ignored.
# comment ~
- Lines starting with a # are ignored (comment lines).
/encoding=utf-8 ~
- A line starting with "/encoding=", before any word, specifies the encoding
of the file. After the second '=' comes an encoding name. This tells Vim
to setup conversion from the specified encoding to 'encoding'. Thus you can
use one word list for several target encodings.
/regions=usca ~
- A line starting with "/regions=" specifies the region names that are
supported. Each region name must be two ASCII letters. The first one is
region 1. Thus "/regions=usca" has region 1 "us" and region 2 "ca".
@@ -583,7 +686,8 @@ Additionally the following items are recognized:
list!
- Other lines starting with '/' are reserved for future use. The ones that
are not recognized are ignored (but you do get a warning message).
are not recognized are ignored. You do get a warning message, so that you
know something won't work.
- A "/" may follow the word with the following items:
= Case must match exactly.
@@ -608,17 +712,18 @@ accepted. This is different from a word with mixed case that is automatically
marked as keep-case, those words may appear in all upper-case letters.
FORMAT WITH AFFIX COMPRESSION
FORMAT WITH .AFF and .DIC FILES
There are two files: the basic word list and an affix file. The affixes are
There are two files: the basic word list and an affix file. The affix file
specifies settings for the language and can contain affixes. The affixes are
used to modify the basic words to get the full word list. This significantly
reduces the number of words, especially for a language like Polish. This is
called affix compression.
The basic word list and the affix file are combined and turned into a binary
spell file. All the preprocessing has been done, thus this file loads fast.
The binary spell file format is described in the source code (src/spell.c).
But only developers need to know about it.
The basic word list and the affix file are combined with the ":mkspell"
command and results in a binary spell file. All the preprocessing has been
done, thus this file loads fast. The binary spell file format is described in
the source code (src/spell.c). But only developers need to know about it.
The preprocessing also allows us to take the Myspell language files and modify
them before the Vim word list is made. The tools for this can be found in the
@@ -630,39 +735,47 @@ here:
http://lingucomponent.openoffice.org/affix.readme ~
Note that affixes are case sensitive, this isn't obvious from the description.
Vim does not use the TRY item, it is ignored. For making suggestions the
possible characters in the words are used.
Vim supports quite a few extras. They are described below |spell-affix-vim|.
Attempts have been made to keep this compatible with other spell checkers, so
that the same files can be used.
that the same files can often be used. One other project that offers more
than Myspell is Hunspell ( http://hunspell.sf.net ).
WORD LIST FORMAT *spell-dic-format*
A very short example, with line numbers:
A short example, with line numbers:
1 1234
2 aan
3 Als
4 Etten-Leur
5 et al.
6 's-Gravenhage
7 's-Gravenhaags
8 bedel/P
9 kado/1
10 cadeau/2
11 TCP,IP
1 1234 ~
2 aan ~
3 Als ~
4 Etten-Leur ~
5 et al. ~
6 's-Gravenhage ~
7 's-Gravenhaags ~
8 # word that differs between regions ~
9 kado/1 ~
10 cadeau/2 ~
11 TCP,IP ~
12 /the S affix may add a 's' ~
13 bedel/S ~
The first line contains the number of words. Vim ignores it, but you do get
an error message if it's not there. *E760*
What follows is one word per line. There should be no white space before or
after the word. After the word there is an optional slash and flags. Most of
these flags are letters that indicate the affixes that can be used with this
word. These are specified with SFX and PFX lines in the .aff file. See the
Myspell documentation. Vim allows using other flag types with the FLAG item
in the affix file |spell-FLAG|.
What follows is one word per line. White space at the end of the line is
ignored, all other white space matters. The encoding is specified in the
affix file |spell-SET|.
Comment lines start with '#' or '/'. See the example lines 8 and 12. Note
that putting a comment after a word is NOT allowed:
someword # comment that causes an error! ~
After the word there is an optional slash and flags. Most of these flags are
letters that indicate the affixes that can be used with this word. These are
specified with SFX and PFX lines in the .aff file, see |spell-SFX| and
|spell-PFX|. Vim allows using other flag types with the FLAG item in the
affix file |spell-FLAG|.
When the word only has lower-case letters it will also match with the word
starting with an upper-case letter.
@@ -672,7 +785,7 @@ is required at this position. The same word with a lower-case letter at this
position will not match. When some of the other letters are upper-case it will
not match either.
The word with all upper-case characters will always be OK.
The word with all upper-case characters will always be OK,
word list matches does not match ~
als als Als ALS ALs AlS aLs aLS
@@ -680,49 +793,83 @@ The word with all upper-case characters will always be OK.
ALS ALS als Als ALs AlS aLs aLS
AlS AlS ALS als Als ALs aLs aLS
The KEP affix ID can be used to specifically match a word with identical case
only, see below |spell-KEP|.
The KEEPCASE affix ID can be used to specifically match a word with identical
case only, see below |spell-KEEPCASE|.
Note in line 5 to 7 that non-word characters are used. You can include
any character in a word. When checking the text a word still only matches
when it appears with a non-word character before and after it. For Myspell a
word starting with a non-word character probably won't work.
Note: in line 5 to 7 non-word characters are used. You can include any
character in a word. When checking the text a word still only matches when it
appears with a non-word character before and after it. For Myspell a word
starting with a non-word character probably won't work.
In line 12 the word "TCP/IP" is defined. Since the slash has a special
meaning the comma is used instead. This is defined with the SLASH item in the
affix file, see |spell-SLASH|. Note that without this SLASH item the
word will be "TCP,IP".
affix file, see |spell-SLASH|. Note that without this SLASH item the word
will be "TCP,IP".
*spell-affix-vim*
A flag that Vim adds and is not in Myspell is the flag defined with KEP in the
affix file. This has the meaning that case matters. This can be used if the
word does not have the first letter in upper case at the start of a sentence.
Example (assuming that = was used for KEP):
word list matches does not match ~
's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS
's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens
AFFIX FILE FORMAT *spell-aff-format* *spell-affix-vim*
The flag can also be used to avoid that the word matches when it is in all
upper-case letters.
*spell-affix-comment*
Comment lines in the .aff file start with a '#':
# comment line ~
With some items it's also possible to put a comment after it, but this isn't
supported in general.
ENCODING *spell-SET*
The affix file can be in any encoding that is supported by "iconv". However,
in some cases the current locale should also be set properly at the time
|:mkspell| is invoked. Adding FOL/LOW/UPP lines removes this requirement
|spell-FOL|.
The encoding should be specified before anything where the encoding matters.
The encoding applies both to the affix file and the dictionary file. It is
done with a SET line:
SET utf-8 ~
The encoding can be different from the value of the 'encoding' option at the
time ":mkspell" is used. Vim will then convert everything to 'encoding' and
generate a spell file for 'encoding'. If some of the used characters to not
fit in 'encoding' you will get an error message.
*spell-affix-mbyte*
The basic word list is normally in an 8-bit encoding, which is mentioned in
the affix file. The affix file must always be in the same encoding as the
word list. This is compatible with Myspell. For Vim the encoding may also be
something else, any encoding that "iconv" supports. The "SET" line must
specify the name of the encoding. When using a multi-byte encoding it's
possible to use more different affixes (but Myspell doesn't support that, thus
you may not want to use it anyway).
When using a multi-byte encoding it's possible to use more different affix
flags. But Myspell doesn't support that, thus you may not want to use it
anyway. For compatibility use an 8-bit encoding.
INFORMATION
These entries in the affix file can be used to add information to the spell
file. There are no restrictions on the format, but they should be in the
right encoding.
*spell-NAME* *spell-VERSION* *spell-HOME*
*spell-AUTHOR* *spell-EMAIL* *spell-COPYRIGHT*
NAME Name of the language
VERSION 1.0.1 with fixes
HOME http://www.myhome.eu
AUTHOR John Doe
EMAIL john AT Doe DOT net
COPYRIGHT LGPL
These fields are put in the .spl file as-is. The |:spellinfo| command can be
used to view the info.
*:spellinfo* *:spelli*
:spelli[nfo] Display the information for the spell file(s) used for
the current buffer.
CHARACTER TABLES
*spell-affix-chars*
When using an 8-bit encoding the affix file should define what characters are
word characters (as specified with ENC). This is because the system where
":mkspell" is used may not support a locale with this encoding and isalpha()
won't work. For example when using "cp1250" on Unix.
word characters. This is because the system where ":mkspell" is used may not
support a locale with this encoding and isalpha() won't work. For example
when using "cp1250" on Unix.
*E761* *E762* *spell-FOL*
*spell-LOW* *spell-UPP*
Three lines in the affix file are needed. Simplistic example:
@@ -774,7 +921,7 @@ the word. This is needed to detect a spelling error such as they'are. That
should be they're, but since "they" and "are" are words themselves that would
go unnoticed.
These characters are defined with MIDWORD in the .aff file:
These characters are defined with MIDWORD in the .aff file. Example:
MIDWORD '- ~
@@ -808,9 +955,58 @@ The usual PFX (prefix) and SFX (suffix) lines are supported (see the Myspell
documentation or the Aspell manual:
http://aspell.net/man-html/Affix-Compression.html).
Note that Myspell ignores any extra text after the relevant info. Vim
requires this text to start with a "#" so that mistakes don't go unnoticed.
Example:
Summary:
SFX L Y 2 ~
SFX L 0 re [^x] ~
SFX L 0 ro x ~
The first line is a header and has four fields:
SFX {flag} {combine} {count}
{flag} The name used for the suffix. Mostly it's a single letter,
but other characters can be used, see |spell-FLAG|.
{combine} Can be 'Y' or 'N'. When 'Y' then the word plus suffix can
also have a prefix. When 'N' then a prefix is not allowed.
{count} The number of lines following. If this is wrong you will get
an error message.
For PFX the fields are exactly the same.
The basic format for the following lines is:
SFX {flag} {strip} {add} {condition}
{flag} Must be the same as the {flag} used in the first line.
{strip} Characters removed from the basic word. There is no check if
the characters are actually there, only the length is used (in
bytes). This better match the {condition}, otherwise strange
things may happen. If the {strip} length is equal to or
longer than the basic word the suffix won't be used.
When {strip} is 0 (zero) then nothing is stripped.
{add} Characters added to the basic word, after removing {strip}.
{condition} A simplistic pattern. Only when this matches with a basic
word will the suffix be used for that word. This is normally
for using one suffix letter with different {add} and {strip}
fields for words with different endings.
When {condition} is a . (dot) there is no condition.
The pattern may contain:
- Literal characters.
- A set of characters in []. [abc] matches a, b and c.
A dash is allowed for a range [a-c], but this is
Vim-specific.
- A set of characters that starts with a ^, meaning the
complement of the specified characters. [^abc] matches any
character but a, b and c.
For PFX the fields are the same, but the {strip}, {add} and {condition} apply
to the start of the word.
Note: Myspell ignores any extra text after the relevant info. Vim requires
this text to start with a "#" so that mistakes don't go unnoticed. Example:
SFX F 0 in [^i]n # Spion > Spionin ~
SFX F 0 nen in # Bauerin > Bauerinnen ~
@@ -826,16 +1022,49 @@ Myspell that use this feature apparently have this flag. Example:
SFX a 0 en . ~
SFX a 0 on . ~
AFFIX FLAGS *spell-affix-flags*
This is a feature that comes from Hunspell: The affix may specify flags. This
works similar to flags specified on a basic word. The flags apply to the
basic word plus the affix. Example:
SFX S Y 1 ~
SFX S 0 s . ~
SFX A Y 1 ~
SFX A 0 able/S . ~
When the dictionary file contains "drink/AS" then these words are possible:
drink
drinks uses S suffix
drinkable uses A suffix
drinkables uses A suffix and then S suffix
Generally the flags of the suffix are added to the flags of the basic word,
both are used for the word plus suffix. But the flags of the basic word are
only used once for affixes, except that both one prefix and one suffix can be
used when both support combining.
Specifically, the affix flags can be used for:
- Affixes on affixes, as in the example above.
- Making the word with the affix rare, by using the |spell-RARE| flag.
- Exclude the word with the affix from compounding, by using the
|spell-COMPOUNDFORBIDFLAG| flag.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
OLD STUFF
*spell-affix-rare*
An extra item for Vim is the "rare" flag. It must come after the other
fields, before a comment. When used then all words that use the affix will be
marked as rare words. Example:
marked as rare words. Examples:
PFX F 0 nene . rare ~
SFX F 0 oin n rare # hardly ever used ~
However, if the word also appears as a good word in another way it won't be
marked as rare.
However, if the word also appears as a good word in another way (e.g., in
another region) it won't be marked as rare.
*spell-affix-nocomp*
Another extra item for Vim is the "nocomp" flag. It must come after the other
@@ -852,6 +1081,7 @@ Example:
util/ac ~
This allows for "wordutil" and "wordutils" but not "wordutilize".
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
*spell-PFXPOSTPONE*
When an affix file has very many prefixes that apply to many words it's not
@@ -872,34 +1102,38 @@ word to start with an upper case letter.
WORDS WITH A SLASH *spell-SLASH*
The slash is used in the .dic file to separate the basic word from the affix
letters that can be used. Unfortunately, this means you cannot use a slash in
a word. Thus "TCP/IP" cannot be a word. To work around that you can define a
replacement character for the slash. Example:
SLASH , ~
Now you can use "TCP,IP" to add the word "TCP/IP".
Of course, the letter used should itself not appear in any word! The letter
must be ASCII, thus a single byte.
letters and other flags. Unfortunately, this means you cannot use a slash in
a word. Thus "TCP/IP" is not a word but "TCP with the flags "IP". To include
a slash in the word put a backslash before it: "TCP\/IP". In the rare case
you want to use a backslash inside a word you need to use two backslashes.
Any other use of the backslash is reserved for future expansion.
KEEP-CASE WORDS *spell-KEP*
KEEP-CASE WORDS *spell-KEEPCASE*
In the affix file a KEP line can be used to define the affix name used for
keep-case words. Example:
In the affix file a KEEPCASE line can be used to define the affix name used
for keep-case words. Example:
KEP = ~
KEEPCASE = ~
See above for an example |spell-affix-vim|.
This flag is not supported by Myspell. It has the meaning that case matters.
This can be used if the word does not have the first letter in upper case at
the start of a sentence. Example:
word list matches does not match ~
's morgens/= 's morgens 'S morgens 's Morgens 'S MORGENS
's Morgens 's Morgens 'S MORGENS 'S morgens 's morgens
The flag can also be used to avoid that the word matches when it is in all
upper-case letters.
RARE WORDS *spell-RAR*
RARE WORDS *spell-RARE*
In the affix file a RAR line can be used to define the affix name used for
In the affix file a RARE line can be used to define the affix name used for
rare words. Example:
RAR ? ~
RARE ? ~
Rare words are highlighted differently from bad words. This is to be used for
words that are correct for the language, but are hardly ever used and could be
@@ -922,18 +1156,15 @@ This can be used to exclude words that would otherwise be good. For example
Once a word has been marked as bad it won't be undone by encountering the same
word as good.
The flag also applies to the word with affixes, thus this can be used to mark
a whole bunch of related words as bad.
*spell-NEEDAFFIX*
The NEEDAFFIX flag is used to require that a word is used with an affix. The
word itself is not a good word. Example:
word itself is not a good word (unless there is an empty affix). Example:
NEEDAFFIX + ~
*spell-NEEDCOMPOUND*
The NEEDCOMPOUND flag is used to require that a word is used as part of a
compound word The word itself is not a good word. Example:
NEEDCOMPOUND & ~
COMPOUND WORDS *spell-compound*
@@ -944,17 +1175,17 @@ call this character a flag here. Obviously these flags must be different from
any affix IDs used.
*spell-COMPOUNDFLAG*
The Myspell compatible method uses one flag, specified with COMPOUNDFLAG.
All words with this flag combine in any order. This means there is no control
The Myspell compatible method uses one flag, specified with COMPOUNDFLAG. All
words with this flag combine in any order. This means there is no control
over which word comes first. Example:
COMPOUNDFLAG c ~
*spell-COMPOUNDFLAGS*
*spell-COMPOUNDRULE*
A more advanced method to specify how compound words can be formed uses
multiple items with multiple flags. This is not compatible with Myspell 3.0.
Let's start with an example:
COMPOUNDFLAGS c+ ~
COMPOUNDFLAGS se ~
COMPOUNDRULE c+ ~
COMPOUNDRULE se ~
The first line defines that words with the "c" flag can be concatenated in any
order. The second line defines compound words that are made of one word with
@@ -972,7 +1203,7 @@ You can make these words:
soup
onionsoup
The COMPOUNDFLAGS item may appear multiple times. The argument is made out of
The COMPOUNDRULE item may appear multiple times. The argument is made out of
one or more groups, where each group can be:
one flag e.g., c
alternate flags inside [] e.g., [abc]
@@ -982,20 +1213,20 @@ Optionally this may be followed by:
This is similar to the regexp pattern syntax (but not the same!). A few
examples with the sequence of word flags they require:
COMPOUNDFLAGS x+ x xx xxx etc.
COMPOUNDFLAGS yz yz
COMPOUNDFLAGS x+z xz xxz xxxz etc.
COMPOUNDFLAGS yx+ yx yxx yxxx etc.
COMPOUNDRULE x+ x xx xxx etc.
COMPOUNDRULE yz yz
COMPOUNDRULE x+z xz xxz xxxz etc.
COMPOUNDRULE yx+ yx yxx yxxx etc.
COMPOUNDFLAGS [abc]z az bz cz
COMPOUNDFLAGS [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc.
COMPOUNDFLAGS a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc.
COMPOUNDFLAGS sm*e se sme smme smmme etc.
COMPOUNDFLAGS s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc.
COMPOUNDRULE [abc]z az bz cz
COMPOUNDRULE [abc]+z az aaz abaz bz baz bcbz cz caz cbaz etc.
COMPOUNDRULE a[xyz]+ ax axx axyz ay ayx ayzz az azy azxy etc.
COMPOUNDRULE sm*e se sme smme smmme etc.
COMPOUNDRULE s[xyz]*e se sxe sxye sxyxe sye syze sze szye szyxe etc.
A specific example: Allow a compound to be made of two words and a dash:
In the .aff file:
COMPOUNDFLAGS sde ~
COMPOUNDRULE sde ~
NEEDAFFIX x ~
COMPOUNDMAX 3 ~
COMPOUNDMIN 1 ~
@@ -1006,6 +1237,12 @@ A specific example: Allow a compound to be made of two words and a dash:
This allows for the word "start-end", but not "startend".
*spell-NEEDCOMPOUND*
The NEEDCOMPOUND flag is used to require that a word is used as part of a
compound word. The word itself is not a good word. Example:
NEEDCOMPOUND & ~
*spell-COMPOUNDMIN*
The minimal character length of a word used for compounding is specified with
COMPOUNDMIN. Example:
@@ -1023,7 +1260,7 @@ specified with COMPOUNDMAX. Example:
When omitted there is no maximum. It applies to all compound words.
To set a limit for words with specific flags make sure the items in
COMPOUNDFLAGS where they appear don't allow too many words.
COMPOUNDRULE where they appear don't allow too many words.
*spell-COMPOUNDSYLMAX*
The maximum number of syllables that a compound word may contain is specified
@@ -1037,6 +1274,17 @@ If both COMPOUNDMAX and COMPOUNDSYLMAX are defined, a compound word is
accepted if it fits one of the criteria, thus is either made from up to
COMPOUNDMAX words or contains up to COMPOUNDSYLMAX syllables.
*spell-COMPOUNDFORBIDFLAG*
The COMPOUNDFORBIDFLAG specifies a flag that can be used on an affix. It
means that the word plus affix cannot be used in a compound word.
NOT IMPLEMENTED YET.
*spell-COMPOUNDPERMITFLAG*
The COMPOUNDPERMITFLAG specifies a flag that can be used on an affix. It
means that the word plus affix can also be used in a compound word in a way
where the affix ends up halfway the word.
NOT IMPLEMENTED YET.
*spell-SYLLABLE*
The SYLLABLE item defines characters or character sequences that are used to
count the number of syllables in a word. Example:
@@ -1065,44 +1313,29 @@ the affix file, without arguments:
Vim will try to figure out where one word ends and a next starts. When there
are spelling mistakes this may not be quite right.
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
NOTE: The following has not been implemented yet, because there are no word
lists that support this.
> *spell-CMP*
> Sometimes it is necessary to change a word when concatenating it to another,
> by removing a few letters, inserting something or both. It can also be useful
> to restrict concatenation to words that match a pattern. For this purpose CMP
> items can be used. They look like this:
> CMP {flag} {flags} {strip} {strip2} {add} {cond} {cond2}
>
> {flag} the flag, as used in COMPOUNDFLAGS for the lead word
> {flags} accepted flags for the following word ('.' to accept
> all)
> {strip} text to remove from the end of the lead word (zero
> for no stripping)
> {strip2} text to remove from the start of the following word
> (zero for no stripping)
> {add} text to insert between the words (zero for no
> addition)
> {cond} condition to match at the end of the lead word
> {cond2} condition to match at the start of the following word
>
> This is the same as what is used for SFX and PFX items, with the extra {flags}
> and {cond2} fields. Example:
> CMP f mrt 0 - . . ~
>
> When used with the food and dish word list above, this means that a dash is
> inserted after each food item. Thus you get "onion-soup" and
> "onion-tomato-salat".
>
> When there are CMP items for a compound flag the concatenation is only done
> when a CMP item matches.
>
> When there are no CMP items for a compound flag, then all words will be
> concatenated, as if there was an item:
> CMP {flag} . 0 0 . .
>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
*spell-COMMON*
Common words can be specified with the COMMON item. This will give better
suggestions when editing a short file. Example:
COMMON the of to and a in is it you that he was for on are ~
The words must be separated by white space, up to 25 per line.
When multiple regions are specified in a ":mkspell" command the common words
for all regions are combined and used for all regions.
*spell-NOSPLITSUGS*
This item indicates that splitting a word to make suggestions is not a good
idea. Split-word suggestions will appear only when there are few similar
words.
NOSPLITSUGS ~
*spell-NOSUGGEST*
The flag specified with NOSUGGEST can be used for words that will not be
suggested. Can be used for obscene words.
NOSUGGEST % ~
REPLACEMENTS *spell-REP*
@@ -1118,7 +1351,7 @@ used to make spelling suggestions. The items define the "from" text and the
REP ch k ~
The first line specifies the number of REP lines following. Vim ignores the
number, but it must be there.
number, but it must be there (for compatibility with Myspell).
Don't include simple one-character replacements or swaps. Vim will try these
anyway. You can include whole words if you want to, but you might want to use
@@ -1129,7 +1362,7 @@ You can include a space by using an underscore:
REP the_the the ~
SIMILAR CHARACTERS *spell-MAP*
SIMILAR CHARACTERS *spell-MAP* *E783*
In the affix file MAP items can be used to define letters that are very much
alike. This is mostly used for a letter with different accents. This is used
@@ -1146,6 +1379,21 @@ Each letter must appear in only one of the MAP items. It's a bit more
efficient if the first letter is ASCII or at least one without accents.
.SUG FILE *spell-NOSUGFILE*
When soundfolding is specified in the affix file then ":mkspell" will normally
produce a .sug file next to the .spl file. This file is used to find
suggestions by their sound-a-like form quickly. At the cost of a lot of
memory (the amount depends on the number of words, |:mkspell| will display an
estimate when it's done).
To avoid producing a .sug file use this item in the affix file:
NOSUGFILE ~
Users can simply omit the .sug file if they don't want to use it.
SOUND-A-LIKE *spell-SAL*
In the affix file SAL items can be used to define the sounds-a-like mechanism
@@ -1197,4 +1445,103 @@ You can use the |soundfold()| function to try out the results. Or set the
'verbose' option to see the score in the output of the |z=| command.
UNSUPPORTED ITEMS *spell-affix-not-supported*
These items appear in the affix file of other spell checkers. In Vim they are
ignored, not supported or defined in another way.
ACCENT (Hunspell) *spell-ACCENT*
Use MAP instead. |spell-MAP|
CHECKCOMPOUNDCASE (Hunspell) *spell-CHECKCOMPOUNDCASE*
Disallow uppercase letters at compound word boundaries.
Not supported.
CHECKCOMPOUNDDUP (Hunspell) *spell-CHECKCOMPOUNDDUP*
Disallow using the same word twice in a compound. Not
supported.
CHECKCOMPOUNDREP (Hunspell) *spell-CHECKCOMPOUNDREP*
Something about using REP items and compound words. Not
supported.
CHECKCOMPOUNDTRIPLE (Hunspell) *spell-CHECKCOMPOUNDTRIPLE*
Forbid three identical characters when compounding. Not
supported.
CHECKCOMPOUNDPATTERN (Hunspell) *spell-CHECKCOMPOUNDPATTERN*
Forbid compounding when patterns match. Not supported.
CIRCUMFIX (Hunspell) *spell-CIRCUMFIX*
This means a prefix and suffix must be added at the same time.
Instead only specify the suffix, and give the that suffix two
flags: The required prefix and the NEEDAFFIX flag.
|spell-NEEDAFFIX|
COMPLEXPREFIXES (Hunspell) *spell-COMPLEXPREFIXES*
Enables using two prefixes. Not supported.
COMPOUND (Hunspell) *spell-COMPOUND*
This is one line with the count of COMPOUND items, followd by
that many COMPOUND lines with a pattern.
Remove the first line with the count and rename the other
items to COMPOUNDRULE |spell-COMPOUNDRULE|
COMPOUNDBEGIN (Hunspell) *spell-COMPOUNDBEGIN*
Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
COMPOUNDEND (Hunspell) *spell-COMPOUNDEND*
Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
COMPOUNDMIDDLE (Hunspell) *spell-COMPOUNDMIDDLE*
Use COMPOUNDRULE instead. |spell-COMPOUNDRULE|
COMPOUNDROOT (Hunspell) *spell-COMPOUNDROOT*
Flag for words in the dictionary that are already a compound.
Vim doesn't use it.
COMPOUNDSYLLABLE (Hunspell) *spell-COMPOUNDSYLLABLE*
Use SYLLABLE and COMPOUNDSYLMAX instead. |spell-SYLLABLE|
|spell-COMPOUNDSYLMAX|
COMPOUNDWORDMAX (Hunspell) *spell-COMPOUNDWORDMAX*
Use COMPOUNDMAX instead. |spell-COMPOUNDMAX|
FORBIDDENWORD (Hunspell) *spell-FORBIDDENWORD*
Use BAD instead. |spell-BAD|
LANG (Hunspell) *spell-LANG*
This specifies language-specific behavior. This actually
moves part of the language knowledge into the program,
therefore Vim does not support it. Each language property
must be specified separately.
LEMMA_PRESENT (Hunspell) *spell-LEMMA_PRESENT*
Only needed for mprphological analysis.
MAXNGRAMSUGS (Hunspell) *spell-MAXNGRAMSUGS*
Not supported.
ONLYINCOMPOUND (Hunspell) *spell-ONLYINCOMPOUND*
Use NEEDCOMPOUND instead. |spell-NEEDCOMPOUND|
PSEUDOROOT (Hunspell) *spell-PSEUDOROOT*
Use NEEDAFFIX instead. |spell-NEEDAFFIX|
SUGSWITHDOTS (Hunspell) *spell-SUGSWITHDOTS*
Adds dots to suggestions. Vim doesn't need this.
SYLLABLENUM (Hunspell) *spell-SYLLABLENUM*
Not supported.
TRY (Myspell, Hunspell, others) *spell-TRY*
Vim does not use the TRY item, it is ignored. For making
suggestions the actual characters in the words are used, that
is much more efficient.
WORDCHARS (Hunspell) *spell-WORDCHARS*
Used to recognize words. Vim doesn't need it, because there
is no need to separate words before checking them (using a
trie instead of a hashtable).
vim:tw=78:sw=4:ts=8:ft=help:norl:

298
runtime/doc/sql.txt Normal file
View File

@@ -0,0 +1,298 @@
*sql.txt* For Vim version 7.0aa. Last change: Fri Jan 06 2006 8:09:25 AM
by David Fishburn
This is a filetype plugin to work with SQL files.
The Structured Query Language (SQL) is a standard which specifies statements
that allow a user to interact with a relational database. Vim includes
features for navigation, indentation and syntax highlighting.
1. Navigation |sql-navigation|
1.1 Matchit |sql-matchit|
1.2 Text Object Motions |sql-object-motions|
1.3 Predefined Object Motions |sql-predefined-objects|
1.4 Macros |sql-macros|
2. SQL Dialects |sql-dialects|
2.1 SQLSetType |SQLSetType|
2.2 SQL Dialect Default |sql-type-default|
3. Adding new SQL Dialects |sql-adding-dialects|
==============================================================================
1. Navigation *sql-navigation*
The SQL ftplugin provides a number of options to assist with file
navigation.
1.1 Matchit *sql-matchit*
-----------
The matchit plugin (http://www.vim.org/scripts/script.php?script_id=39)
provides many additional features and can be customized for different
languages. The matchit plugin is configured by defining a local
buffer variable, b:match_words. Pressing the % key while on various
keywords will move the cursor to its match. For example, if the cursor
is on an "if", pressing % will cycle between the "else", "elseif" and
"end if" keywords.
The following keywords are supported: >
if
elseif | elsif
else [if]
end if
[while condition] loop
leave
break
continue
exit
end loop
for
leave
break
continue
exit
end loop
do
statements
doend
case
when
when
default
end case
merge
when not matched
when matched
create[ or replace] procedure|function|event
returns
<
1.2 Text Object Motions *sql-object-motions*
-----------------------
Vim has a number of predefined keys for working with text |object-motions|.
This filetype plugin attempts to translate these keys to maps which make sense
for the SQL language.
The following |Normal| mode and |Visual| mode maps exist (when you edit a SQL
file): >
]] move forward to the next 'begin'
[[ move backwards to the previous 'begin'
][ move forward to the next 'end'
[] move backwards to the previous 'end'
<
1.3 Predefined Object Motions *sql-predefined-objects*
-----------------------------
Most relational databases support various standard features, tables, indicies,
triggers and stored procedures. Each vendor also has a variety of proprietary
objects. The next set of maps have been created to help move between these
objects. Depends on which database vendor you are using, the list of objects
must be configurable. The filetype plugin attempts to define many of the
standard objects, plus many additional ones. In order to make this as
flexible as possible, you can override the list of objects from within your
|vimrc| with the following: >
let g:ftplugin_sql_objects = 'function,procedure,event,table,trigger' .
\ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable'
<
The following |Normal| mode and |Visual| mode maps have been created which use
the above list: >
]} move forward to the next 'create <object name>'
[{ move backward to the previous 'create <object name>'
Repeatedly pressing ]} will cycle through each of these create statements: >
create table t1 (
...
);
create procedure p1
begin
...
end;
create index i1 on t1 (c1);
<
The default setting for g:ftplugin_sql_objects is: >
let g:ftplugin_sql_objects = 'function,procedure,event,' .
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
\ 'table,trigger' .
\ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable'
<
The above will also handle these cases: >
create table t1 (
...
);
create existing table t2 (
...
);
create global temporary table t3 (
...
);
<
By default, the ftplugin only searches for CREATE statements. You can also
override this via your |vimrc| with the following: >
let g:ftplugin_sql_statements = 'create,alter'
The filetype plugin defines three types of comments: >
1. --
2. //
3. /*
*
*/
<
The following |Normal| mode and |Visual| mode maps have been created to work
with comments: >
]" move forward to the beginning of a comment
[" move forward to the end of a comment
1.4 Macros *sql-macros*
----------
Vim's feature to find macro definitions, |'define'|, is supported using this
regular expression: >
\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>
<
This addresses the following code: >
CREATE VARIABLE myVar1 INTEGER;
CREATE PROCEDURE sp_test(
IN myVar2 INTEGER,
OUT myVar3 CHAR(30),
INOUT myVar4 NUMERIC(20,0)
)
BEGIN
DECLARE myVar5 INTEGER;
SELECT c1, c2, c3
INTO myVar2, myVar3, myVar4
FROM T1
WHERE c4 = myVar1;
END;
<
Place your cursor on "myVar1" on this line: >
WHERE c4 = myVar1;
^
<
Press any of the following keys: >
[d
[D
[CTRL-D
==============================================================================
2. SQL Dialects *sql-dialects* *sql-types*
*sybase* *TSQL* *Transact-SQL*
*sqlanywhere*
*oracle* *plsql* *sqlj*
*sqlserver*
*mysql* *postgress* *psql*
*informix*
All relational databases support SQL. There is a portion of SQL that is
portable across vendors (ex. CREATE TABLE, CREATE INDEX), but there is a
great deal of vendor specific extensions to SQL. Oracle supports the
"CREATE OR REPLACE" syntax, column defaults specified in the CREATE TABLE
statement and the procedural language (for stored procedures and triggers).
The default Vim distribution ships with syntax highlighting based on Oracle's
PL/SQL. The default SQL indent script works for Oracle and SQL Anywhere.
The default filetype plugin works for all vendors and should remain vendor
neutral, but extendable.
Vim currently has support for a variety of different vendors, currently this
is via syntax scripts. Unfortunately, to flip between different syntax rules
you must either create:
1. New filetypes
2. Custom autocmds
3. Manual steps / commands
The majority of people work with only one vendor's database product, it would
be nice to specify a default in your |vimrc|.
2.1 SQLSetType *sqlsettype* *SQLSetType*
--------------
For the people that work with many different databases, it would be nice to be
able to flip between the various vendors rules (indent, syntax) on a per
buffer basis, at any time. The ftplugin/sql.vim file defines this function: >
SQLSetType
<
Executing this function without any parameters will set the indent and syntax
scripts back to their defaults, see |sql-type-default|. If you have turned
off Vi's compatibility mode, |'compatible'|, you can use the <Tab> key to
complete the optional parameter.
After typing the function name and a space, you can use the completion to
supply a parameter. The function takes the name of the Vim script you want to
source. Using the |cmdline-completion| feature, the SQLSetType function will
search the |'runtimepath'| for all Vim scripts with a name containing 'sql'.
This takes the guess work out of the spelling of the names. The following are
examples: >
:SQLSetType
:SQLSetType sqloracle
:SQLSetType sqlanywhere
:SQLSetType sqlinformix
:SQLSetType mysql
<
The easiest approach is to the use <Tab> character which will first complete
the command name (SQLSetType), after a space and another <Tab>, display a list
of available Vim script names: >
:SQL<Tab><space><Tab>
<
2.2 SQL Dialect Default *sql-type-default*
-----------------------
As mentioned earlier, the default syntax rules for Vim is based on Oracle
(PL/SQL). You can override this default by placing one of the following in
your |vimrc|: >
let g:sql_type_default = 'sqlanywhere'
let g:sql_type_default = 'sqlinformix'
let g:sql_type_default = 'mysql'
<
If you added the following to your |vimrc|: >
let g:sql_type_default = 'sqlinformix'
<
The next time edit a SQL file the following scripts will be automatically
loaded by Vim: >
ftplugin/sql.vim
syntax/sqlinformix.vim
indent/sql.vim
>
Notice indent/sqlinformix.sql was not loaded. There is no indent file
for Informix, Vim loads the default files if the specified files does not
exist.
==============================================================================
3. Adding new SQL Dialects *sql-adding-dialects*
If you begin working with a SQL dialect which does not have any customizations
available with the default Vim distribution you can check http://www.vim.org
to see if any customization currently exist. If not, you can begin by cloning
an existing script. Read |filetype-plugins| for more details.
To help identify these scripts, try to create the files with a "sql" prefix.
If you decide you wish to create customizations for the SQLite database, you
can create any of the following: >
Unix
~/.vim/syntax/sqlite.vim
~/.vim/indent/sqlite.vim
Windows
$VIM/vimfiles/syntax/sqlite.vim
$VIM/vimfiles/indent/sqlite.vim
<
No changes are necessary to the SQLSetType function. It will automatically
pickup the new SQL files and load them when you issue the SQLSetType command.
vim:tw=78:ts=8:ft=help:norl:ff=unix:

View File

@@ -1,4 +1,4 @@
*starting.txt* For Vim version 7.0aa. Last change: 2005 Dec 04
*starting.txt* For Vim version 7.0aa. Last change: 2006 Mar 05
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -372,6 +372,14 @@ a slash. Thus "-R" means recovery and "-/R" readonly.
-O[N] Open N windows, split vertically. Otherwise it's like -o.
If both the -o and the -O option are given, the last one on
the command line determines how the windows will be split.
{not in Vi}
*-p*
-p[N] Open N tab pages. If [N] is not given, one tab page is opened
for every file given as argument. The maximum is set with
'tabpagemax' pages (default 10). If there are more tab pages
than arguments, the last few tab pages will be editing an
empty file.
{not in Vi}
*-T*
@@ -706,7 +714,8 @@ accordingly. Vim proceeds in this order:
'shell' option. On MS-DOS and Win32, the COMSPEC variable is used
if SHELL is not set.
The environment variable TERM, if it exists, is used to set the 'term'
option.
option. However, 'term' will change later when starting the GUI (step
8 below).
2. Process the arguments
The options and file names from the command that start Vim are
@@ -799,8 +808,9 @@ accordingly. Vim proceeds in this order:
- The |--noplugin| command line argument is used.
- The "-u NONE" command line argument is used |-u|.
- When Vim was compiled without the |+eval| feature.
Note that using "-c set noloadplugins" doesn't work, because the
commands from the command line have not been executed yet.
Note that using "-c 'set noloadplugins'" doesn't work, because the
commands from the command line have not been executed yet. You can
use "--cmd 'set noloadplugins'" |--cmd|.
5. Set 'shellpipe' and 'shellredir'
The 'shellpipe' and 'shellredir' options are set according to the
@@ -829,6 +839,8 @@ accordingly. Vim proceeds in this order:
11. Open all windows
When the |-o| flag was given, windows will be opened (but not
displayed yet).
When the |-p| flag was given, tab pages will be created (but not
displayed yet).
When switching screens, it happens now. Redrawing starts.
If the "-q" flag was given to Vim, the first error is jumped to.
Buffers for all windows will be loaded.
@@ -1117,6 +1129,7 @@ you want to make this file your default .vimrc, move it to your home directory
(on Unix), s: (Amiga) or $VIM directory (MS-DOS). You could also use
autocommands |autocommand| and/or modelines |modeline|.
*vimrc-option-example*
If you only want to add a single option setting to your vimrc, you can use
these steps:
1. Edit your vimrc file with Vim.
@@ -1126,6 +1139,7 @@ these steps:
'=' to enter the value. E.g., for the 'guifont' option: >
o:set guifont=<C-R>=&guifont<CR><Esc>
< [<C-R> is a CTRL-R, <CR> is a return, <Esc> is the escape key]
You need to escape special characters, esp. spaces.
Note that when you create a .vimrc file, this can influence the 'compatible'
option, which has several side effects. See |'compatible'|.
@@ -1201,6 +1215,9 @@ An example mapping: >
:nmap <F2> :wa<Bar>exe "mksession! " . v:this_session<CR>:so ~/sessions/
This saves the current Session, and starts off the command to load another.
A session only includes the current tab page. There currently is no option to
store all tab pages. |tab-page|
The |SessionLoadPost| autocmd event is triggered after a session file is
loaded/sourced.
*SessionLoad-variable*

View File

@@ -1,4 +1,4 @@
*syntax.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
*syntax.txt* For Vim version 7.0aa. Last change: 2006 Mar 12
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -1884,6 +1884,13 @@ If you want to fold blocks in if statements, etc. as well set the following: >
:let perl_fold_blocks = 1
To avoid folding packages or subs when perl_fold is let, let the appropriate
variable(s): >
:unlet perl_nofold_packages
:unlet perl_nofold_subs
PHP3 and PHP4 *php.vim* *php3.vim* *ft-php-syntax* *ft-php3-syntax*
@@ -2367,13 +2374,18 @@ the syntax file.
SQL *sql.vim* *ft-sql-syntax*
*sqlinformix.vim* *ft-sqlinformix-syntax*
*sqlanywhere.vim* *ft-sqlanywhere-syntax*
While there is an ANSI standard for SQL, most database engines add their
own custom extensions. Vim currently supports the Oracle and Informix
dialects of SQL. Vim assumes "*.sql" files are Oracle SQL by default.
While there is an ANSI standard for SQL, most database engines add their own
custom extensions. Vim currently supports the Oracle and Informix dialects of
SQL. Vim assumes "*.sql" files are Oracle SQL by default.
If you want to use the Informix dialect, put this in your startup vimrc: >
:let g:filetype_sql = "sqlinformix"
Vim currently has SQL support for a variety of different vendors via syntax
scripts. You can change Vim's default from Oracle to any of the current SQL
supported types. You can also easily alter the SQL dialect being used on a
buffer by buffer basis.
For more detailed instructions see |sql.txt|.
TCSH *tcsh.vim* *ft-tcsh-syntax*
@@ -3245,7 +3257,7 @@ A more complicated Example: >
<
abcfoostringbarabc
mmmmmmmmmmm match
ssrrrreee highlight start/region/end ("Foo", "Exa" and "Bar")
sssrrreee highlight start/region/end ("Foo", "Exa" and "Bar")
Leading context *:syn-lc* *:syn-leading* *:syn-context*
@@ -3893,8 +3905,8 @@ guifg={color-name} *highlight-guifg*
guibg={color-name} *highlight-guibg*
guisp={color-name} *highlight-guisp*
These give the foreground (guifg), background (guibg) and special
(guisp) color to use in the GUI. "guisp" is used for underline and
undercurl. There are a few special names:
(guisp) color to use in the GUI. "guisp" is used for undercurl.
There are a few special names:
NONE no color (transparent)
bg use normal background color
background use normal background color
@@ -3937,6 +3949,12 @@ command.
Cursor the character under the cursor
*hl-CursorIM*
CursorIM like Cursor, but used when in IME mode |CursorIM|
*hl-CursorColumn*
CursorColumn the screen column that the cursor is in when 'cursorcolumn' is
set
*hl-CursorLine*
CursorLine the screen line that the cursor is in when 'cursorline' is
set
*hl-Directory*
Directory directory names (and other special names in listings)
*hl-DiffAdd*
@@ -3961,8 +3979,12 @@ SignColumn column where |signs| are displayed
IncSearch 'incsearch' highlighting; also used for the text replaced with
":s///c"
*hl-LineNr*
LineNr line number for ":number" and ":#" commands, and when 'number'
LineNr Line number for ":number" and ":#" commands, and when 'number'
option is set.
*hl-MatchParen*
MatchParen The character under the cursor or just before it, if it
is a paired bracket, and its match. |pi_paren.txt|
*hl-ModeMsg*
ModeMsg 'showmode' message (e.g., "-- INSERT --")
*hl-MoreMsg*
@@ -4013,6 +4035,12 @@ StatusLine status line of current window
StatusLineNC status lines of not-current windows
Note: if this is equal to "StatusLine" Vim will use "^^^" in
the status line of the current window.
*hl-TabLine*
TabLine tab pages line, not active tab page label
*hl-TabLineFill*
TabLineFill tab pages line, where there are no labels
*hl-TabLineSel*
TabLineSel tab pages line, active tab page label
*hl-Title*
Title titles for output from ":set all", ":autocmd" etc.
*hl-Visual*
@@ -4250,9 +4278,8 @@ But for using 16 colors in an rxvt these should work with terminfo: >
<
*colortest.vim*
To test your color setup, a file has been included in the Vim distribution.
To use it, execute these commands: >
:e $VIMRUNTIME/syntax/colortest.vim
:so %
To use it, execute this command: >
:runtime syntax/colortest.vim
Some versions of xterm (and other terminals, like the Linux console) can
output lighter foreground colors, even though the number of colors is defined

346
runtime/doc/tabpage.txt Normal file
View File

@@ -0,0 +1,346 @@
*tabpage.txt* For Vim version 7.0aa. Last change: 2006 Mar 03
VIM REFERENCE MANUAL by Bram Moolenaar
Editing with windows in multiple tab pages. *tab-page* *tabpage*
The commands which have been added to use multiple tab pages are explained
here. Additionally, there are explanations for commands that work differently
when used in combination with more than one tab page.
1. Introduction |tab-page-intro|
2. Commands |tab-page-commands|
3. Other items |tab-page-other|
4. Setting 'tabline' |setting-tabline|
5. Setting 'guitablabel' |setting-guitablabel|
{Vi does not have any of these commands}
{not able to use multiple tab pages when the |+windows| feature was disabled
at compile time}
==============================================================================
1. Introduction *tab-page-intro*
A tab page holds one or more windows. You can easily switch between tab
pages, so that you have several collections of windows to work on different
things.
Usually you will see a list of labels at the top of the Vim window, one for
each tab page. With the mouse you can click on the label to jump to that tab
page. There are other ways to move between tab pages, see below.
Most commands work only in the current tab page. That includes the |CTRL-W|
commands, |:windo|, |:all| and |:ball| (when not using the |:tab| modifier).
The commands that are aware of other tab pages than the current one are
mentioned below.
Tabs are also a nice way to edit a buffer temporarily without changing the
current window layout. Open a new tab page, do whatever you want to do and
close the tab page.
==============================================================================
2. Commands *tab-page-commands*
OPENING A NEW TAB PAGE:
When starting Vim "vim -p filename ..." opens each file argument in a separate
tab page (up to 'tabpagemax'). |-p|
A double click with the mouse in the non-GUI tab pages line opens a new, empty
tab page. It is placed left of the position of the click. The first click
may select another tab page first, causing an extra screen update.
In the GUI tab pages line you can use the right mouse button to open menu.
|tabline-menu|.
:tabe[dit] *:tabe* *:tabedit* *:tabnew*
:tabnew Open a new tab page with an empty window, after the current
tab page.
:tabe[dit] [++opt] [+cmd] {file}
:tabnew [++opt] [+cmd] {file}
Open a new tab page and edit {file}, like with |:edit|.
:tabf[ind] [++opt] [+cmd] {file} *:tabf* *:tabfind*
Open a new tab page and edit {file} in 'path', like with
|:find|.
{not available when the |+file_in_path| feature was disabled
at compile time}
:[count]tab {cmd} *:tab*
Execute {cmd} and when it opens a new window open a new tab
page instead. Doesn't work for |:diffsplit| or |:diffpatch|.
When [count] is omitted the tab page appears after the current
one. When [count] is specified the new tab page comes after
tab page [count]. Use ":0tab cmd" to get the new tab page as
the first one. Examples: >
:tab split " opens current buffer in new tab page
:tab help gt " opens tab page with help for "gt"
CLOSING A TAB PAGE:
Closing the last window of a tab page closes the tab page too, unless there is
only one tab page.
Using the mouse: If the tab page line is displayed you can click in the "X" at
the top right to close the current tab page. A custom |'tabline'| may show
something else.
*:tabc* *:tabclose*
:tabc[lose][!] Close current tab page.
This command fails when:
- There is only one tab page on the screen. *E784*
- When 'hidden' is not set, [!] is not used, a buffer has
changes, and there is no other window on this buffer.
Changes to the buffer are not written and won't get lost, so
this is a "safe" command.
:tabc[lose][!] {count}
Close tab page {count}. Fails in the same way as ':tabclose"
above.
*:tabo* *:tabonly*
:tabo[nly][!] Close all other tab pages.
When the 'hidden' option is set, all buffers in closed windows
become hidden.
When 'hidden' is not set, and the 'autowrite' option is set,
modified buffers are written. Otherwise, windows that have
buffers that are modified are not removed, unless the [!] is
given, then they become hidden. But modified buffers are
never abandoned, so changes cannot get lost.
SWITCHING TO ANOTHER TAB PAGE:
Using the mouse: If the tab page line is displayed you can click in a tab page
label to switch to that tab page. Click where there is no label to go to the
next tab page. |'tabline'|
:tabn[ext] *:tabn* *:tabnext* *gt*
gt Go to the next tab page. Wraps around from the last to the
first one.
:tabn[ext] {count}
{count}gt Go to tab page {count}. The first tab page has number one.
:tabp[revious] *:tabp* *:tabprevious* *gT*
:tabN[ext] *:tabN* *:tabNext*
gT Go to the previous tab page. Wraps around from the first one
to the last one.
:tabp[revious] {count}
:tabN[ext] {count}
{count}gT Go {count} tab pages back. Wraps around from the first one
to the last one.
:tabr[ewind] *:tabfir* *:tabfirst* *:tabr* *:tabrewind*
:tabfir[st] Go to the first tab page.
*:tabl* *:tablast*
:tabl[ast] Go to the last tab page.
Other commands:
*:tabs*
:tabs List the tab pages and the windows they contain.
Shows a ">" for the current window.
Shows a "+" for modified buffers.
REORDERING TAB PAGES:
*:tabm* *:tabmove*
:tabmove N Move the current tab page to after tab page N. Use zero to
make the current tab page the first one. Without N the tab
page is made the last one.
LOOPING OVER TAB PAGES:
*:tabd* *:tabdo*
:tabd[o] {cmd} Execute {cmd} in each tab page.
It works like doing this: >
:tabfirst
:{cmd}
:tabnext
:{cmd}
etc.
< This only operates in the current window of each tab page.
When an error is detected on one tab page, further tab pages
will not be visited.
The last tab page (or where an error occurred) becomes the
current tab page.
{cmd} can contain '|' to concatenate several commands.
{cmd} must not open or close tab pages or reorder them.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
Also see |:windo|, |:argdo| and |:bufdo|.
==============================================================================
3. Other items *tab-page-other*
*tabline-menu*
The GUI tab pages line has a popup menu. It is accessed with a right click.
The entries are:
Close Close the tab page under the mouse pointer. The
current one if there is no label under the mouse
pointer.
New Tab Open a tab page, editing an empty buffer. It appears
to the left of the mouse pointer.
Open Tab... Like "New Tab" and additionaly use a file selector to
select a file to edit.
Diff mode works per tab page. You can see the diffs between several files
within one tab page. Other tab pages can show differences between other
files.
The TabLeave and TabEnter autocommand events can be used to do something when
switching from one tab page to another. The exact order depends on what you
are doing. When creating a new tab page this works as if you create a new
window on the same buffer and then edit another buffer. Thus ":tabnew"
triggers:
WinLeave leave current window
TabLeave leave current tab page
TabEnter enter new tab page
WinEnter enter window in new tab page
BufLeave leave current buffer
BufEnter enter new empty buffer
When switching to another tab page the order is:
BufLeave
WinLeave
TabLeave
TabEnter
WinEnter
BufEnter
==============================================================================
4. Setting 'tabline' *setting-tabline*
The 'tabline' option specifies what the line with tab pages labels looks like.
It is only used when there is no GUI tab line.
You can use the 'showtabline' option to specify when you want the line with
tab page labels to appear: never, when there is more than one tab page or
always.
The highlighting of the tab pages line is set with the groups TabLine
TabLineSel and TabLineFill. |hl-TabLine| |hl-TabLineSel| |hl-TabLineFill|
The 'tabline' option allows you to define your preferred way to tab pages
labels. This isn't easy, thus an example will be given here.
For basics see the 'statusline' option. The same items can be used in the
'tabline' option. Additionally, the |tabpagebuflist()|, |tabpagenr()| and
|tabpagewinnr()| functions are useful.
Since the number of tab labels will vary, you need to use an expresion for the
whole option. Something like: >
:set tabline=%!MyTabLine()
Then define the MyTabLine() function to list all the tab pages labels. A
convenient method is to split it in two parts: First go over all the tab
pages and define labels for them. Then get the label for each tab page. >
function MyTabLine()
let s = ''
for i in range(tabpagenr('$'))
" select the highlighting
if i + 1 == tabpagenr()
let s .= '%#TabLineSel#'
else
let s .= '%#TabLine#'
endif
" set the tab page number (for mouse clicks)
let s .= '%' . (i + 1) . 'T'
" the label is made by MyTabLabel()
let s .= ' %{MyTabLabel(' . (i + 1) . ')} '
endfor
" after the last tab fill with TabLineFill and reset tab page nr
let s .= '%#TabLineFill#%T'
" right-align the label to close the current tab page
if tabpagenr('$') > 1
let s .= '%=%#TabLine#%999Xclose'
endif
return s
endfunction
Now the MyTabLabel() function is called for each tab page to get its label. >
function MyTabLabel(n)
let buflist = tabpagebuflist(a:n)
let winnr = tabpagewinnr(a:n)
return bufname(buflist[winnr - 1])
endfunction
This is just a simplistic example that results in a tab pages line that
resembles the default, but without adding a + for a modified buffer or
trunctating the names. You will want to reduce the width of labels in a
clever way when there is not enough room. Check the 'columns' option for the
space available.
==============================================================================
5. Setting 'guitablabel' *setting-guitablabel*
When the GUI tab pages line is displayed, 'guitablabel' can be used to
specify the label to display for each tab page. Unlike 'tabline', which
specifies the whole tab pages line at once, 'guitablabel' is used for each
label separately.
See the 'statusline' option for the format of the value.
The "%N" item can be used for the current tab page number. The |v:lnum|
variable is also set to this number when 'guitablabel' is evaluated.
The items that use a file name refer to the current window of the tab page.
Note that syntax highlighting is not used for 'guitablabel'. The %T and %X
items are also ignored.
A simple example that puts the tab page number and the buffer name in the
label: >
:set guitablabel=%N\ %f
An example that resembles the default: Show the number of windows in the tab
page and a '+' if there is a modifed buffer: >
function GuiTabLabel()
let label = ''
let bufnrlist = tabpagebuflist(v:lnum)
" Add '+' if one of the buffers in the tab page is modified
for bufnr in bufnrlist
if getbufvar(bufnr, "&modified")
let label = '+'
break
endif
endfor
" Append the number of windows in the tab page if more than one
let wincount = tabpagewinnr(v:lnum, '$')
if wincount > 1
let label .= wincount
endif
if label != ''
let label .= ' '
endif
" Append the buffer name
return label . bufname(bufnrlist[tabpagewinnr(v:lnum) - 1])
endfunction
set guitablabel=%{GuiTabLabel()}
Note that the function must be defined before setting the option, otherwise
you get an error message for the function not being known.
vim:tw=78:ts=8:ft=help:norl:

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
*tagsrch.txt* For Vim version 7.0aa. Last change: 2005 Oct 15
*tagsrch.txt* For Vim version 7.0aa. Last change: 2006 Feb 24
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -36,19 +36,26 @@ An easy way back is with the CTRL-T command. Also read about the tag stack
below.
*:ta* *:tag* *E426* *E429*
:ta[g][!] {ident} Jump to the definition of {ident}, using the
:[count]ta[g][!] {ident}
Jump to the definition of {ident}, using the
information in the tags file(s). Put {ident} in the
tag stack. See |tag-!| for [!].
{ident} can be a regexp pattern, see |tag-regexp|.
When there are several matching tags for {ident}, the
first one is jumped to. |:tnext|.
When there are several matching tags for {ident}, jump
to the [count] one. When [count] is omitted the
first one is jumped to. See |tag-matchlist| for
jumping to other matching tags.
g<LeftMouse> *g<LeftMouse>*
<C-LeftMouse> *<C-LeftMouse>* *CTRL-]*
CTRL-] Jump to the definition of the keyword under the
cursor. Same as ":tag {ident}", where {ident} is the
keyword under or after cursor. {Vi: identifier after
the cursor}
keyword under or after cursor.
When there are several matching tags for {ident}, jump
to the [count] one. When no [count] is given the
first one is jumped to. See |tag-matchlist| for
jumping to other matching tags.
{Vi: identifier after the cursor}
*v_CTRL-]*
{Visual}CTRL-] Same as ":tag {ident}", where {ident} is the text that
@@ -257,6 +264,17 @@ g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag".
:tl[ast][!] Jump to last matching tag. See |tag-!| for [!]. {not
in Vi}
*:lt* *:ltag*
:lt[ag][!] [ident] Jump to tag [ident] and add the matching tags to a new
location list for the current window. [ident] can be
a regexp pattern, see |tag-regexp|. When [ident] is
not given, the last tag name from the tag stack is
used. The search pattern to locate the tag line is
prefixed with "\V" to escape all the special
characters (very nomagic). The location list showing
the matching tags is independent of the tag stack.
See |tag-!| for [!].
{not in Vi}
When there is no other message, Vim shows which matching tag has been jumped
to, and the number of matching tags: >
@@ -275,6 +293,7 @@ skipped and the next matching tag is used. Vim reports this, to notify you of
missing files. When the end of the list of matches has been reached, an error
message is given.
*tag-preview*
The tag match list can also be used in the preview window. The commands are
the same as above, with a "p" prepended.
{not available when compiled without the |+quickfix| feature}

View File

@@ -1,4 +1,4 @@
*term.txt* For Vim version 7.0aa. Last change: 2005 Aug 27
*term.txt* For Vim version 7.0aa. Last change: 2006 Feb 14
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -208,7 +208,7 @@ starts with CSI, it assumes that the terminal is in 8-bit mode and will
convert all key sequences to their 8-bit variants.
==============================================================================
2. Terminal options *terminal-options* *E436*
2. Terminal options *terminal-options* *termcap-options* *E436*
The terminal options can be set just like normal options. But they are not
shown with the ":set all" command. Instead use ":set termcap".
@@ -684,6 +684,7 @@ event position selection change action ~
<MiddleMouse> yes if not active no put
<MiddleMouse> yes if active no yank and put
<RightMouse> yes start or extend yes
<A-RightMouse> yes start or extend blockw. yes *<A-RightMouse>*
<S-RightMouse> yes no change yes "#" (2) *<S-RightMouse>*
<C-RightMouse> no no change no "CTRL-T"
<RightDrag> yes extend no *<RightDrag>*
@@ -699,6 +700,7 @@ event position selection change action ~
<LeftRelease> yes start or extend (1) no like CTRL-O (1)
<MiddleMouse> no (cannot be active) no put register
<RightMouse> yes start or extend yes like CTRL-O
<A-RightMouse> yes start or extend blockw. yes
<S-RightMouse> yes (cannot be active) yes "CTRL-O#" (2)
<C-RightMouse> no (cannot be active) no "CTRL-O CTRL-T"
@@ -713,12 +715,14 @@ Normal Mode:
event position selection change action ~
cursor window ~
<S-LeftMouse> yes start or extend (1) no
<A-LeftMouse> yes start or extend blockw. no *<A-LeftMouse>*
<RightMouse> no popup menu no
Insert or Replace Mode:
event position selection change action ~
cursor window ~
<S-LeftMouse> yes start or extend (1) no like CTRL-O (1)
<A-LeftMouse> yes start or extend blockw. no
<RightMouse> no popup menu no
(1) only if mouse pointer moved since press
@@ -744,6 +748,12 @@ Visual area to be extended. When 'mousemodel' is "popup", the left button has
to be used while keeping the shift key pressed. When clicking in a window
which is editing another buffer, the Visual or Select mode is stopped.
In Normal, Visual and Select mode clicking the right mouse button with the alt
key pressed causes the Visual area to become blockwise. When 'mousemodel is
"popup" the left button has to be used with the alt key. Note that this won't
work on systems where the window manager uses the mouse when the alt key is
pressed (it may move the window).
*double-click*
Double, triple and quadruple clicks are supported when the GUI is active,
for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is

View File

@@ -1,4 +1,4 @@
*tips.txt* For Vim version 7.0aa. Last change: 2005 Apr 19
*tips.txt* For Vim version 7.0aa. Last change: 2006 Mar 01
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -24,6 +24,7 @@ Compressing the help files |gzip-helpfile|
Hex editing |hex-editing|
Executing shell commands in a window |shell-window|
Using <> notation in autocommands |autocmd-<>|
Highlighting matching parens |match-parens|
==============================================================================
Editing C programs *C-editing*
@@ -443,4 +444,65 @@ forget to double the number of existing backslashes and put a backslash before
For a real buffer menu, user functions should be used (see |:function|), but
then the <> notation isn't used, which defeats using it as an example here.
==============================================================================
Highlighting matching parens *match-parens*
This example shows the use of a few advanced tricks:
- using the |CursorMoved| autocommand event
- using |searchpairpos()| to find a matching paren
- using |synID()| to detect whether the cursor is in a string or comment
- using |:match| to highlight something
- using a |pattern| to match a specific position in the file.
This should be put in a Vim script file, since it uses script-local variables.
It skips matches in strings or comments, unless the cursor started in string
or comment. This requires syntax highlighting.
A slightly more advanced version is used in the |matchparen| plugin.
>
let s:paren_hl_on = 0
function s:Highlight_Matching_Paren()
if s:paren_hl_on
match none
let s:paren_hl_on = 0
endif
let c_lnum = line('.')
let c_col = col('.')
let c = getline(c_lnum)[c_col - 1]
let plist = split(&matchpairs, ':\|,')
let i = index(plist, c)
if i < 0
return
endif
if i % 2 == 0
let s_flags = 'nW'
let c2 = plist[i + 1]
else
let s_flags = 'nbW'
let c2 = c
let c = plist[i - 1]
endif
if c == '['
let c = '\['
let c2 = '\]'
endif
let s_skip ='synIDattr(synID(line("."), col("."), 0), "name") ' .
\ '=~? "string\\|comment"'
execute 'if' s_skip '| let s_skip = 0 | endif'
let [m_lnum, m_col] = searchpairpos(c, '', c2, s_flags, s_skip)
if m_lnum > 0 && m_lnum >= line('w0') && m_lnum <= line('w$')
exe 'match Search /\(\%' . c_lnum . 'l\%' . c_col .
\ 'c\)\|\(\%' . m_lnum . 'l\%' . m_col . 'c\)/'
let s:paren_hl_on = 1
endif
endfunction
autocmd CursorMoved,CursorMovedI * call s:Highlight_Matching_Paren()
autocmd InsertEnter * match none
<
vim:tw=78:ts=8:ft=help:norl:

File diff suppressed because it is too large Load Diff

View File

@@ -1,4 +1,4 @@
*undo.txt* For Vim version 7.0aa. Last change: 2003 Oct 21
*undo.txt* For Vim version 7.0aa. Last change: 2006 Mar 16
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -10,7 +10,9 @@ The basics are explained in section |02.5| of the user manual.
1. Undo and redo commands |undo-commands|
2. Two ways of undo |undo-two-ways|
3. Remarks about undo |undo-remarks|
3. Undo blocks |undo-blocks|
4. Undo branches |undo-branches|
5. Remarks about undo |undo-remarks|
==============================================================================
1. Undo and redo commands *undo-commands*
@@ -21,6 +23,9 @@ u Undo [count] changes. {Vi: only one level}
*:u* *:un* *:undo*
:u[ndo] Undo one change. {Vi: only one level}
:u[ndo] {N} Jump to after change number {N}. See |undo-branches|
for the meaning of {N}. {not in Vi}
*CTRL-R*
CTRL-R Redo [count] changes which were undone. {Vi: redraw
screen}
@@ -72,7 +77,131 @@ Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this
words, in Nvi it does nothing.
==============================================================================
3. Remarks about undo *undo-remarks*
3. Undo blocks *undo-blocks*
One undo command normally undoes a typed command, no matter how many changes
that command makes. This sequence of undo-able changes forms an undo block.
Thus if the typed key(s) call a function, all the commands in the function are
undone together.
If you want to write a function or script that doesn't create a new undoable
change but joins in with the previous change use this command:
*:undoj* *:undojoin*
:undoj[oin] Join further changes with the previous undo block.
Warning: Use with care, it may prevent the user from
properly undoing changes.
{not in Vi}
This is most useful when you need to prompt the user halfway a change. For
example in a function that calls |getchar()|. Do make sure that there was a
related change before this that you must join with.
This doesn't work by itself, because the next key press will start a new
change again. But you can do something like this: >
:undojoin | delete
After this an "u" command will undo the delete command and the previous
change.
==============================================================================
4. Undo branches *undo-branches*
Above we only discussed one line of undo. But it is also possible to branch
off. This happens when you undo a few changes and then make a new change.
The undone changes become a branch. You can go to that branch with the
following commands.
What matters here is the order in which the changes are made. Undo and redo
are not considered changes in this context. After each change you have a new
state of the text.
*:undol* *:undolist*
:undol[ist] List the leafs in the tree of changes. Example:
number changes time ~
4 10 10:34:11
18 4 11:01:46
The "number" column is the change number. This number
continuously increases and can be used to identify a
specific undo-able change, see |:undo|.
The "changes" column is the number of changes to this
leaf from the root of the tree.
The "time" column is the time this change was made.
*g-*
g- Go to older text state. With a count repeat that many
times. {not in Vi}
*:ea* *:earlier*
:earlier {count} Go to older text state {count} times.
:earlier {N}s Go to older text state about {N} seconds before.
:earlier {N}m Go to older text state about {N} minutes before.
:earlier {N}h Go to older text state about {N} hours before.
*g+*
g+ Go to newer text state. With a count repeat that many
times. {not in Vi}
*:lat* *:later*
:later {count} Go to newer text state {count} times.
:later {N}s Go to newer text state about {N} seconds later.
:later {N}m Go to newer text state about {N} minutes later.
:later {N}h Go to newer text state about {N} hours later.
Note that text states will become unreachable when undo information is cleared
for 'undolevels'.
Don't be surprised when moving through time shows multiple changes to take
place at a time. This happens when moving through the undo tree and then
making a new change.
EXAMPLE
Start with this text:
one two three ~
Delete the first word by pressing "x" three times:
ne two three ~
e two three ~
two three ~
Now undo that by pressing "u" three times:
e two three ~
ne two three ~
one two three ~
Delete the second word by pressing "x" three times:
one wo three ~
one o three ~
one three ~
Now undo that by using "g-" three times:
one o three ~
one wo three ~
one two three ~
Continue going back in time by pressing "g-" one more time:
two three ~
You are now back in the first undo branch, after deleting "one". Repeating
"g-" will now bring you back to the original text:
e two three ~
ne two three ~
one two three ~
Jump to the last change with ":later 1h":
one three ~
And back to the start again with ":earlier 1h":
one two three ~
Note that using "u" and CTRL-R will not get you to all possible text states
while repeating "g-" and "g+" does.
==============================================================================
5. Remarks about undo *undo-remarks*
The number of changes that are remembered is set with the 'undolevels' option.
If it is zero, the Vi-compatible way is always used. If it is negative no

View File

@@ -1,4 +1,4 @@
*usr_06.txt* For Vim version 7.0aa. Last change: 2002 Jul 14
*usr_06.txt* For Vim version 7.0aa. Last change: 2006 Feb 16
VIM USER MANUAL - by Bram Moolenaar
@@ -179,10 +179,9 @@ You could also write your own color scheme. This is how you do it:
colorscheme mine
If you want to see what the most often used color combinations look like, use
these commands: >
this command: >
:edit $VIMRUNTIME/syntax/colortest.vim
:source %
:runtime syntax/colortest.vim
You will see text in various color combinations. You can check which ones are
readable and look nice.

View File

@@ -1,4 +1,4 @@
*usr_08.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
*usr_08.txt* For Vim version 7.0aa. Last change: 2006 Feb 25
VIM USER MANUAL - by Bram Moolenaar
@@ -17,6 +17,7 @@ side by side. All this is possible with split windows.
|08.6| Commands for all windows
|08.7| Viewing differences with vimdiff
|08.8| Various
|08.9| Tab pages
Next chapter: |usr_09.txt| Using the GUI
Previous chapter: |usr_07.txt| Editing more than one file
@@ -504,6 +505,95 @@ window is to appear:
:topleft {cmd} at the top or left of the Vim window
:botright {cmd} at the bottom or right of the Vim window
==============================================================================
*08.9* Tab pages
You will have noticed that windows never overlap. That means you quickly run
out of screen space. The solution for this is called Tab pages.
Assume you are editing "thisfile". To create a new tab page use this command: >
:tabedit thatfile
This will edit the file "thatfile" in a window that occupies the whole Vim
window. And you will notice a bar at the top with the two file names:
+----------------------------------+
| thisfile | /thatfile/ __________X| (thatfile is bold)
|/* thatfile */ |
|that |
|that |
|~ |
|~ |
|~ |
| |
+----------------------------------+
You now have two tab pages. The first one has a window for "thisfile" and the
second one a window for "thatfile". It's like two pages that are on top of
eachother, with a tab sticking out of each page showing the file name.
Now use the mouse to click on "thisfile" in the top line. The result is
+----------------------------------+
| /thisfile/ | thatfile __________X| (thisfile is bold)
|/* thisfile */ |
|this |
|this |
|~ |
|~ |
|~ |
| |
+----------------------------------+
Thus you can switch between tab pages by clicking on the label in the top
line. If you don't have a mouse or don't want to use it, you can use the "gt"
command. Mnemonic: Goto Tab.
Now let's create another tab page with the command: >
:tab split
This makes a new tab page with one window that is editing the same buffer as
the window we were in:
+-------------------------------------+
| thisfile | /thisfile/ | thatfile __X| (thisfile is bold)
|/* thisfile */ |
|this |
|this |
|~ |
|~ |
|~ |
| |
+-------------------------------------+
You can put ":tab" before any Ex command that opens a window. The window will
be opened in a new tab page. Another example: >
:tab help gt
Will show the help text for "gt" in a new tab page.
A few more things you can do with tab pages:
- click with the mouse in the space after the last label
The next tab page will be selected, like with "gt".
- click with the mouse on the "X" in the top right corner
The current tab page will be closed. Unless there are unsaved
changes in the current tab page.
- double click with the mouse in the top line
A new tab page will be created.
- the "tabonly" command
Closes all tab pages except the current one. Unless there are unsaved
changes in other tab pages.
For more information about tab pages see |tab-page|.
==============================================================================
Next chapter: |usr_09.txt| Using the GUI

View File

@@ -1,4 +1,4 @@
*usr_12.txt* For Vim version 7.0aa. Last change: 2004 Dec 29
*usr_12.txt* For Vim version 7.0aa. Last change: 2006 Feb 26
VIM USER MANUAL - by Bram Moolenaar
@@ -273,7 +273,7 @@ To display a man page for the word under the cursor, use this: >
For example, you want to know the return value of "strstr()" while editing
this line:
if (strstr(input, "aap") == ) ~
if ( strstr (input, "aap") == ) ~
Move the cursor to somewhere on "strstr" and type "\K". A window will open
to display the man page for strstr().

View File

@@ -1,4 +1,4 @@
*usr_31.txt* For Vim version 7.0aa. Last change: 2003 Oct 21
*usr_31.txt* For Vim version 7.0aa. Last change: 2006 Feb 28
VIM USER MANUAL - by Bram Moolenaar
@@ -76,7 +76,7 @@ Will start the browser in "/usr".
When you are not using the GUI version, you could use the file explorer window
to select files like in a file browser. However, this doesn't work for the
":browse" command. See |file-explorer|.
":browse" command. See |netrw-browse|.
==============================================================================
*31.2* Confirmation

View File

@@ -1,4 +1,4 @@
*usr_41.txt* For Vim version 7.0aa. Last change: 2005 Nov 30
*usr_41.txt* For Vim version 7.0aa. Last change: 2006 Feb 22
VIM USER MANUAL - by Bram Moolenaar
@@ -654,7 +654,9 @@ Working with text in the current buffer:
nextnonblank() find next non-blank line
prevnonblank() find previous non-blank line
search() find a match for a pattern
searchpos() find a match for a pattern
searchpair() find the other end of a start/skip/end
searchpairpos() find the other end of a start/skip/end
System functions and manipulation of files:
browse() put up a file requester
@@ -747,6 +749,7 @@ Various:
exists() check if a variable, function, etc. exists
has() check if a feature is supported in Vim
getqflist() list of quickfix errors
getloclist() list of location list items
cscope_connection() check if a cscope connection exists
did_filetype() check if a FileType autocommand was used
eventhandler() check if invoked by an event handler
@@ -758,7 +761,8 @@ Various:
libcallnr() idem, returning a number
getreg() get contents of a register
getregtype() get type of a register
setqflist() create a quickfix list
setqflist() modify a quickfix list
setloclist() modify a location list
setreg() set contents and type of a register
taglist() get list of matching tags
@@ -830,7 +834,7 @@ For people who like short functions, this does the same thing: >
: return a:num2
:endfunction
A user defined function is called in exactly the same way as a builtin
A user defined function is called in exactly the same way as a built-in
function. Only the name is different. The Min function can be used like
this: >
@@ -2241,7 +2245,7 @@ organize your functions in library scripts. But you must use function names
where the part before the '#' matches the script name. Otherwise Vim would
not know what script to load.
If you get really enthousiastic and write lots of library scripts, you may
If you get really enthusiastic and write lots of library scripts, you may
want to use subdirectories. Example: >
call netlib#ftp#read('somefile')

View File

@@ -1,4 +1,4 @@
*usr_toc.txt* For Vim version 7.0aa. Last change: 2005 Feb 22
*usr_toc.txt* For Vim version 7.0aa. Last change: 2006 Mar 17
VIM USER MANUAL - by Bram Moolenaar
@@ -47,6 +47,8 @@ Making Vim Run
|usr_90.txt| Installing Vim
More detailed information in the reference manual: |ref-toc|
The user manual is available as a single, ready to print HTML and PDF file
here:
http://vimdoc.sf.net

View File

@@ -1,4 +1,4 @@
*various.txt* For Vim version 7.0aa. Last change: 2005 Oct 14
*various.txt* For Vim version 7.0aa. Last change: 2006 Mar 17
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -55,16 +55,35 @@ ga Print the ascii value of the character under the
The <Nul> character in a file is stored internally as
<NL>, but it will be shown as:
<^@> 0, Hex 00, Octal 000 ~
If the character has composing characters these are
also shown. The value of 'maxcombine' doesn't matter.
Mnemonic: Get Ascii value. {not in Vi}
*g8*
g8 Print the hex values of the bytes used in the
character under the cursor, assuming it is in |UTF-8|
encoding. This also shows composing characters.
Example of a character with three composing
characters:
encoding. This also shows composing characters. The
value of 'maxcombine' doesn't matter.
Example of a character with two composing characters:
e0 b8 81 + e0 b8 b9 + e0 b9 89 ~
{not in Vi}
{not in Vi} {only when compiled with the |+multi_byte|
feature}
*8g8*
8g8 Find an illegal UTF-8 byte sequence at or after the
cursor. This works in two situations:
1. when 'encoding' is any 8-bit encoding
2. when 'encoding' is "utf-8" and 'fileencoding' is
any 8-bit encoding
Thus it can be used when editing a file that was
supposed to be UTF-8 but was read as if it is an 8-bit
encoding because it contains illegal bytes.
Does not wrap around the end of the file.
Note that when the cursor is on an illegal byte or the
cursor is halfway a multi-byte character the command
won't move the cursor.
{not in Vi} {only when compiled with the |+multi_byte|
feature}
*:p* *:pr* *:print*
:[range]p[rint] [flags]
@@ -94,7 +113,8 @@ g8 Print the hex values of the bytes used in the
*:nu* *:number*
:[range]nu[mber] [count] [flags]
Same as :print, but precede each line with its line
number. (See also 'highlight' option).
number. (See also 'highlight' and 'numberwidth'
option).
See |ex-flags| for [flags].
*:#*
@@ -321,6 +341,7 @@ B *+multi_byte* Korean and other languages |multibyte|
*+multi_byte_ime* Win32 input method for multibyte chars |multibyte-ime|
N *+multi_lang* non-English language support |multi-lang|
m *+mzscheme* Mzscheme interface |mzscheme|
m *+mzscheme/dyn* Mzscheme interface |mzscheme-dynamic| |/dyn|
m *+netbeans_intg* |netbeans|
m *+ole* Win32 GUI only: |ole-interface|
*+osfiletype* Support for the 'osfiletype' option and filetype
@@ -647,6 +668,15 @@ g CTRL-A Only when Vim was compiled with MEM_PROFILING defined
compresses the help files).
{not in Vi}
*:lh* *:lhelpgrep*
:lh[elpgrep] {pattern}[@xx]
Same as ":helpgrep", except the location list is used
instead of the quickfix list. If the help window is
already opened, then the location list for that window
is used. Otherwise, a new help window is opened and
the location list for that window is set. The
location list for the current window is not changed.
*:exu* *:exusage*
:exu[sage] Show help on Ex commands. Added to simulate the Nvi
command. {not in Vi}

View File

@@ -1,4 +1,4 @@
*version7.txt* For Vim version 7.0aa. Last change: 2005 Dec 11
*version7.txt* For Vim version 7.0aa. Last change: 2006 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -23,12 +23,21 @@ Spell checking |new-spell|
Omni completion |new-omni-completion|
MzScheme interface |new-MzScheme|
Printing multi-byte text |new-print-multi-byte|
Tab pages |new-tab-pages|
Undo branches |new-undo-branches|
Extended Unicode support |new-more-unicode|
More highlighting |new-more-highlighting|
Translated manual pages |new-manpage-trans|
Internal grep |new-vimgrep|
Scroll back in messages |new-scroll-back|
Cursor past end of the line |new-onemore|
POSIX compatibility |new-posix|
Debugger support |new-debug-support|
Remote file explorer |new-netrw-explore|
Define an operator |new-define-operator|
Mapping to an expression |new-map-expression|
Visual and Select mode mappings |new-map-select|
Location list |new-location-list|
Various new items |new-items-7|
IMPROVEMENTS |improvements-7|
@@ -129,6 +138,16 @@ compatibility problems and because "SS" can't be changed back to a sharp s.
that could be the function argument without type. Now it finds the position
where the type is given.
The line continuation in functions was not taken into account, line numbers in
errors were logical lines, not lines in the sourced file. That made it
difficult to locate errors. Now the line number in the sourced file is
reported, relative to the function start. This also means that line numbers
for ":breakadd func" are different.
When defining a user command with |:command| the special items could be
abbreviated. This caused unexpected behavior, such as <li> being recognized
as <line1>. The items can no longer be abbreviated.
==============================================================================
NEW FEATURES *new-7*
@@ -147,12 +166,15 @@ The |string()| function can be used to get a string representation of a
variable. Works for Numbers, Strings and composites of them. Then |eval()|
can be used to turn the string back into the variable value.
The |:let| command can now use ":let var += expr" like using ":let var = var +
expr". "-=" and ".=" works in a similar way.
The |:let| command can now use "+=". ":let var += expr" works like
":let var = var + expr". "-=" and ".=" works in a similar way.
With the |:profile| command you can find out where your function or script
wastes its time.
In the Python interface vim.eval() also handles Dictionaries and Lists.
|python-eval| (G. Sumner Hayes)
Spell checking *new-spell*
--------------
@@ -167,7 +189,7 @@ The 'spellsuggest' option specifies the methods used for making suggestions
The |[s| and |]s| commands can be used to move to the next or previous error.
The |zg| and |zw| commands can be used to add good and wrong words.
The |z?| command can be used to correct the word.
The |z=| command can be used to correct the word.
The |:mkspell| command is used to generate a Vim spell file from word lists.
The "undercurl" highlighting attribute was added to nicely point out spelling
@@ -187,8 +209,8 @@ Omni completion *new-omni-completion*
This could also be called "intellisense", but that is a trademark. It is a
smart kind of completion. The text in front of the cursor is inspected to
figure out what could be following. This considers struct and class members,
unions, etc.
figure out what could be following. This may suggest struct and class
members, system functions, etc.
Use CTRL-X CTRL-O in Insert mode to start the completion. |i_CTRL-X_CTRL-O|
@@ -196,8 +218,11 @@ The 'omnifunc' option is set by filetype plugins to define the function that
figures out the completion.
Currently supported languages:
C |ft-c-omni|
XHTML |ft-html-omni|
C |ft-c-omni|
(X)HTML with CSS |ft-html-omni|
JavaScript |ft-javascript-omni|
any language wih syntax highligting |ft-syntax-omni|
XML |ft-xml-omni|
When the 'completeopt' option contains "menu" then matches for Insert mode
completion are displayed in a popup menu.
@@ -219,6 +244,102 @@ The 'printmbcharset' and 'printmbfont' options are used for this.
Also see |postscript-cjk-printing|. (Mike Williams)
Tab pages *new-tab-pages*
---------
A tab page is page with one or more windows with a label (aka tab) at the top.
By clicking on the label you can quickly switch between the tab pages. And
with the keyboard, using the |gt| (Goto Tab) command. This is a convenient
way to work with many windows.
To start Vim with each file argument in a separate tab page use the |-p|
argument. The maximum number of pages can be set with 'tabpagemax'.
The line with tab labels is either made with plain text an highlighting or
with a GUI mechanism. The GUI labels look better but are only available on a
few systems. The line can be customized with 'tabline' and 'guitablabel'.
Whether it is displayed is set with 'showtabline'. Whether to use the GUI
labels is set with the "e" flag in 'guioptions'.
The |:tab| command modifier can be used to have most commands that open a new
window open a new tab instead.
The |--remote-tab| argument can be used to edit a file in a new tab page in an
already running Vim server.
More info here: |tabpage|
Undo branches *new-undo-branches*
-------------
Previously there was only one line of undo-redo. If, after undoing a number
of changes, a new change was made all the undone changes were lost. This
could lead to accidentally losing work.
Vim now makes an undo branch in this situation. Thus you can go back to the
text after any change, even if they were undone. So long as you do not run
into 'undolevels', undo information is freed up to limit the memory used.
To be able to navigate the undo branches each change is numbered sequentially.
The commands |g-| and |:earlier| go back in time, to older changes. The
commands |g+| and |:later| go forward in time, to newer changes.
The changes are also timestamped. Use ":earlier 10m" to go to the text as it
was about ten minutes earlier.
The |:undolist| command can be used to get an idea of which undo branches
exist. The |:undo| command now takes an argument to directly jump to a
specific position in this list. The |changenr()| function can be used to
obtain the change number.
There is no graphical display of the tree with changes, navigation can be
quite confusing.
Extended Unicode support *new-more-unicode*
------------------------
Previously only two combining characters were displayed. The limit is now
raised to 6. This can be set with the 'maxcombine' option. The default is
still 2.
|ga| now shows all combining characters, not just the first two.
Previously only 16 bit Unicode characters were supported for displaying. Now
the full 32 bit character set can be used. Unless manually disabled at
compile time.
For pattern matching it is now possible to search for individual composing
characters. |patterns-composing|
The |8g8| command searches for an illegal UTF-8 byte sequence.
More highlighting *new-more-highlighting*
-----------------
Highlighting matching parens
When moving the cursor through the text and it is on a paren, then the
matching paren can be highlighted. This uses the new |CursorMoved|
autocommand event.
See |matchparen| for more information.
The plugin uses the |:match| command. It now supports three match patterns.
The plugin uses the third one. The first one is for the user and the second
one can be used by another plugin.
Highlighting the cursor line and column
The 'cursorline' and 'cursorcolumn' options have been added. These highlight
the screen line and screen column of the cursor. This makes the cursor
position easier to spot. 'cursorcolumn' is also useful to align text. The
CursorColumn and CursorLine highlighting allow changing the colors used.
|hl-CursorColumn| |hl-CursorLine|
Translated manual pages *new-manpage-trans*
-----------------------
@@ -270,6 +391,19 @@ The |g<| command can be used to see the last page of messages after you have
hit <Enter> at the |hit-enter-prompt|. Then you can scroll further back.
Cursor past end of the line *new-onemore*
---------------------------
When the 'virtualedit' option contains "onemore" the cursor can move just past
the end of the line. As if it's on top of the line break.
This makes some commands more consistent. Previously the cursor was always
past the end of the line if the line was empty. But it is far from Vi
compatible. It may also break some plugins or Vim scripts. Use with care!
The patch was provided by Mattias Flodin.
POSIX compatibility *new-posix*
-------------------
@@ -341,6 +475,53 @@ and a GUI dialog is not possible.
The netrw plugin is maintained by Charles Campbell.
Define an operator *new-define-operator*
------------------
Previously it was not possible to define your own operator; a command that is
followed by a {motion}. Vim 7 introduces the 'operatorfunc' option and the
|g@| operator. This makes it possible to define a mapping that works like an
operator. The actual work is then done by a function, which is invoked
through the |g@| operator.
See |:map-operator| for the explanation and an example.
Mapping to an expression *new-map-expression*
------------------------
The {rhs} argument of a mapping can be an expression. That means the
resulting characters can depend on the context. Example: >
:inoremap <expr> . InsertDot()
Here the dot will be mapped to whatever InsertDot() returns.
Also works for abbreviations. See |:map-<expr>| for the details.
Visual and Select mode mappings *new-map-select*
-------------------------------
Previously Visual mode mappings applied both to Visual and Select mode. With
a trick to have the mappings work in Select mode like they would in Visual
mode.
Commands have been added to define mappings for Visual and Select mode
separately: |:xmap| and |:smap|. With the associated "noremap" and "unmap"
commands.
The same is done for menus: |:xmenu|, |:smenu|, etc.
Location list *new-location-list*
-------------
The support for a per-window quickfix list (location list) is added. The
location list can be displayed in a location window (similar to the quickfix
window). You can open more than one location list window. A set of commands
similar to the quickfix commands are added to browse the location list.
(Yegappan Lakshmanan)
Various new items *new-items-7*
-----------------
@@ -354,6 +535,17 @@ CTRL-W <Enter> In the quickfix window: opens a new window to show the
|at| and |it| text objects select a block of text between HTML or XML tags.
<A-LeftMouse> ('mousemodel' "popup" or "popup-setpos")
<A-RightMouse> ('mousemodel' "extend")
Make a blockwise selection. |<A-LeftMouse>|
gF Start editing the filename under the cursor and jump
to the line number following the file name.
(Yegappan Lakshmanan)
CTRL-W F Start editing the filename under the cursor in a new
window and jump to the line number following the file
name. (Yegappan Lakshmanan)
Insert mode commands: ~
@@ -381,12 +573,15 @@ Options: ~
(based on an idea from Yegappan Lakshmanan)
'formatlistpat' pattern to recognize a numbered list for formatting.
(idea by Hugo Haas)
'formatexpr' expression for formatting text with |gq| and when text
goes over 'textwidth' in Insert mode.
'spell' switch spell checking on/off
'spelllang' languages to check spelling for
'spellsuggest' methods for spell suggestions
'synmaxcol' maximum column to look for syntax items; avoids very
slow redrawing when there are very long lines
'verbosefile' Log messages in a file.
'winfixwidth' window with fixed width, similar to 'winfixheight'
Ex commands: ~
@@ -394,6 +589,7 @@ Ex commands: ~
Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|:startreplace| Start Replace mode. (Charles Campbell)
|:startgreplace| Start Virtual Replace mode.
|:0file| Removes the name of the buffer. (Charles Campbell)
@@ -418,6 +614,46 @@ Win32: The ":winpos" command now also works in the console. (Vipin Aravind)
|:cexpr| Read error messages from a Vim expression (Yegappan
Lakshmanan).
|:caddexpr| Add error messages from a Vim expression to an
existing quickfix list. (Yegappan Lakshmanan).
|:caddbuffer| Add errors from the current buffer to the quickfix
list.
|:lfile| Like |:cfile| but use the location list.
|:lgetfile| Like |:cgetfile| but use the location list.
|:laddfile| Like |:caddfile| but use the location list.
|:lbuffer| Like |:cbuffer| but use the location list.
|:laddbuffer| Like |:caddbuffer| but use the location list.
|:lexpr| Like |:cexpr| but use the location list.
|:laddexpr| Like |:caddexpr| but use the location list.
|:ll| Like |:cc| but use the location list.
|:llist| Like |:clist| but use the location list.
|:lnext| Like |:cnext| but use the location list.
|:lprevious| Like |:cprevious| but use the location list.
|:lNext| Like |:cNext| but use the location list.
|:lfirst| Like |:cfirst| but use the location list.
|:lrewind| Like |:crewind| but use the location list.
|:llast| Like |:clast| but use the location list.
|:lnfile| Like |:cnfile| but use the location list.
|:lpfile| Like |:cpfile| but use the location list.
|:lNfile| Like |:cNfile| but use the location list.
|:lolder| Like |:colder| but use the location list.
|:lnewer| Like |:cnewer| but use the location list.
|:lwindow| Like |:cwindow| but use the location list.
|:lopen| Like |:copen| but use the location list.
|:lclose| Like |:cclose| but use the location list.
|:lmake| Like |:make| but use the location list.
|:lgrep| Like |:grep| but use the location list.
|:lgrepadd| Like |:grepadd| but use the location list.
|:lvimgrep| Like |:vimgrep| but use the location list.
|:lvimgrepadd| Like |:vimgrepadd| but use the location list.
|:lhelpgrep| Like |:helpgrep| but use the location list.
|:lcscope| Like |:cscope| but use the location list.
|:ltag| Jump to a tag and add matching tags to a location list.
|:undojoin| Join a change with the previous undo block.
Ex command modifiers: ~
|:keepalt| Do not change the alternate file.
@@ -427,6 +663,16 @@ Ex command modifiers: ~
|:sandbox| Execute a command in the sandbox.
Ex command arguments: ~
|++bad| Specify what happens with characters that can't be
converted and illegal bytes. (code example by Yasuhiro
Matsumoto)
Also, when a conversion error occurs or illegal bytes
are found include the line number in the error
message.
New and extended functions: ~
|add()| append an item to a List
@@ -438,8 +684,11 @@ New and extended functions: ~
|complete_check()| check for key pressed, for 'completefunc'
|copy()| make a shallow copy of a List or Dictionary
|count()| count nr of times a value is in a List or Dictionary
|cursor()| also accepts an offset for 'virtualedit', and
the first argument can be a list: [lnum, col, off]
|deepcopy()| make a full copy of a List or Dictionary
|empty()| check if List or Dictionary is empty
|getloclist()| list of location list items (Yegappan Lakshmanan)
|getqflist()| list of quickfix errors (Yegappan Lakshmanan)
|extend()| append one List to another or add items from one
Dictionary to another
@@ -457,6 +706,7 @@ New and extended functions: ~
|getfperm()| get file permission string (Nikolai Weibull)
|getftype()| get type of file (Nikolai Weibull)
|getline()| with second argument: get List with buffer lines
|getpos()| return a list with the position of cursor, mark, etc.
|has_key()| check whether a key appears in a Dictionary
|inputlist()| select an entry from a list
|insert()| insert an item somewhere in a List
@@ -475,17 +725,23 @@ New and extended functions: ~
|repeat()| repeat "expr" "count" times (Christophe Poucet)
|reverse()| reverse the order of a List
|searchdecl()| search for declaration of variable
|setqflist()| create a quickfix list (Yegappan Lakshmanan)
|searchpairpos()| return a List with the position of the match
|searchpos()| return a List with the position of the match
|setloclist()| modify a location list (Yegappan Lakshmanan)
|setqflist()| modify a quickfix list (Yegappan Lakshmanan)
|sort()| sort a List
|soundfold()| get the sound-a-like equivalent of a word
|split()| split a String into a List
|spellbadword()| get a badly spelled word
|spellsuggest()| get suggestions for correct spelling
|str2nr()| convert a string to a number, base 8, 10 or 16
|string()| string representation of a List or Dictionary
|system()| filters {input} through a shell command
|taglist()| get list of matching tags (Yegappan Lakshmanan)
|tr()| translate characters (Ron Aaron)
|values()| get List of Dictionary values
|winrestview()| restore the view of the current window
|winsaveview()| save the view of the current window
|writefile()| write a list of lines into a file
User defined functions can now be loaded automatically from the "autoload"
@@ -503,6 +759,21 @@ New autocommand events: ~
|QuickFixCmdPost| after :make, :grep et al. (Ciaran McCreesh)
|SessionLoadPost| after loading a session file. (Yegappan Lakshmanan)
|SpellFileMissing| when a spell file can't be found
|ShellCmdPost| after executing a shell command
|ShellFilterPost| after filtering with a shell command
|VimResized| after the Vim window size changed (Yakov Lerner)
|FileChangedShellPost| after handling a file changed outside of Vim
|SourcePre| before sourcing a Vim script
|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
New items in search patterns: ~
|/\%d| \%d123 search for character with decimal number
@@ -516,9 +787,15 @@ New items in search patterns: ~
|/\%U| \%U1234abcd search for character with 8 pos. hex number
|/\]| [\U1234abcd] idem, in a colletion
(The above partly by Ciaran McCreesh)
|/[[=| [[=a=]] an equivalence class (only for latin1 characters)
|/[[.| [[.a.]] a collation element (only works with single char)
|/\%'m| \%'m match at mark m
|/\%<'m| \%<'m match before mark m
|/\%>'m| \%>'m match after mark m
|/\%V| \%V match in Visual area
Nesting |/multi| items no longer is an error when an empty match is possible.
It is now possible to use \{0}, it matches the preceding atom zero times. Not
@@ -533,6 +810,8 @@ ABAB/4 syntax file. (Marius van Wyk)
SQL-Informix syntax file. (Dean L Hill)
Handling of various SQL variants. (David Fishburn)
PHP compiler plugin. (Doug Kearns)
Sive syntax file. (Nikolai Weibull)
@@ -547,11 +826,18 @@ Moved all the indent settings from the filetype plugin to the indent file.
Implemented b:undo_indent to undo indent settings when setting 'filetype' to a
different value.
VHDL indent file (Gerald Lai)
MGL syntax file. (Gero Kuhlmann)
rd syntax file. (Johannes Ranke)
New Keymaps: ~
Sinhala (Sri Lanka) (Harshula Jayasuriya)
Tamil in TSCII encoding (Yegappan Lakshmanan)
New message translations: ~
@@ -564,6 +850,12 @@ Vietnamese message translations and menu. (Phan Vinh Thinh)
Others: ~
The Netbeans interface was updated for Sun Studio 10. The protocol number
goes from 2.2 to 2.3. (Gordon Prieur)
Mac: When starting up Vim will load the $VIMRUNTIME/macmap.vim script to
define default command-key mappings. (mostly by Benji Fisher)
Mac: Add the selection type to the clipboard, so that Block, line and
character selections can be used between two Vims. (Eckehard Berns)
Also fixes the problem that setting 'clipboard' to "unnamed" breaks using
@@ -573,17 +865,19 @@ Mac: GUI font selector. (Peter Cucka)
Mac: support for multi-byte characters. (Da Woon Jung)
GUI font selector for Motif. (Marcin Dalecki)
Nicer toolbar buttons for Motif. (Marcin Dalecki)
Mnemonics for the Motif find/replace dialog. (Marcin Dalecki)
Mac: Support the xterm mouse in the non-GUI version.
Mac: better integration with Xcode. Post a fake mouse-up event after the odoc
event and the drag receive handler to work around a stall after Vim loads a
file. Fixed an off-by-one line number error. (Da Woon Jung)
Added the t_SI and t_EI escape sequences for starting and ending Insert mode.
GUI font selector for Motif. (Marcin Dalecki)
Nicer toolbar buttons for Motif. (Marcin Dalecki)
Mnemonics for the Motif find/replace dialog. (Marcin Dalecki)
To be used to set the cursor shape to a bar or a block. No default values,
they are not supported by termcap/terminfo.
@@ -616,6 +910,17 @@ is already being edited by another Vim instance, the |SwapExists| event has
been added. The |v:swapname|, |v:swapchoice| and |v:swapcommand| variables
can be used, for example to use the |client-server| functionality to bring the
other Vim to the foreground.
When starting Vim with a "-t tag" argument, there is an existing swapfile and
the user selects "quit" or "abort" then exit Vim.
Undo now also restores the '< and '> marks. "gv" selects the same area as
before the change and undo.
When editing a search pattern for a "/" or "?" command and 'incsearch' is set
CTRL-L can be used to add a character from the current match. CTRL-R CTRL-W
will add a word, but exclude the part of the word that was already typed.
Ruby interface: add line number methods. (Ryan Paul)
==============================================================================
IMPROVEMENTS *improvements-7*
@@ -624,6 +929,9 @@ IMPROVEMENTS *improvements-7*
Move the help for printing to a separate help file. It's quite a lot now.
When doing completion for ":!cmd", ":r !cmd" or ":w !cmd" executable files are
found in $PATH instead of looking for ordinary files in the current directlry.
When ":silent" is used and a backwards range is given for an Ex command the
range is swapped automatically instead of asking if that is OK.
@@ -632,9 +940,21 @@ iterative mechanism. This avoids out-of-stack errors. State is stored in
allocated memory, running out of memory can always be detected. Allows
matching more complex things, but Vim may seem to hang while doing that.
Previously some options were always evaluated in the |sandbox|. Now that only
happens when the option was set from a modeline or in secure mode. Applies to
'balloonexpr', 'foldexpr', 'foldtext' and 'includeexpr'. (Sumner Hayes)
Some commands and expressions could have nasty side effects, such as using
CTRL-R = while editing a search pattern and the expression invokes a function
that jumps to another window. The |textlock| has been added to prevent this
from happening.
":breakadd here" and ":breakdel here" can be used to set or delete a
breakpoint at the cursor.
It is now possible to define a function with: >
:exe "func Test()\n ...\n endfunc"
The tutor was updated to make it simpler to use and added text to explain a
few more important commands. Used ideas from Gabriel Zachmann.
@@ -661,16 +981,25 @@ Added the "count" argument to match(), matchend() and matchstr(). (Ilya Sher)
winnr() takes an optional "$" and "#" arguments. (Nikolai Weibull, Yegappan
Lakshmanan)
Added 's' flag to search(): set ' mark if cursor moved. (Yegappan Lakshmanan)
Added 'n' flag to search(): don't move the cursor. (Nikolai Weibull)
Added 'c' flag to search(): accept match at the cursor.
Added 'e' flag to search(): move to end of the match. (Benji Fisher)
Added 'p' flag to search(): return number of sub-pattern. (Benji Fisher)
These also apply to searchpos(), searchpair() and searchpairpos().
The search() and searchpair() functions have an extra argument to specify
where to stop searching. Speeds up searches that should not continue too far.
When uncompressing fails in the gzip plugin, give an error message but don't
delete the raw text. Helps if the file has a .gz extension but is not
actually compressed. (Andrew Pimlott)
When C, C++ or IDL syntax is used, may additionally load doxygen syntax.
Also support setting the filetype to "cdoxygen" for C plus doxygen syntax.
(Michael Geddes)
Support setting 'filetype' and 'syntax' to "aaa.bbb" for "aaa" plus "bbb"
filetype or syntax.
The ":registers" command now displays multi-byte characters properly.
VMS: In the usage message mention that a slash can be used to make a flag
@@ -680,9 +1009,6 @@ upper case. Add color support to the builtin vt320 terminal codes.
For the '%' item in 'viminfo', allow a number to set a maximum for the number
of buffers.
The 'statusline' option can be local to the window, so that each window can
have a different value. (partly by Yegappan Lakshmanan)
When a file looks like a shell script, check for an "exec" command that starts
the tcl interpreter. (suggested by Alexios Zavras)
@@ -696,6 +1022,10 @@ list.
Win32: When libintl.dll supports bind_textdomain_codeset(), use it.
(NAKADAIRA Yukihiro)
Win32: Vim was not aware of hard links on NTFS file systems. These are
detected now for when 'backupcopy' is "auto". Also fixed a bogus "file has
been changed since reading it" error for links.
When foldtext() finds no text after removing the comment leader, use the
second line of the fold. Helps for C-style /* */ comments where the first
line is just "/*".
@@ -707,6 +1037,10 @@ the swap file to indicate it is in the same directory as the edited file. The
used path then doesn't matter and the check for editing the same file is much
more reliable.
Unix: When editing a file through a symlink the swap file would use the name
of the symlink. Now use the name of the actual file, so that editing the same
file twice is detected. (suggestions by Stefano Zacchiroli and James Vega)
Client-server communication now supports 'encoding'. When setting 'encoding'
in a Vim server to "utf-8", and using "vim --remote fname" in a console,
"fname" is converted from the console encoding to utf-8. Also allows Vims
@@ -767,6 +1101,9 @@ When completing buffer names, match with "\(^\|[\/]\)" instead of "^", so that
To count items (pattern matches) without changing the buffer the 'n' flag has
been added to |:substitute|. See |count-items|.
In a |:substitute| command the \u, \U, \l and \L items now also work for
multi-byte characters.
The "screen.linux" $TERM name is recognized to set the default for
'background' to "dark". (Ciaran McCreesh) Also for "cygwin" and "putty".
@@ -785,6 +1122,13 @@ getwinvar() now also works to obtain a buffer-local option from the specified
window.
Added the "%s" item to 'errorformat'. (Yegappan Lakshmanan)
Added the "%>" item to 'errorformat'.
For 'errorformat' it was not possible to have a file name that contains the
character that follows after "%f". For example, in "%f:%l:%m" the file name
could not contain ":". Now include the first ":" where the rest of the
pattern matches. In the example a ":" not followed by a line number is
included in the file name. (suggested by Emanuele Giaquinta)
GTK GUI: use the GTK file dialog when it's available. Mix from patches by
Grahame Bowland and Evan Webb.
@@ -815,15 +1159,6 @@ Lakshmanan)
Win32: Balloons can have multiple lines if common controls supports it.
(Sergey Khorev)
The 's' flag is added to the search() and searchpair() function to set the
' mark if the cursor is moved. (Yegappan Lakshmanan)
For 'errorformat' it was not possible to have a file name that contains the
character that follows after "%f". For example, in "%f:%l:%m" the file name
could not contain ":". Now include the first ":" where the rest of the
pattern matches. In the example a ":" not followed by a line number is
included in the file name. (suggested by Emanuele Giaquinta)
For command-line completion the matches for various types of arguments are now
sorted: user commands, variables, syntax names, etc.
@@ -844,6 +1179,9 @@ completion supported for the input. (Yegappan Lakshmanan)
"dp" works with more than two buffers in diff mode if there is only one where
'modifiable' is set.
The 'diffopt' option has three new values: "horizontal", "vertical" and
"foldcolumn".
When the 'include' option contains \zs the file name found is what is being
matched from \zs to the end or \ze. Useful to pass more to 'includeexpr'.
@@ -869,6 +1207,54 @@ file would be used for the current buffer. But the buffer contents is
actually different from the file content. Don't set the file name, unless the
'P' flag is present in 'cpoptions'.
When starting to edit a new file and the directory for the file doesn't exist
then Vim will report "[New DIRECTORY]" instead of "[New File] to give the user
a hint that something might be wrong.
Win32: Preserve the hidden attribute of the viminfo file.
In Insert mode CTRL-A didn't keep the last inserted text when using CTRL-O and
then a cursor key. Now keep the previously inserted text if nothing is
inserted after the CTRL-O. Allows using CTRL-O commands to move the cursor
without losing the last inserted text.
The exists() function now supports checking for autocmd group definition
and for supported autocommand events. (Yegappan Lakshmanan)
Allow using ":global" in the sandbox, it doesn't do anything harmful by
itself.
":saveas asdf.c" will set 'filetype' to c when it's empty. Also for ":w
asdf.c" when it sets the filename for the buffer.
Insert mode completion for whole lines now also searches unloaded buffers.
The colortest.vim script can now be invoked directly with ":source" or
":runtime".
The 'statusline' option can be local to the window, so that each window can
have a different value. (partly by Yegappan Lakshmanan)
The 'statusline' option and other options that support the same format can now
use these new features:
- When it starts with "%!" the value is first evaluated as an expression
before parsing the value.
- "%#HLname#" can be used to start highlighting with HLname.
When 'statusline' is set to something that causes an error message then it is
made empty to avoid an endless redraw loop. Also for other options, such at
'tabline' and 'titlestring'. ":verbose set statusline" will mention that it
was set in an error handler.
When there are several matching tags, the ":tag <name>" and CTRL-] commands
jump to the [count] matching tag. (Yegappan Lakshmanan)
Win32: In the batch files generated by the install program, use $VIMRUNTIME or
$VIM if it's set. Example provided by Mathias Michaelis.
Also create a vimtutor.bat batch file.
The 'balloonexpr' option is now |global-local|.
==============================================================================
COMPILE TIME CHANGES *compile-changes-7*
@@ -876,13 +1262,6 @@ Dropped the support for the BeOS and Amiga GUI. They were not maintained and
probably didn't work. If you want to work on this: get the Vim 6.x version
and merge it back in.
Mac: "make" now creates the Vim.app directory and "make install" copies it to
its final destination. (Raf)
Mac: Made it possible to compile with Motif, Athena or GTK without tricks and
still being able to use the MacRoman conversion. Added the os_mac_conv.c
file.
When running the tests and one of them fails to produce "test.out" the
following tests are still executed. This helps when running out of memory.
@@ -900,10 +1279,37 @@ functions.
Moved unix_expandpath() to misc1.c, so that it can also be used by os_mac.c
without copying the code.
Mac: When running "make install" the runtime files are installed as for Unix.
--- Mac ---
"make" now creates the Vim.app directory and "make install" copies it to its
final destination. (Raf)
Put the runtime directory not directly in Vim.app but in
Vim.app/Contents/Resources/vim, so that it's according to Mac specs.
Made it possible to compile with Motif, Athena or GTK without tricks and still
being able to use the MacRoman conversion. Added the os_mac_conv.c file.
When running "make install" the runtime files are installed as for Unix.
Avoids that too many files are copied. When running "make" a link to the
runtime files is created to avoid a recursive copy that takes much time.
Configure will attempt to build Vim for both Intel and PowerPC. The
--with-mac-arch configure argument can change it.
--- Win32 ---
The Make_mvc.mak file was adjusted to work with the latest MS compilers,
including the free version of Visual Studio 2005. (George Reilly)
INSTALLpc.txt was updated for the recent changes. (George Reilly)
The distributed executable is now produced with the free Visual C++ Toolkit
2003 and other free SDK chunks. msvcsetup.bat was added to support this.
Also generate the .pdb file that can be used to generate a useful crash report
on MS-Windows. (George Reilly)
==============================================================================
BUG FIXES *bug-fixes-7*
@@ -1346,6 +1752,9 @@ change the window size ourselves, but they may come at an unexpected moment.
Peek for a character to get any window resize events and fix 'columns' and
'lines' to undo this.
When using the GTK plug mechanism, resizing and focus was not working
properly. (Neil Bird)
After deleting files from the argument list a session file generated with
":mksession" may contain invalid ":next" commands.
@@ -1438,4 +1847,203 @@ the buffer to use "fname", the modified flag was reset.
When appending to to current file the "not edited" flag would be reset.
":w" would overwrite the file accidentally.
Unix: When filtering text with an external command Vim would still read input,
causing text typed for the command (e.g., a password) to be eaten and echoed.
Don't read input when the terminal is in cooked mode.
The Cygwin version of xxd used CR/LF line separators. (Corinna Vinschen)
Unix: When filtering text through a shell command some resulting text may be
dropped. Now after detecting that the child has exited try reading some more
of its output.
When inside input(), using "CTRL-R =" and the expression throws an exception
the command line was not abandoned but it wasn't used either. Now abandon
typing the command line.
'delcombine' was also used in Visual and Select mode and for commands like
"cl". That was illogical and has been disabled.
When recording while a CursorHold autocommand was defined special keys would
appear in the register. Now the CursorHold event is not triggered while
recording.
Unix: the src/configure script used ${srcdir-.}, not all shells understand
that. Use ${srcdir:-.} instead.
When editing file "a" which is a symlink to file "b" that doesn't exist,
writing file "a" to create "b" and then ":split b" resulted in two buffers on
the same file with two different swapfile names. Now set the inode in the
buffer when creating a new file.
When 'esckeys' is not set don't send the xterm code to request the version
string, because it may cause trouble in Insert mode.
When evaluating an expression for CTRL-R = on the command line it was possible
to call a function that opens a new window, resulting in errors for
incremental search, and many other nasty things were possible. Now use the
|textlock| to disallow changing the buffer or jumping to another window
to protect from unexpected behavior. Same for CTRL-\ e.
"d(" deleted the character under the cursor, while the documentation specified
an exclusive motion. Vi also doesn't delete the character under the cursor.
Shift-Insert in Insert mode could put the cursor before the last character
when it just fits in the window. In coladvance() don't stop at the window
edge when filling with spaces and when in Insert mode. In mswin.vim avoid
getting a beep from the "l" command.
Win32 GUI: When Alt-F4 is used to close the window and Cancel is selected in
the dialog then Vim would insert <M-F4> in the text. Now it's ignored.
When ":silent! {cmd}" caused the swap file dialog, which isn't displayed,
there would still be a hit-enter prompt.
Requesting the termresponse (|t_RV|) early may cause problems with "-c"
arguments that invoke an external command or even "-c quit". Postpone it
until after executing "-c" arguments.
When typing in Insert mode so that a new line is started, using CTRL-G u to
break undo and start a new change, then joining the lines with <BS> caused
undo info to be missing. Now reset the insertion start point.
Syntax HL: When a region start match has a matchgroup and an offset that
happens to be after the end of the line then it continued in the next line and
stopped at the region end match, making the region continue after that.
Now check for the column being past the end of the line in syn_add_end_off().
When changing a file, setting 'swapfile' off and then on again, making another
change and killing Vim, then some blocks may be missing from the swapfile.
When 'swapfile' is switched back on mark all blocks in the swapfile as dirty.
Added mf_set_dirty().
Expanding wildcards in a command like ":e aap;<>!" didn't work. Put
backslashes before characters that are special to the shell. (Adri Verhoef)
A CursorHold autocommand would cause a message to be cleared. Don't show the
special key for the event for 'showcmd'.
When expanding a file name for a shell command, as in "!cmd foo<Tab>" or ":r
!cmd foo<Tab>" also escape characters that are special for the shell:
"!;&()<>".
When the name of the buffer was set by a ":r fname" command |cpo-f| no
autocommands were triggered to notify about the change in the buffer list.
In the quickfix buffer 'bufhidden' was set to "delete", which caused closing
the quickfix window to leave an unlisted "No Name" buffer behind every time.
Win32: when using two screens of different size, setting 'lines' to a large
value didn't fill the whole screen. (SungHyun Nam)
Win32 installer: The generated _vimrc contained an absolute path to diff.exe.
After upgrading it becomes invalid. Now use $VIMRUNTIME instead.
The command line was cleared to often when 'showmode' was set and ":silent
normal vy" was used. Don't clear the command line unless the mode was
actually displayed. Added the "mode_displayed" variable.
The "load session" toolbar item could not handle a space or other special
characters in v:this_session.
":set sta ts=8 sw=4 sts=2" deleted 4 spaces halfway a line instead of 2.
In a multi-byte file the foldmarker could be recognized in the trail byte.
(Taro Muraoka)
Pasting with CTRL-V and menu didn't work properly when some commands are
mapped. Use ":normal!" instead of ":normal". (Tony Apuzzo)
Crashed when expanding a file name argument in backticks.
In some situations the menu and scrollbar didn't work, when the value contains
a CSI byte. (Yukihiro Nakadaira)
GTK GUI: When drawing the balloon focus changes and we might get a key release
event that removed the balloon again. Ignore the key release event.
'titleold' was included in ":mkexrc" and ":mksession" files.
":set background&" didn't use the same logic as was used when starting up.
When "umask" is set such that nothing is writable then the viminfo file would
be written without write permission. (Julian Bridle)
Motif: In diff mode dragging one scrollbar didn't update the scrollbar of the
other diff'ed window.
When editing in an xterm with a different number of colors than expected the
screen would be cleared and redrawn, causing the message about the edited file
to be cleared. Now set "keep_msg" to redraw the last message.
For a color terminal: When the Normal HL uses bold, possibly to make the color
lighter, and another HL group specifies a color it might become light as well.
Now reset bold if a HL group doesn't specify bold itself.
When using 256 color xterm the color 255 would show up as color 0. Use a
short instead of a char to store the color number.
ml_get errors when searching for "\n\zs" in an empty file.
When selecting a block and using "$" to select until the end of every line and
not highlighting the character under the cursor the first character of the
block could be unhighlighted.
When counting words for the Visual block area and using "$" to select until
the end of every line only up to the length of the last line was counted.
"dip" in trailing empty lines left one empty line behind.
The script ID was only remembered globally for each option. When a buffer- or
window-local option was set the same "last set" location was changed for all
buffers and windows. Now remember the script ID for each local option
separately.
GUI: The "Replace All" button didn't handle backslashes in the replacement in
the same way as "Replace". Escape backslashes so that they are taken
literally.
When using Select mode from Insert mode and typing a key, causing lines to be
deleted and a message displayed, delayed the effect of inserting the key.
Now overwrite the message without delay.
When 'whichwrap' includes "l" then "dl" and "yl" on a single letter line
worked differently. Now recognize all operators when using "l" at the end of
a line.
GTK GUI: when the font selector returned a font name with a comma in it then
it would be handled like two font names. Now put a backslash before the
comma.
MS-DOS, Win32: When 'encoding' defaults to "latin1" then the value for
'iskeyword' was still for CPxxx. And when 'nocompatible' was set 'isprint'
would also be the wrong value.
When a command was defined not to take arguments and no '|' no warning message
would be given for using a '|'. Also with ":loadkeymap".
Motif: When using a fontset and 'encoding' is "utf-8" and sizeof(wchar_t) !=
sizeof(XChar2b) then display was wrong. (Yukihiro Nakadaira)
":all" always set the current window to the first window, even when it
contains a buffer that is not in the argument list (can't be closed because it
is modified). Now go to the window that has the first item of the argument
list.
GUI: To avoid left-over pixels from bold text all characters after a character
with special attributes were redrawn. Now only do this for characters that
actually are bold. Speeds up displaying considerably.
When only highlighting changes and the text is scrolled at the same time
everything is redraw instead of using a scroll and updating the changed text.
E.g., when using ":match" to highlight a paren that the cursor landed on.
Added SOME_VALID: Redraw the whole window but also try to scroll to minimize
redrawing.
Win32: When using Korean IME making it active didn't work properly. (Moon,
Yu-sung, 2005 March 21)
Ruby interface: when inserting/deleting lines display wasn't updated. (Ryan
Paul)
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,4 +1,4 @@
*vi_diff.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
*vi_diff.txt* For Vim version 7.0aa. Last change: 2006 Jan 02
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -87,7 +87,9 @@ Length of an expanded string option
Maximum display width Unix and Win32: 1024 characters, otherwise 255
characters
Maximum lhs of a mapping 50 characters.
Number of highlighting different types: 223
Number of different highlighting types: over 30000
Range of a Number variable: -2147483648 to 2147483647 (more on 64 bit
systems)
Information for undo and text in registers is kept in memory, thus when making
(big) changes the amount of (virtual) memory available limits the number of

View File

@@ -0,0 +1,574 @@
.\" Traduction Lundi 7 août 2000 par Richard Hitier
.\" (richard.hitier@dial.oleane.com)
.\" Mise à jour de la traduction par David Blanchet
.\" (david.blanchet@free.fr) 2005-01-17
.\"
.TH VIM 1 "22 Février 2002"
.SH NOM
vim \- Vi IMproved, éditeur de texte pour programmeurs
.SH SYNOPSIS
.br
.B vim
[options] [fichier ...]
.br
.B vim
[options] \-
.br
.B vim
[options] \-t marqueur
.br
.B vim
[options] \-q [fichiererreurs]
.PP
.br
.B ex
.br
.B view
.br
.B gvim
.B gview
.B evim
.B eview
.br
.B rvim
.B rview
.B rgvim
.B rgview
.SH DESCRIPTION
.B Vim
est un éditeur de texte proposant une compatibilité ascendante
avec Vi. Il permet d'éditer n'importe quel type de texte brut.
Il est particulièrement adapté pour l'édition des programmes.
.PP
Il comporte de nombreuses améliorations par rapport à Vi : annulation sur
plusieurs niveaux, fenêtres et tampons multiples, coloration syntaxique,
édition en ligne de commande, complètement des noms de fichiers, aide en
ligne, sélection visuelle, etc.
Voir ":help vi_diff.txt" pour un résumé des différences entre
.B Vim
et Vi.
.PP
Pendant l'exécution de
.B Vim
\, une aide abondante est accessible au travers du système d'aide
en ligne, grâce à la commande ":help".
Voir la section AIDE EN LIGNE plus bas.
.PP
Le plus souvent
.B Vim
est démarré pour éditer un unique fichier avec la commande
.PP
vim fichier
.PP
Plus généralement,
.B Vim
est lancé avec :
.PP
vim [options] [listefichiers]
.PP
Si la listefichiers est omise, l'éditeur démarre avec un tampon vide.
Autrement, l'une des quatre méthodes suivantes vous permettra de choisir
un ou plusieurs fichiers à éditer.
.TP 12
fichier ...
Une liste de noms de fichiers.
Le premier sera le fichier courant et sera lu dans le tampon.
Le curseur sera placé sur la première ligne du tampon.
Vous pouvez passer aux autres fichiers avec la commande ":next".
Pour éditer un fichier débutant par un tiret, faites précéder la
liste de fichiers par "\-\-".
.TP
\-
Le fichier à éditer est lu sur l'entrée standard (stdin). Les commandes sont
lues depuis stderr, qui devrait être un terminal.
.TP
\-t {marqueur}
Le fichier à éditer et la position initiale du curseur dépendent
d'un "marqueur", qui est une sorte d'étiquette.
{marqueur} est recherché dans le fichier des marqueurs, le fichier correspondant
devient le fichier courant et la commande associée est exécutée.
Principalement utile pour les programmes en C ; dans ce cas, {marqueur}
peut être le nom d'une fonction.
Au final, le fichier contenant cette fonction devient le fichier
courant et le curseur est placé au début de la fonction.
Voir ":help tag\-commands".
.TP
\-q [fichiererreurs]
Démarre en mode Mise-au-point (QuickFix).
Le fichier [fichiererreurs] est lu et la première erreur est affichée.
Si [fichiererreurs] est omis, le nom du fichier est lu dans
l'option 'errorfile' ("AztecC.Err" par défaut sur Amiga, "errors.err" sur les
autres systèmes).
La commande ":cn" permet de sauter aux erreurs suivantes.
Voir ":help quickfix".
.PP
.B Vim
se comporte différemment selon le nom de la commande (l'exécutable peut
cependant être le même fichier).
.TP 10
vim
La façon "normale", le comportement par défaut.
.TP
ex
Démarre en mode Ex.
La commande ":vi" permet de passer en mode Normal.
Ce mode est également accessible avec l'argument "\-e".
.TP
view
Démarre en mode Lecture-Seule. Vous êtes protégé de l'écriture accidentelle
des fichiers. Ce mode est également accessible avec l'argument "\-R".
.TP
gvim gview
La version graphique.
Ouvre une nouvelle fenêtre.
Également accessible avec l'argument "\-g".
.TP
evim eview
La version graphique en mode Débutant (easy).
Ouvre une nouvelle fenêtre.
Également accessible avec l'argument "\-y".
.TP
rvim rview rgvim rgview
Comme ci-dessus, mais avec des restrictions. Il vous sera impossible de
lancer des commandes du shell, ou de suspendre
.B Vim.
Également accessible avec l'argument "\-Z".
.SH OPTIONS
Les options peuvent être spécifiées dans n'importe quel ordre,
avant ou après les noms de fichiers. Les options sans arguments
peuvent être combinées après un unique tiret.
.TP 12
+[num]
Place le curseur sur la ligne "num" dans le premier fichier.
Si "num" est omis, le curseur sera placé sur la dernière ligne.
.TP
+/{motif}
Place le curseur sur la première occurence de {motif} dans le premier fichier.
Voir ":help search\-pattern" pour connaître les motifs de recherches
disponibles.
.TP
+{commande}
.TP
\-c {commande}
Exécute {commande} après la lecture du premier fichier.
{commande} est interprétée comme une commande Ex.
Si la {commande} contient des espaces, elle doit être entourée
de doubles-apostrophes (cela dépend du shell utilisé).
Exemple: Vim "+set si" main.c
.br
Note : vous pouvez utiliser jusqu'à 10 commandes "+" ou "\-c".
.TP
\-S {fichier}
Source {fichier} après la lecture du premier fichier.
C'est équivalent à \-c "source {fichier}".
{fichier} ne peut pas débuter par un '\-'.
Si {fichier} est omis, "Session.vim" est utilisé (cela ne fonctionne que si
\-S est le dernier argument).
.TP
\-\-cmd {commande}
Comme "\-c", mais la commande est exécutée juste avant de traiter les fichiers
vimrc.
Vous pouvez utiliser jusqu'à 10 de ces commandes, indépendamment des
commandes "\-c".
.TP
\-A
Si
.B Vim
a été compilé avec le support de la fonctionnalité ARABIC pour l'édition de
fichiers de droite à gauche et les claviers arabes, cette option lance
.B Vim
en mode Arabe, c.-à-d. que l'option 'arabic' est activée.
Sinon, un message d'erreur est émis et
.B Vim
quitte.
.TP
\-b
Mode Binaire.
Active plusieurs options pour permettre l'édition
d'un fichier binaire ou exécutable.
.TP
\-C
Compatible. Active l'option 'compatible'.
.B Vim
se comportera alors quasiment comme Vi, même s'il existe un fichier .vimrc.
.TP
\-d
Démarre en mode Diff.
Deux ou trois noms de fichiers doivent être spécifiés.
.B Vim
ouvrira alors tous les fichiers et affichera leurs différences.
Fonctionne comme vimdiff(1).
.TP
\-d {périph}
Ouvre {périph} pour l'utiliser comme terminal.
Uniquement sur Amiga.
Exemple:
"\-d con:20/30/600/150".
.TP
\-D
Debogage. Passe en mode Débogage lors de l'exécution de la première commande
d'un script.
.TP
\-e
Démarre
.B Vim
en mode Ex, comme si l'exécutable s'appelait "ex".
.TP
\-E
Démarre
.B Vim
en mode Ex amélioré, comme si l'exécutable "exim" avait été invoqué.
.TP
\-f
Premier-plan (Foreground). Pour la version graphique,
.B Vim
ne forke pas et ne se détache pas du shell dans lequel il a été invoqué.
Sur Amiga,
.B Vim
n'est pas relancé pour ouvrir une nouvelle fenêtre.
Cette option est utile quand
.B Vim
est exécuté par un programme qui attend la fin de la session d'édition
(par exemple mail).
Sur Amiga, les commandes ":sh" et ":!" ne fonctionneront pas.
.TP
\-\-nofork
Premier-plan (Foreground). Pour la version graphique,
.B Vim
ne forkera pas et ne se détachera pas du shell dans lequel il a été lancé.
.TP
\-F
Si
.B Vim
a été compilé avec le support de la fonctionnalité FKMAP pour l'édition de
fichiers de droite à gauche et les claviers farsi, cette option lance
.B Vim
en mode Farsi, c.-à-d. avec les options 'fkmap' et 'rightleft' activées.
Sinon, un message d'erreur est émis et
.B Vim
quitte.
.TP
\-g
Si
.B Vim
a été compilé avec le support de l'IHM graphique, cette option active
l'IHM graphique. Si le support n'a pas été compilé, un message d'erreur
est émis et
.B Vim
quitte.
.TP
\-h
Donne une aide succinte sur les arguments et les options de la ligne de
commande. Après cela,
.B Vim
quitte.
.TP
\-H
Si
.B Vim
a été compilé avec le support de la fonctionnalité RIGHTLEFT pour l'édition de
fichiers de droite à gauche et les claviers hébreu, cette option lance
.B Vim
en mode Hebreu, c.-à-d. avec les options 'hkmap' et 'rightleft' activées.
Sinon, un message d'erreur est émis et
.B Vim
quitte.
.TP
\-i {viminfo}
Lorsque l'utilisation d'un fichier viminfo est activée, cette option indique
le nom de fichier à utiliser à la place de "~/.viminfo" par défaut.
Il est possible d'empêcher l'utilisation d'un fichier ".viminfo", en
spécifiant le nom de fichier "NONE".
.TP
\-L
Comme \-r.
.TP
\-l
Mode Lisp.
Active les options 'lisp' et 'showmatch'.
.TP
\-m
Empêche la modification des fichiers.
Désactive l'option 'write'.
Vous pouvez toujours modifier le tampon, mais il vous sera impossible
d'écrire le fichier.
.TP
\-M
N'autorise aucune modification. les options 'modifiable' et 'write' sont
desactivées, de sorte que les changements ne sont pas autorisés et que les
fichiers ne peuvent pas être écrits. Note : ces options peuvent être activées
pour autoriser les modifications.
.TP
\-N
Mode Non-compatible. Désactive l'option 'compatible'.
Cela améliorera le comportement de
.B Vim
\, mais il sera moins conforme à celui de Vi, même s'il n'existe aucun
fichier ".vimrc".
.TP
\-n
N'utilise pas de fichier d'échange (swapfile).
Le recouvrement après un plantage sera impossible.
Utile pour éditer un fichier sur un support très lent (disquette par ex.).
Également activable avec ":set uc=0".
Il est possible de l'annuler avec ":set uc=200".
.TP
\-nb
Devient un serveur d'édition pour NetBeans. Consulter la documentation à ce
sujet pour davantage de détails.
.TP
\-o[N]
Ouvre N fenêtres les unes au-dessus des autres.
Quand N est omis, ouvre une fenêtre pour chaque fichier.
.TP
\-O[N]
Ouvre N fenêtres côte à côte.
Quand N est omis, ouvre une fenêtre pour chaque fichier fichier.
.TP
\-R
Mode Lecture-Seule.
Active l'option 'readonly'.
Vous pouvez toujours éditer le tampon, mais il vous sera impossible de
d'écraser accidentellement un fichier.
Si vous voulez écraser un fichier, ajoutez un point d'exclamation à la commande
Ex, comme dans ":w!".
L'option \-R impose l'option \-n (voir ci-dessus).
L'option 'readonly' peut être désactivée avec ":set noro".
Voir ":help 'readonly'".
.TP
\-r
Donne la liste des fichiers d'échange, avec des informations pour les utiliser
à des fins de recouvrement.
.TP
\-r {file}
Mode Recouvrement.
Utilise le fichier d'échange pour récouvrer d'une session d'édition plantée.
Le fichier d'échange est un fichier avec le même nom que le fichier texte,
suivi du suffixe ".swp".
Voir ":help recovery".
.TP
\-s
Mode Silencieux. Disponible uniquement quand
.B Vim
est lancé en tant que "ex" ou quand l'option "\-e" a été spécifiée avant
l'option "\-s".
.TP
\-s {scriptEntrée}
Lit le fichier de script {scriptEntrée}.
Les caractères du fichier sont interprétés comme si vous les tapiez.
La commande ":source! {scriptEntrée}" donne le même résultat.
Si la fin du fichier est atteinte avant que l'éditeur quitte, les caractères
suivants sont lus depuis le clavier.
.TP
\-T {terminal}
Indique à
.B Vim
le nom du terminal utilisé.
Cela n'est requis que lorsque la détection automatique échoue.
Le {terminal} devrait être connu de
.B Vim
(intégré) ou défini dans le fichier termcap ou terminfo.
.TP
\-u {vimrc}
Utilise les commandes du fichier {vimrc} pour les initialisations.
Toutes les autres initialisations sont omises.
À utiliser pour éditer un type de fichiers particulier.
Cela permet aussi d'omettre toute initialisation en spécifiant le nom de
fichier "NONE".
Voir ":help initialization" dans Vim pour davantage de détails.
.TP
\-U {gvimrc}
Utilise les commandes du fichier {gvimrc} pour l'initialisation de l'IHM
graphique.
Toutes les autres initialisations graphiques sont omises.
Cela permet aussi d'omettre toute initialisation graphique en spécifiant le nom
de fichier "NONE".
Voir ":help gui\-init" dans Vim pour davantage de détails.
.TP
\-V[N]
Mode Verbeux.
Donne des messages à propos des fichiers sourcés, ainsi que sur la lecture
et les écritures dans le fichier viminfo. le nombre optionnel N précise la
valeur de l'option 'verbose' (10 par défaut).
.TP
\-v
Démarre
.B Vim
en mode Vi, comme si l'exécutable s'appelait "vi". Cela n'a d'effet que si
l'exécutable invoqué est "ex".
.TP
\-w {scriptSortie}
Tous les caractères que vous tapez sont enregistrés dans le fichier
{scriptSortie}, jusqu'à ce que vous quittiez
.B Vim.
C'est utile quand vous voulez créer un fichier de script à utiliser avec
"vim \-s" ou ":source!".
Si le fichier {scriptSortie} existe, les caractères sont ajoutés à la fin.
.TP
\-W {scriptSortie}
Comme \-w, mais un fichier existant sera écrasé.
.TP
\-x
Chiffre les fichiers lors de l'écriture. Une clé de chiffrement sera demandée.
.TP
\-X
Ne se connecte pas au serveur X. Accélère le temps de démarrage dans un
terminal, mais le titre de la fenêtre et le presse-papier seront inaccessibles.
.TP
\-y
Démarre
.B Vim
en mode Débutant (easy), comme si l'exécutable s'appelait "evim" ou "eview".
Donne à
.B Vim
un comportement plus proche des éditeurs « cliquez-tapez ».
.TP
\-Z
Mode restreint. Fonctionne comme si l'exécutable commençait par la lettre 'r'.
.TP
\-\-
Délimite la fin des options.
Les arguments qui suivent seront considérés comme des noms de fichiers.
Cela permet d'éditer des fichier débutant par un '\-'.
.TP
\-\-echo\-wid
IHM graphique GTK uniquement : retourne la Window ID sur stdout.
.TP
\-\-help
Donne un message d'aide et quitte, comme "\-h".
.TP
\-\-literal
Prend les arguments de noms de fichiers littéralement, sans étendre les
jokers. N'a aucun effet sur Unix, où le shell étend les jokers.
.TP
\-\-noplugin
Ne charge pas les greffons. Implicite avec \-u NONE.
.TP
\-\-remote
Se connecte à un serveur Vim et lui fait éditer les fichiers spécifiés dans
le reste des arguments. Si aucun serveur n'est trouvé, un avertissement est
émis et les fichiers sont édités dans le Vim courant.
.TP
\-\-remote\-expr {expr}
Se connecte à un serveur Vim, y évalue {expr} et affiche le résultat sur la
sortie standard (stdout).
.TP
\-\-remote\-send {touches}
Se connecte à un serveur Vim et y envoie {touches}.
.TP
\-\-remote\-silent
Comme \-\-remote, mais sans émettre d'avertissement si aucun serveur n'est
trouvé.
.TP
\-\-remote\-wait
Comme \-\-remote, mais Vim ne quitte pas tant que le fichier est en cours
d'édition.
.TP
\-\-remote\-wait\-silent
Comme \-\-remote\-wait, mais sans émettre d'avertissement si aucun serveur n'est
trouvé.
.TP
\-\-serverlist
Donne la liste des noms de tous les serveurs Vim disponibles.
.TP
\-\-servername {nom}
Utilise {nom} pour le nom de serveur. Ce nom est donné au Vim courant, à moins
qu'il ne soit utilisé avec un argument \-\-remote. Dans ce cas, il s'agit du nom
du serveur auquel se connecter.
.TP
\-\-socketid {id}
IHM graphique GTK+ uniquement : utilise le mécanisme GtkPlug pour faire
fonctionner gvim dans une autre fenêtre.
.TP
\-\-version
Affiche les informations sur la version puis quitte.
.SH AIDE EN LIGNE
Taper ":help" dans
.B Vim
pour commencer.
Taper ":help sujet" pour obtenir de l'aide sur un sujet précis.
Par exemple : ":help ZZ" pour consulter l'aide sur la commande "ZZ".
Utiliser <Tab> et CTRL\-D pour compléter les sujets (":help
cmdline\-completion").
Des marqueurs sont inclus dans l'aide et vous permettent de sauter d'un endroit
à un autre (comme des liens hypertextes, voir ":help").
L'ensemble des fichiers de la documentation peut être consulté de cette
façon, par exemple ":help syntax.txt".
.SH FICHIERS
.TP 15
/usr/local/lib/vim/doc/*.txt
Les fichiers de la documentation de
.B Vim.
Utiliser ":help doc\-file\-list" pour obtenir la liste complète.
.TP
/usr/local/lib/vim/doc/tags
Le fichier des marqueurs utilisé pour trouver les informations dans les
fichiers de la documentation.
.TP
/usr/local/lib/vim/syntax/syntax.vim
Initialisation de la syntaxe pour l'ensemble du système.
.TP
/usr/local/lib/vim/syntax/*.vim
Fichiers de syntaxe pour différents langages.
.TP
/usr/local/lib/vim/vimrc
Initialisation de
.B Vim
pour l'ensemble du système.
.TP
/usr/local/lib/vim/gvimrc
Initialisation de gvim pour l'ensemble du système.
.TP
/usr/local/lib/vim/optwin.vim
Script utilisé pour la commande ":options", une manière pratique de consulter
et de modifier les options.
.TP
/usr/local/lib/vim/menu.vim
Initialisation des menus de gvim pour l'ensemble du système.
.TP
/usr/local/lib/vim/bugreport.vim
Script pour générer un rapport de bogue. Voir ":help bugs".
.TP
/usr/local/lib/vim/filetype.vim
Script pour détecter le type d'un fichier d'après son nom.
Voir ":help 'filetype'".
.TP
/usr/local/lib/vim/scripts.vim
Script pour détecter le type d'un fichier d'après son contenu.
Voir ":help 'filetype'".
.TP
/usr/local/lib/vim/*.ps
Fichiers utilisés pour l'impression PostScript.
.PP
Pour disposer d'informations récentes, consulter le site Internet de VIM :
.br
<URL:http://www.vim.org/>
.SH VOIR AUSSI
vimtutor(1)
.SH AUTEUR
La majeure partie de
.B Vim
a été écrite par Bram Moolenaar, avec l'aide de nombreux autres contributeurs.
Voir ":help credits" dans
.B Vim.
.br
.B Vim
est basé sur Stevie, réalisé par Tim Thompson,
Tony Andrews et G.R. (Fred) Walter.
Toutefois, pratiquement rien du code original ne subsiste.
.SH BOGUES
Probablement.
Voir ":help todo" pour consulter la liste des problèmes connus.
.PP
NOTE : Remarquez que bon nombre de points, qui pourraient être considérés comme
des bugs par certains, sont en fait dus à une reproduction trop fidèle
du comportement de Vi. Et si vous pensez que d'autres points sont des
bugs "parce que Vi le fait différemment", vous devriez jeter un oeil
attentif au fichier vi_diff.txt (ou taper ":help vi_diff.txt" dans Vim).
Regardez aussi les options 'compatible' et 'coptions'.
.SH TRADUCTION
Cette page de manuel a été traduite par Richard Hitier.
<richard.hitier@dial.oleane.com> 2000-08-07.
.br
Cette page de manuel a été mise à jour par David Blanchet.
<david.blanchet@free.fr> 2005-01-17.

66
runtime/doc/vimball.txt Normal file
View File

@@ -0,0 +1,66 @@
*vimball.txt* Vimball Archiver Mar 20, 2006
Author: Charles E. Campbell, Jr. <NdrOchip@ScampbellPfamily.AbizM>
(remove NOSPAM from Campbell's email first)
Copyright: (c) 2004-2006 by Charles E. Campbell, Jr. *Vimball-copyright*
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!
==============================================================================
1. Contents *vimball* *vimball-contents*
1. Contents......................................: |vimball-contents|
2. Vimball Manual................................: |vimball-manual|
3. Vimball History...............................: |vimball-history|
==============================================================================
2. Vimball Manual *vimball-manual*
*:MkVimball*
:[range]MkVimball[!] filename
This command takes lines holding a path to files to be included in
your vimball; as an example: >
plugin/something.vim
doc/something.txt
< using MkVimball on this range will create a file called
"filename.vba" which can be used by Vimball.vim to re-create these
files. If the "filename.vba" file already exists, then MkVimball
will issue a warning and not create the file.
However, if you use the exclamation point (!), then MkVimball will
create the "filename.vba" file, overwriting it if it already exists.
This behavior resembles that for |:w|.
*vimball-extract*
vim filename.vba
Simply editing a Vimball will cause Vimball.vim to tell the user to
source the file to extract its contents.
Extraction will only proceed if the first line of a putative vimball
file holds the "Vimball Archiver by Charles E. Campbell, Jr., Ph.D."
line.
:VimballList *vimball-vimballlist*
This command will tell Vimball to list the files in the archive, along
with their lengths in lines.
==============================================================================
3. Vimball History *vimball-history*
3 : Mar 20, 2006 * removed query, now requires sourcing to be
extracted (:so %). Message to that effect
included.
* :VimballList now shows files that would be
extracted.
2 : Mar 20, 2006 * query, :UseVimball included
1 : Mar 20, 2006 * initial release
==============================================================================
vim:tw=78:ts=8:ft=help:fdm=marker

View File

@@ -1,4 +1,4 @@
*visual.txt* For Vim version 7.0aa. Last change: 2005 Oct 09
*visual.txt* For Vim version 7.0aa. Last change: 2006 Mar 20
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -258,6 +258,11 @@ operator character: "v{move-around}3>" (move lines 3 indents to the right).
The {move-around} is any sequence of movement commands. Note the difference
with {motion}, which is only ONE movement command.
Another way to operate on the Visual area is using the |/\%V| item in a
pattern. For example, to replace all '(' in the Visual area with '#': >
:%s/\%V(/X/g
==============================================================================
5. Blockwise operators *blockwise-operators*
@@ -455,9 +460,10 @@ example, when a whole line is deleted, it can later be pasted halfway a line.
Mappings and menus in Select mode. *Select-mode-mapping*
In Select mode the mappings and menus of Visual mode are used. Before it is
executed, Vim automatically switches to Visual mode, so that the same
behavior as in Visual mode is effective.
When mappings and menus are defined with the |:vmap| or |:vmenu| command they
work both in Visual mode and in Select mode. When these are used in Select
mode Vim automatically switches to Visual mode, so that the same behavior as
in Visual mode is effective. If you don't want this use |:xmap| or |:smap|.
After the mapping or menu finishes, the selection is enabled again and Select
mode entered, unless the selected area was deleted, another buffer became

View File

@@ -1,4 +1,4 @@
*windows.txt* For Vim version 7.0aa. Last change: 2005 Apr 01
*windows.txt* For Vim version 7.0aa. Last change: 2006 Mar 11
VIM REFERENCE MANUAL by Bram Moolenaar
@@ -68,6 +68,9 @@ inactive no no ' '
Note: All CTRL-W commands can also be executed with |:wincmd|, for those
places where a Normal mode command can't be used or is inconvenient.
The main Vim window can hold several split windows. There are also tab pages
|tab-page|, each of which can hold multiple windows.
==============================================================================
2. Starting Vim *windows-starting*
@@ -255,6 +258,9 @@ CTRL-W c *CTRL-W_c* *:clo* *:close*
:clo[se][!] Close current window. When the 'hidden' option is set, or
when the buffer was changed and the [!] is used, the buffer
becomes hidden (unless there is another window editing it).
When there is only one window in the current tab page and
there is another tab page, this closes the current tab page.
|tab-page|.
This command fails when: *E444*
- There is only one window on the screen.
- When 'hidden' is not set, [!] is not used, the buffer has
@@ -271,6 +277,8 @@ CTRL-W CTRL-C *CTRL-W_CTRL-C*
:hid[e] Quit current window, unless it is the last window on the
screen. The buffer becomes hidden (unless there is another
window editing it or 'bufhidden' is "unload" or "delete").
If the window is the last one in the current tab page the tab
page is closed. |tab-page|
The value of 'hidden' is irrelevant for this command.
Changes to the buffer are not written and won't get lost, so
this is a "safe" command.
@@ -551,6 +559,9 @@ can also get to them with the buffer list commands, like ":bnext".
Rearrange the screen to open one window for each argument.
All other windows are closed. When a count is given, this is
the maximum number of windows to open.
With the |:tab| modifier open a tab page for each argument.
When there are more arguments than 'tabpagemax' further ones
become split windows in the last tab page.
When the 'hidden' option is set, all buffers in closed windows
become hidden.
When 'hidden' is not set, and the 'autowrite' option is set,
@@ -620,7 +631,8 @@ can also get to them with the buffer list commands, like ":bnext".
CTRL-W w
:{cmd}
etc.
< When an error is detected on one window, further
< This only operates in the current tab page.
When an error is detected on one window, further
windows will not be visited.
The last window (or where an error occurred) becomes
the current window.
@@ -628,7 +640,7 @@ can also get to them with the buffer list commands, like ":bnext".
{cmd} must not open or close windows or reorder them.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
Also see |:argdo| and |:bufdo|.
Also see |:tabdo|, |:argdo| and |:bufdo|.
*:bufdo*
:bufdo[!] {cmd} Execute {cmd} in each buffer in the buffer list.
@@ -654,7 +666,7 @@ can also get to them with the buffer list commands, like ":bnext".
each buffer.
{not in Vi} {not available when compiled without the
|+listcmds| feature}
Also see |:argdo| and |:windo|.
Also see |:tabdo|, |:argdo| and |:windo|.
Examples: >
@@ -704,6 +716,11 @@ CTRL-W CTRL-F Split current window in two. Edit file name under cursor.
{not available when the |+file_in_path| feature was disabled
at compile time}
CTRL-W F *CTRL-W_F*
Split current window in two. Edit file name under cursor and
jump to the line number following the file name. See |gF| for
details on how the line number is obtained.
Also see |CTRL-W_CTRL-I|: open window for an included file that includes
the keyword under the cursor.
@@ -715,11 +732,12 @@ normally a small window used to show an include file or definition of a
function.
{not available when compiled without the |+quickfix| feature}
There can be only one preview window. It is created with one of the commands
below. The 'previewheight' option can be set to specify the height of the
preview window when it's opened. The 'previewwindow' option is set in the
preview window to be able to recognize it. The 'winfixheight' option is set
to have it keep the same height when opening/closing other windows.
There can be only one preview window (per tab page). It is created with one
of the commands below. The 'previewheight' option can be set to specify the
height of the preview window when it's opened. The 'previewwindow' option is
set in the preview window to be able to recognize it. The 'winfixheight'
option is set to have it keep the same height when opening/closing other
windows.
*:pta* *:ptag*
:pta[g][!] [tagname]
@@ -939,9 +957,10 @@ list of buffers. |unlisted-buffer|
:bw[ipeout][!] {bufname}
:N,Mbw[ipeout][!]
:bw[ipeout][!] N1 N2 ...
Like |:bdelete|, but really delete the buffer. All marks in
this buffer become invalid, option settings are lost, etc.
Don't use this unless you know what you are doing.
Like |:bdelete|, but really delete the buffer. Everything
related to the buffer is lost. All marks in this buffer
become invalid, option settings are lost, etc. Don't use this
unless you know what you are doing.
:[N]bun[load][!] *:bun* *:bunload* *E515*
:bun[load][!] [N]
@@ -992,9 +1011,11 @@ list of buffers. |unlisted-buffer|
Split window and edit buffer for {filename} from the buffer
list. This will also edit a buffer that is not in the buffer
list, without setting the 'buflisted' flag.
Note: If what you want to do is split the buffer, make a copy
under another name, you can do it this way: >
:w foobar | sp #
*:bn* *:bnext* *E87*
:[N]bn[ext][!] [N]
:[N]bn[ext][!] [N] *:bn* *:bnext* *E87*
Go to [N]th next buffer in buffer list. [N] defaults to one.
Wraps around the end of the buffer list.
See |:buffer-!| for [!].
@@ -1071,6 +1092,8 @@ list of buffers. |unlisted-buffer|
of windows opened ('winwidth' if |:vertical| was prepended).
Buf/Win Enter/Leave autocommands are not executed for the new
windows here, that's only done when they are really entered.
When the |:tab| modifier is used new windows are opended in a
new tab, up to 'tabpagemax'.
Note: All the commands above that start editing another buffer, keep the
'readonly' flag as it was. This differs from the ":edit" command, which sets
@@ -1089,9 +1112,10 @@ purposes. A few options can be set to change the behavior of a buffer:
A few useful kinds of a buffer:
quickfix Used to contain the error list. See |:cwindow|. This command
sets the 'buftype' option to "quickfix". You are not supposed
to change this! 'swapfile' is off.
quickfix Used to contain the error list or the location list. See
|:cwindow| and |:lwindow|. This command sets the 'buftype'
option to "quickfix". You are not supposed to change this!
'swapfile' is off.
help Contains a help file. Will only be created with the |:help|
command. The flag that indicates a help buffer is internal
@@ -1100,18 +1124,18 @@ help Contains a help file. Will only be created with the |:help|
directory Displays directory contents. Can be used by a file explorer
plugin. The buffer is created with these settings: >
:set buftype=nowrite
:set bufhidden=delete
:set noswapfile
:setlocal buftype=nowrite
:setlocal bufhidden=delete
:setlocal noswapfile
< The buffer name is the name of the directory and is adjusted
when using the |:cd| command.
scratch Contains text that can be discarded at any time. It is kept
when closing the window, it must be deleted explicitly.
Settings: >
:set buftype=nofile
:set bufhidden=hide
:set noswapfile
:setlocal buftype=nofile
:setlocal bufhidden=hide
:setlocal noswapfile
< The buffer name can be used to identify the buffer.
*unlisted-buffer*
@@ -1119,7 +1143,7 @@ unlisted The buffer is not in the buffer list. It is not used for
normal editing, but to show a help file, remember a file name
or marks. The ":bdelete" command will also set this option,
thus it doesn't completely delete the buffer. Settings: >
:set nobuflisted
:setlocal nobuflisted
<
vim:tw=78:ts=8:ft=help:norl:

View File

@@ -1,7 +1,7 @@
" Vim support file to detect file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last Change: 2005 Nov 23
" Last Change: 2006 Mar 13
" Listen very carefully, I will say this only once
if exists("did_load_filetypes")
@@ -399,7 +399,7 @@ fun! s:FTent()
setf dtd
endfun
" Clipper (or FoxPro)
" Clipper (or FoxPro; could also be eviews)
au BufNewFile,BufRead *.prg
\ if exists("g:filetype_prg") |
\ exe "setf " . g:filetype_prg |
@@ -606,6 +606,9 @@ au BufNewFile,BufRead *.gpi setf gnuplot
" GrADS scripts
au BufNewFile,BufRead *.gs setf grads
" Gretl
au BufNewFile,BufRead *.gretl setf gretl
" Groovy
au BufNewFile,BufRead *.groovy setf groovy
@@ -888,6 +891,9 @@ au BufNewFile,BufRead *.mf setf mf
" MetaPost
au BufNewFile,BufRead *.mp setf mp
" MGL
au BufNewFile,BufRead *.mgl setf mgl
" MMIX or VMS makefile
au BufNewFile,BufRead *.mms call s:FTmms()
@@ -1291,6 +1297,9 @@ au BufNewFile,BufRead *.rexx,*.rex setf rexx
" R (Splus)
au BufNewFile,BufRead *.s,*.S setf r
" R Help file
au BufNewFile,BufRead *.rd,*.Rd setf rhelp
" Rexx, Rebol or R
au BufNewFile,BufRead *.r,*.R call s:FTr()
@@ -1652,19 +1661,29 @@ au BufNewFile,BufRead *.latex,*.sty,*.dtx,*.ltx,*.bbl setf tex
au BufNewFile,BufRead *.tex call s:FTtex()
fun! s:FTtex()
let n = 1
while n < 10 && n < line("$")
let line = getline(n)
if line =~ '^\s*\\\%(documentclass\>\|usepackage\>\|begin{\)'
setf tex
return
elseif line =~ '^\s*\\\%(start\l\+\|setup\l\+\|usemodule\)\>'
setf context
return
let lnum = 1
let checked = 0
while checked < 25 && lnum < line("$")
let line = getline(lnum)
if line !~ '^\s*%'
if line =~ '^\s*\\\%(documentclass\>\|usepackage\>\|begin{\|newcommand\>\|renewcommand\>\)'
setf tex
return
elseif line =~ '^\s*\\\%(start\a\+\|setup\a\+\|usemodule\|enablemode\|enableregime\|setvariables\|useencoding\|usesymbols\|stelle\a\+\|verwende\a\+\|stel\a\+\|gebruik\a\+\|usa\a\+\|imposta\a\+\|regle\a\+\|utilisemodule\)\>'
setf context
return
endif
let checked = checked + 1
endif
let n = n + 1
let lnum = lnum + 1
endwhile
setf tex
" Didn't recognize anything, guess.
if exists("g:tex_flavour") && g:tex_flavour == "context"
setf context
else
setf tex
endif
endfun
" Context
@@ -1761,6 +1780,9 @@ au BufNewFile,BufRead *.wml setf wml
" Winbatch
au BufNewFile,BufRead *.wbt setf winbatch
" WSML
au BufNewFile,BufRead *.wsml setf wsml
" WvDial
au BufNewFile,BufRead wvdial.conf,.wvdialrc setf wvdial

View File

@@ -1,7 +1,7 @@
" Vim support file to switch on loading plugins for file types
"
" Maintainer: Bram Moolenaar <Bram@vim.org>
" Last change: 2005 Mar 25
" Last change: 2006 Mar 18
if exists("did_load_ftplugin")
finish
@@ -10,18 +10,26 @@ let did_load_ftplugin = 1
augroup filetypeplugin
au FileType * call s:LoadFTPlugin()
func! s:LoadFTPlugin()
if exists("b:undo_ftplugin")
exe b:undo_ftplugin
unlet! b:undo_ftplugin b:did_ftplugin
endif
if expand("<amatch>") != ""
let s = expand("<amatch>")
if s != ""
if &cpo =~# "S" && exists("b:did_ftplugin")
" In compatible mode options are reset to the global values, need to
" set the local values also when a plugin was already used.
unlet b:did_ftplugin
endif
runtime! ftplugin/<amatch>.vim ftplugin/<amatch>_*.vim ftplugin/<amatch>/*.vim
" When there is a dot it is used to separate filetype names. Thus for
" "aaa.bbb" load "aaa" and then "bbb".
for name in split(s, '\.')
exe 'runtime! ftplugin/' . name . '.vim ftplugin/' . name . '_*.vim ftplugin/' . name . '/*.vim'
endfor
endif
endfunc
augroup END

View File

@@ -0,0 +1,13 @@
" Vim filetype plugin file
" Language: Javascript
" Maintainer: Bram Moolenaar (for now)
" Last Change: 2006 Jan 30
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
if exists('&ofu')
setlocal ofu=javascriptcomplete#CompleteJS
endif

View File

@@ -1,8 +1,8 @@
" Vim settings file
" Language: LambdaProlog (Teyjus)
" Maintainer: Markus Mottl <markus@oefai.at>
" URL: http://www.oefai.at/~markus/vim/ftplugin/lprolog.vim
" Last Change: 2001 Oct 02 - fixed uncommenting bug (MM)
" Maintainer: Markus Mottl <markus.mottl@gmail.com>
" URL: http://www.ocaml.info/vim/ftplugin/lprolog.vim
" Last Change: 2006 Feb 05
" 2001 Sep 16 - fixed 'no_mail_maps'-bug (MM)
" 2001 Sep 02 - initial release (MM)

View File

@@ -0,0 +1,30 @@
" Vim filetype plugin file
" Language: matlab
" Maintainer: Jake Wasserman <jwasserman at gmail dot com>
" Last Changed: 2006 Jan 12
if exists("b:did_ftplugin")
finish
endif
let b:did_ftplugin = 1
let s:save_cpo = &cpo
set cpo-=C
if exists("loaded_matchit")
let s:conditionalEnd = '\(([^()]*\)\@!\<end\>\([^()]*)\)\@!'
let b:match_words = '\<if\>\|\<while\>\|\<for\>\|\<switch\>:' .
\ s:conditionalEnd . ',\<if\>:\<elseif\>:\<else\>:' .
\ s:conditionalEnd
endif
setlocal suffixesadd=.m
setlocal suffixes+=.asv
let b:undo_ftplugin = "setlocal suffixesadd< suffixes< "
\ . "| unlet! b:match_words"
let &cpo = s:save_cpo

View File

@@ -4,7 +4,7 @@
" Markus Mottl <markus.mottl@gmail.com>
" Stefano Zacchiroli <zack@bononia.it>
" URL: http://www.ocaml.info/vim/ftplugin/ocaml.vim
" Last Change: 2005 Oct 13 - removed GPL; better matchit support (MM, SZ)
" Last Change: 2006 Feb 05
"
" if exists("b:did_ftplugin")
" finish
@@ -377,4 +377,3 @@ let &cpoptions=s:cposet
unlet s:cposet
" vim:sw=2

View File

@@ -1,7 +1,7 @@
" Vim filetype plugin file
" Language: Perl
" Maintainer: Dan Sharp <dwsharp at hotmail dot com>
" Last Change: 2004 Dec 06
" Last Change: 2005 Dec 16
" URL: http://mywebpage.netscape.com/sharppeople/vim/ftplugin
if exists("b:did_ftplugin") | finish | endif
@@ -27,7 +27,7 @@ endif
" Provided by Ned Konz <ned at bike-nomad dot com>
"---------------------------------------------
setlocal include=\\<\\(use\\|require\\)\\>
setlocal include=\\<\\(use\\\|require\\)\\>
setlocal includeexpr=substitute(substitute(v:fname,'::','/','g'),'$','.pm','')
setlocal define=[^A-Za-z_]

View File

@@ -51,6 +51,11 @@ if exists("loaded_matchit")
endif
" ###
if exists('&ofu')
setlocal ofu=phpcomplete#CompletePHP
endif
setlocal commentstring=/*%s*/
" Undo the stuff we changed.

View File

@@ -14,6 +14,8 @@ setlocal suffixesadd=.py
setlocal comments-=:%
setlocal commentstring=#%s
setlocal omnifunc=pycomplete#Complete
set wildignore+=*.pyc
nnoremap <silent> <buffer> ]] :call <SID>Python_jump('/^\(class\\|def\)')<cr>

View File

@@ -1,10 +1,13 @@
" SQL filetype plugin file
" Language: SQL (Common for Oracle, Microsoft SQL Server, Sybase)
" Version: 0.08
" Version: 1.0
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Mon Feb 21 2005 7:27:36 AM
" Last Change: Wed Jan 11 2006 10:04:55 AM
" Download: http://vim.sourceforge.net/script.php?script_id=454
" For more details please use:
" :h sql.txt
"
" This file should only contain values that are common to all SQL languages
" Oracle, Microsoft SQL Server, Sybase ASA/ASE, MySQL, and so on
" If additional features are required create:
@@ -12,6 +15,22 @@
" .vim/after/ftplugin/sql.vim (Unix)
" to override and add any of your own settings.
" This file also creates a command, SQLSetType, which allows you to change
" SQL dialects on the fly. For example, if I open an Oracle SQL file, it
" is color highlighted appropriately. If I open an Informix SQL file, it
" will still be highlighted according to Oracles settings. By running:
" :SQLSetType sqlinformix
"
" All files called sqlinformix.vim will be loaded from the indent and syntax
" directories. This allows you to easily flip SQL dialects on a per file
" basis. NOTE: you can also use completion:
" :SQLSetType <tab>
"
" To change the default dialect, add the following to your vimrc:
" let g:sql_type_default = 'sqlanywhere'
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
finish
@@ -20,8 +39,146 @@ endif
let s:save_cpo = &cpo
set cpo=
" Functions/Commands to allow the user to change SQL syntax dialects
" through the use of :SQLSetType <tab> for completion.
" This works with both Vim 6 and 7.
if !exists("*SQL_SetType")
" NOTE: You cannot use function! since this file can be
" sourced from within this function. That will result in
" an error reported by Vim.
function SQL_GetList(ArgLead, CmdLine, CursorPos)
if !exists('s:sql_list')
" Grab a list of files that contain "sql" in their names
let list_indent = globpath(&runtimepath, 'indent/*sql*')
let list_syntax = globpath(&runtimepath, 'syntax/*sql*')
let list_ftplugin = globpath(&runtimepath, 'ftplugin/*sql*')
let sqls = "\n".list_indent."\n".list_syntax."\n".list_ftplugin."\n"
" Strip out everything (path info) but the filename
" Regex
" From between two newline characters
" Non-greedily grab all characters
" Followed by a valid filename \w\+\.\w\+ (sql.vim)
" Followed by a newline, but do not include the newline
"
" Replace it with just the filename (get rid of PATH)
"
" Recursively, since there are many filenames that contain
" the word SQL in the indent, syntax and ftplugin directory
let sqls = substitute( sqls,
\ '[\n]\%(.\{-}\)\(\w\+\.\w\+\)\n\@=',
\ '\1\n',
\ 'g'
\ )
" Remove duplicates, since sqlanywhere.vim can exist in the
" sytax, indent and ftplugin directory, yet we only want
" to display the option once
let index = match(sqls, '.\{-}\ze\n')
while index > -1
" Get the first filename
let file = matchstr(sqls, '.\{-}\ze\n', index)
" Recursively replace any *other* occurrence of that
" filename with nothing (ie remove it)
let sqls = substitute(sqls, '\%>'.(index+strlen(file)).'c\<'.file.'\>\n', '', 'g')
" Move on to the next filename
let index = match(sqls, '.\{-}\ze\n', (index+strlen(file)+1))
endwhile
" Sort the list if using version 7
if v:version >= 700
let mylist = split(sqls, "\n")
let mylist = sort(mylist)
let sqls = join(mylist, "\n")
endif
let s:sql_list = sqls
endif
return s:sql_list
endfunction
function SQL_SetType(name)
" User has decided to override default SQL scripts and
" specify a vendor specific version
" (ie Oracle, Informix, SQL Anywhere, ...)
" So check for an remove any settings that prevent the
" scripts from being executed, and then source the
" appropriate Vim scripts.
if exists("b:did_ftplugin")
unlet b:did_ftplugin
endif
if exists("b:current_syntax")
" echomsg 'SQLSetType - clearing syntax'
syntax clear
endif
if exists("b:did_indent")
" echomsg 'SQLSetType - clearing indent'
unlet b:did_indent
" Set these values to their defaults
setlocal indentkeys&
setlocal indentexpr&
endif
" Ensure the name is in the correct format
let new_sql_type = substitute(a:name,
\ '\s*\([^\.]\+\)\(\.\w\+\)\?', '\L\1', '')
" Do not specify a buffer local variable if it is
" the default value
if new_sql_type == 'sql'
let new_sql_type = 'sqloracle'
endif
let b:sql_type_override = new_sql_type
" Vim will automatically source the correct files if we
" change the filetype. You cannot do this with setfiletype
" since that command will only execute if a filetype has
" not already been set. In this case we want to override
" the existing filetype.
let &filetype = 'sql'
endfunction
command! -nargs=* -complete=custom,SQL_GetList SQLSetType :call SQL_SetType(<q-args>)
endif
if exists("b:sql_type_override")
" echo 'sourcing buffer ftplugin/'.b:sql_type_override.'.vim'
if globpath(&runtimepath, 'ftplugin/'.b:sql_type_override.'.vim') != ''
exec 'runtime ftplugin/'.b:sql_type_override.'.vim'
" else
" echomsg 'ftplugin/'.b:sql_type_override.' not exist, using default'
endif
elseif exists("g:sql_type_default")
" echo 'sourcing global ftplugin/'.g:sql_type_default.'.vim'
if globpath(&runtimepath, 'ftplugin/'.g:sql_type_default.'.vim') != ''
exec 'runtime ftplugin/'.g:sql_type_default.'.vim'
" else
" echomsg 'ftplugin/'.g:sql_type_default.'.vim not exist, using default'
endif
endif
" If the above runtime command succeeded, do not load the default settings
if exists("b:did_ftplugin")
finish
endif
let b:undo_ftplugin = "setl comments<"
" Don't load another plugin for this buffer
let b:did_ftplugin = 1
let b:did_ftplugin = 1
let b:current_ftplugin = 'sql'
" Win32 can filter files in the browse dialog
if has("gui_win32") && !exists("b:browsefilter")
let b:browsefilter = "SQL Files (*.sql)\t*.sql\n" .
\ "All Files (*.*)\t*.*\n"
endif
" Some standard expressions for use with the matchit strings
let s:notend = '\%(\<end\s\+\)\@<!'
@@ -112,69 +269,78 @@ endif
" [d, [D, [_CTRL_D and so on features
" Match these values ignoring case
" ie DECLARE varname INTEGER
let &l:define = '\c\(DECLARE\|IN\|OUT\|INOUT\)\s*'
let &l:define = '\c\<\(VARIABLE\|DECLARE\|IN\|OUT\|INOUT\)\>'
" Mappings to move to the next BEGIN ... END block
" \W - no characters or digits
nmap <buffer> <silent> ]] :call search('\c^\s*begin\>', 'W' )<CR>
nmap <buffer> <silent> [[ :call search('\c^\s*begin\>', 'bW' )<CR>
nmap <buffer> <silent> ][ :call search('\c^\s*end\W*$', 'W' )<CR>
nmap <buffer> <silent> [] :call search('\c^\s*end\W*$', 'bW' )<CR>
vmap <buffer> <silent> ]] /\c^\s*begin\><CR>
vmap <buffer> <silent> [[ ?\c^\s*begin<CR>
vmap <buffer> <silent> ][ /\c^\s*end\W*$<CR>
vmap <buffer> <silent> [] ?\c^\s*end\W*$<CR>
nmap <buffer> <silent> ]] :call search('\\c^\\s*begin\\>', 'W' )<CR>
nmap <buffer> <silent> [[ :call search('\\c^\\s*begin\\>', 'bW' )<CR>
nmap <buffer> <silent> ][ :call search('\\c^\\s*end\\W*$', 'W' )<CR>
nmap <buffer> <silent> [] :call search('\\c^\\s*end\\W*$', 'bW' )<CR>
vmap <buffer> <silent> ]] /\\c^\\s*begin\\><CR>
vmap <buffer> <silent> [[ ?\\c^\\s*begin\\><CR>
vmap <buffer> <silent> ][ /\\c^\\s*end\\W*$<CR>
vmap <buffer> <silent> [] ?\\c^\\s*end\\W*$<CR>
" By default only look for CREATE statements, but allow
" the user to override
if !exists('g:ftplugin_sql_statements')
let g:ftplugin_sql_statements = 'create'
endif
" Predefined SQL objects what are used by the below mappings using
" the ]} style maps.
" This global variable allows the users to override it's value
" from within their vimrc.
" Note, you cannot use \?, since these patterns can be used to search
" backwards, you must use \{,1}
if !exists('g:ftplugin_sql_objects')
let g:ftplugin_sql_objects = 'function,procedure,event,' .
\ '\(existing\\|global\s\+temporary\s\+\)\?table,trigger' .
\ '\\(existing\\\\|global\\s\\+temporary\\s\\+\\)\\\{,1}' .
\ 'table,trigger' .
\ ',schema,service,publication,database,datatype,domain' .
\ ',index,subscription,synchronization,view,variable'
endif
" Replace all ,'s with bars, except ones with numbers after them.
" This will most likely be a \{,1} string.
let s:ftplugin_sql_objects =
\ '\c^\s*' .
\ '\(create\s\+\(or\s\+replace\s\+\)\?\)\?' .
\ '\<\(' .
\ substitute(g:ftplugin_sql_objects, ',', '\\\\|', 'g') .
\ '\)\>'
\ '\\c^\\s*' .
\ '\\(\\(' .
\ substitute(g:ftplugin_sql_statements, ',\d\@!', '\\\\\\|', 'g') .
\ '\\)\\s\\+\\(or\\s\\+replace\\\s\+\\)\\{,1}\\)\\{,1}' .
\ '\\<\\(' .
\ substitute(g:ftplugin_sql_objects, ',\d\@!', '\\\\\\|', 'g') .
\ '\\)\\>'
" Mappings to move to the next CREATE ... block
" map <buffer> <silent> ]} :call search(g:ftplugin_sql_objects, 'W' )<CR>
" nmap <buffer> <silent> [{ :call search('\c^\s*\(create\s\+\(or\s\+replace\s\+\)\?\)\?\<\(function\\|procedure\\|event\\|table\\|trigger\\|schema\)\>', 'bW' )<CR>
" exec 'nmap <buffer> <silent> ]} /'.s:ftplugin_sql_objects.'<CR>'
exec "nmap <buffer> <silent> ]} :call search('".s:ftplugin_sql_objects."', 'W')<CR>"
exec "nmap <buffer> <silent> [{ :call search('".s:ftplugin_sql_objects."', 'bW')<CR>"
" Could not figure out how to use a :call search() string in visual mode
" without it ending visual mode
" Unfortunately, this will add a entry to the search history
exec 'vmap <buffer> <silent> ]} /'.s:ftplugin_sql_objects.'<CR>'
exec 'vmap <buffer> <silent> [{ ?'.s:ftplugin_sql_objects.'<CR>'
" vmap <buffer> <silent> ]} /\c^\s*\(create\s\+\(or\s\+replace\s\+\)\?\)\?\<\(function\\|procedure\\|event\\|table\\|trigger\\|schema\)\><CR>
" vmap <buffer> <silent> [{ ?\c^\s*\(create\s\+\(or\s\+replace\s\+\)\?\)\?\<\(function\\|procedure\\|event\\|table\\|trigger\\|schema\)\><CR>
" Mappings to move to the next COMMENT
"
" Had to double the \ for the \| separator since this has a special
" meaning on maps
let b:comment_leader = '\(--\\|\/\/\\|\*\\|\/\*\\|\*\/\)'
let b:comment_leader = '\\(--\\\|\\/\\/\\\|\\*\\\|\\/\\*\\\|\\*\\/\\)'
" Find the start of the next comment
let b:comment_start = '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ '\(\s*'.b:comment_leader.'\)'
let b:comment_start = '^\\(\\s*'.b:comment_leader.'.*\\n\\)\\@<!'.
\ '\\(\\s*'.b:comment_leader.'\\)'
" Find the end of the previous comment
let b:comment_end = '\(^\s*'.b:comment_leader.'.*\n\)'.
\ '\(^\s*'.b:comment_leader.'\)\@!'
let b:comment_end = '\\(^\\s*'.b:comment_leader.'.*\\n\\)'.
\ '\\(^\\s*'.b:comment_leader.'\\)\\@!'
" Skip over the comment
let b:comment_jump_over = "call search('".
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ '^\\(\\s*'.b:comment_leader.'.*\\n\\)\\@<!'.
\ "', 'W')"
let b:comment_skip_back = "call search('".
\ '^\(\s*'.b:comment_leader.'.*\n\)\@<!'.
\ '^\\(\\s*'.b:comment_leader.'.*\\n\\)\\@<!'.
\ "', 'bW')"
" Move to the start and end of comments
exec 'nnoremap <silent><buffer> ]" /'.b:comment_start.'<CR>'
@@ -187,11 +353,29 @@ exec 'vnoremap <silent><buffer> [" /'.b:comment_end.'<CR>'
" *
" */
" or
" //
" or
" --
" or
" //
setlocal comments=s1:/*,mb:*,ex:*/,:--,://
" Set completion with CTRL-X CTRL-O to autoloaded function.
if exists('&omnifunc')
" This is used by the sqlcomplete.vim plugin
" Source it for it's global functions
runtime autoload/syntaxcomplete.vim
setlocal omnifunc=sqlcomplete#Complete
" Prevent the intellisense plugin from loading
let b:sql_vis = 1
imap <buffer> <c-space>t <C-O>:let b:sql_compl_type='table'<CR><C-X><C-O>
imap <buffer> <c-space>p <C-O>:let b:sql_compl_type='procedure'<CR><C-X><C-O>
imap <buffer> <c-space>v <C-O>:let b:sql_compl_type='view'<CR><C-X><C-O>
imap <buffer> <c-space>c <C-O>:let b:sql_compl_type='column'<CR><C-X><C-O>
imap <buffer> <c-space>f <C-O>:let b:sql_compl_type='function'<CR><C-X><C-O>
imap <buffer> <c-space>o <C-O>:let b:sql_compl_type='option'<CR><C-X><C-O>
imap <buffer> <c-right> <C-O>:let b:sql_compl_type='column'<CR><C-X><C-O>
endif
let &cpo = s:save_cpo
" vim:sw=4:ff=unix:

View File

@@ -1,8 +1,8 @@
" Vim filetype plugin file
" Language: VHDL
" Maintainer: R.Shankar (shankar at txc.stpn.soft.net)
" Last Change: Tue Oct 8
" VHDL filetype plugin
" Language: VHDL
" Maintainer: R.Shankar <shankar.r?freescale.com>
" Modified By: Gerald Lai <laigera+vim?gmail.com>
" Last Change: 2006 Feb 16
" Only do this when not done yet for this buffer
if exists("b:did_ftplugin")
@@ -20,7 +20,7 @@ let b:did_ftplugin = 1
"setlocal comments=sO:*\ -,mO:*\ \ ,exO:*/,s1:/*,mb:*,ex:*/,://
" Format comments to be up to 78 characters long
setlocal tw=75
"setlocal tw=75
set cpo-=C
@@ -34,8 +34,51 @@ set cpo-=C
if ! exists("b:match_words") && exists("loaded_matchit")
let b:match_ignorecase=1
let s:notend = '\%(\<end\s\+\)\@<!'
let b:match_words=
\ s:notend . '\<if\>:\<elsif\>:\<else\>:\<end\>\s\+\<if\>,' .
\ s:notend . '\<case\>:\<when\>:\<end\>\s\+\<case\>,' .
\ s:notend . '\<process\>:\<end\>\s\+\<process\>'
let b:match_words =
\ s:notend.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
\ s:notend.'\<case\>:\<when\>:\<end\s\+case\>,'.
\ s:notend.'\<loop\>:\<end\s\+loop\>,'.
\ s:notend.'\<for\>:\<end\s\+for\>,'.
\ s:notend.'\<generate\>:\<end\s\+generate\>,'.
\ s:notend.'\<record\>:\<end\s\+record\>,'.
\ s:notend.'\<units\>:\<end\s\+units\>,'.
\ s:notend.'\<process\>:\<end\s\+process\>,'.
\ s:notend.'\<block\>:\<end\s\+block\>,'.
\ s:notend.'\<function\>:\<end\s\+function\>,'.
\ s:notend.'\<entity\>:\<end\s\+entity\>,'.
\ s:notend.'\<component\>:\<end\s\+component\>,'.
\ s:notend.'\<architecture\>:\<end\s\+architecture\>,'.
\ s:notend.'\<package\>:\<end\s\+package\>,'.
\ s:notend.'\<procedure\>:\<end\s\+procedure\>,'.
\ s:notend.'\<configuration\>:\<end\s\+configuration\>'
endif
" count repeat
function! <SID>CountWrapper(cmd)
let i = v:count1
if a:cmd[0] == ":"
while i > 0
execute a:cmd
let i = i - 1
endwhile
else
execute "normal! gv\<Esc>"
execute "normal ".i.a:cmd
let curcol = col(".")
let curline = line(".")
normal! gv
call cursor(curline, curcol)
endif
endfunction
" explore motion
" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>

View File

@@ -2,8 +2,9 @@
" Language: PHP
" Author: John Wellesz <John.wellesz (AT) teaser (DOT) fr>
" URL: http://www.2072productions.com/vim/indent/php.vim
" Last Change: 2005 Nobember 21st
" Version: 1.20
" Last Change: 2006 January 15th
" Newsletter: http://www.2072productions.com/?to=php-indent-for-vim-newsletter.php
" Version: 1.23
"
" The change log and all the comments have been removed from this file.
"
@@ -11,14 +12,14 @@
" 2072productions.com at the URI provided above.
"
" If you find a bug, please e-mail me at John.wellesz (AT) teaser (DOT) fr
" with an example of code that break the algorithm.
" with an example of code that breaks the algorithm.
"
"
" Thanks a lot for using this script.
"
"
" NOTE: This script must be used with PHP syntax ON and with the php syntax
" script by Lutz Eymers (http://www.isp.de/data/php.vim ) that's the script bundled with Gvim.
" script by Lutz Eymers ( http://www.isp.de/data/php.vim ) that's the script bundled with Vim.
"
"
" In the case you have syntax errors in your script such as end of HereDoc
@@ -69,6 +70,10 @@
if exists("b:did_indent")
finish
endif
@@ -127,7 +132,7 @@ if &fileformat == "unix" && exists("PHP_removeCRwhenUnix") && PHP_removeCRwhenUn
endif
if exists("*GetPhpIndent")
finish " XXX
finish " XXX
endif
let s:endline= '\s*\%(//.*\|#.*\|/\*.*\*/\s*\)\=$'
@@ -136,7 +141,13 @@ let s:PHP_startindenttag = '<?\%(.*?>\)\@!\|<script[^>]*>\%(.*<\/script>\)\@!'
function! GetLastRealCodeLNum(startline) " {{{
let lnum = a:startline
if b:GetLastRealCodeLNum_ADD && b:GetLastRealCodeLNum_ADD == lnum + 1
let lnum = b:GetLastRealCodeLNum_ADD
endif
let old_lnum = lnum
while lnum > 1
@@ -288,7 +299,7 @@ function! IslinePHP (lnum, tofind) " {{{
endfunction " }}}
let s:notPhpHereDoc = '\%(break\|return\|continue\|exit\);'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|[|&]\)'
let s:blockstart = '\%(\%(\%(}\s*\)\=else\%(\s\+\)\=\)\=if\>\|else\>\|while\>\|switch\>\|for\%(each\)\=\>\|declare\>\|class\>\|interface\>\|abstract\>\|try\>\|catch\>\|[|&]\)'
let s:autorestoptions = 0
if ! s:autorestoptions
@@ -316,6 +327,8 @@ endfunc
function! GetPhpIndent()
let b:GetLastRealCodeLNum_ADD = 0
let UserIsEditing=0
if b:PHP_oldchangetick != b:changedtick
let b:PHP_oldchangetick = b:changedtick
@@ -361,7 +374,10 @@ function! GetPhpIndent()
if !b:InPHPcode_checked " {{{ One time check
let b:InPHPcode_checked = 1
let synname = IslinePHP (prevnonblank(v:lnum), "")
let synname = ""
if cline !~ '<?.*?>'
let synname = IslinePHP (prevnonblank(v:lnum), "")
endif
if synname!=""
if synname != "phpHereDoc"
@@ -425,6 +441,7 @@ function! GetPhpIndent()
elseif cline =~? '<script\>'
let b:InPHPcode_and_script = 1
let b:GetLastRealCodeLNum_ADD = v:lnum
endif
endif
endif
@@ -453,11 +470,11 @@ function! GetPhpIndent()
endif
endif " }}}
if !b:InPHPcode && !b:InPHPcode_and_script
return -1
endif
" Indent successive // or # comment the same way the first is {{{
if cline =~ '^\s*\%(//\|#\|/\*.*\*/\s*$\)'
if b:PHP_LastIndentedWasComment == 1
@@ -482,9 +499,11 @@ function! GetPhpIndent()
endif
endif
if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*'
if !b:PHP_InsideMultilineComment && cline =~ '^\s*/\*' && cline !~ '\*/\s*$'
if getline(v:lnum + 1) !~ '^\s*\*'
return -1
endif
let b:PHP_InsideMultilineComment = 1
return -1
endif " }}}
@@ -504,6 +523,7 @@ function! GetPhpIndent()
let s:level = 0
let lnum = GetLastRealCodeLNum(v:lnum - 1)
let last_line = getline(lnum)
let ind = indent(lnum)
let endline= s:endline

39
runtime/indent/sql.vim Normal file
View File

@@ -0,0 +1,39 @@
" Vim indent file loader
" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Thu Sep 15 2005 10:27:51 AM
" Version: 1.0
" Download: http://vim.sourceforge.net/script.php?script_id=495
" Description: Checks for a:
" buffer local variable,
" global variable,
" If the above exist, it will source the type specified.
" If none exist, it will source the default sqlanywhere.vim file.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
" Default to the standard Vim distribution file
let filename = 'sqlanywhere'
" Check for overrides. Buffer variables have the highest priority.
if exists("b:sql_type_override")
" Check the runtimepath to see if the file exists
if globpath(&runtimepath, 'indent/'.b:sql_type_override.'.vim') != ''
let filename = b:sql_type_override
endif
elseif exists("g:sql_type_default")
if globpath(&runtimepath, 'indent/'.g:sql_type_default.'.vim') != ''
let filename = g:sql_type_default
endif
endif
" Source the appropriate file
exec 'runtime indent/'.filename.'.vim'
" vim:sw=4:ff=unix:

View File

@@ -0,0 +1,384 @@
" Vim indent file
" Language: SQL
" Maintainer: David Fishburn <fishburn at ianywhere dot com>
" Last Change: Wed Sep 14 2005 10:21:15 PM
" Version: 1.4
" Download: http://vim.sourceforge.net/script.php?script_id=495
" Notes:
" Indenting keywords are based on Oracle and Sybase Adaptive Server
" Anywhere (ASA). Test indenting was done with ASA stored procedures and
" fuctions and Oracle packages which contain stored procedures and
" functions.
" This has not been tested against Microsoft SQL Server or
" Sybase Adaptive Server Enterprise (ASE) which use the Transact-SQL
" syntax. That syntax does not have end tags for IF's, which makes
" indenting more difficult.
"
" Known Issues:
" The Oracle MERGE statement does not have an end tag associated with
" it, this can leave the indent hanging to the right one too many.
" Only load this indent file when no other was loaded.
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
let b:current_indent = "sqlanywhere"
setlocal indentkeys-=0{
setlocal indentkeys-=0}
setlocal indentkeys-=:
setlocal indentkeys-=0#
setlocal indentkeys-=e
" This indicates formatting should take place when one of these
" expressions is used. These expressions would normally be something
" you would type at the BEGINNING of a line
" SQL is generally case insensitive, so this files assumes that
" These keywords are something that would trigger an indent LEFT, not
" an indent right, since the SQLBlockStart is used for those keywords
setlocal indentkeys+==~end,=~else,=~elseif,=~elsif,0=~when,0=)
" GetSQLIndent is executed whenever one of the expressions
" in the indentkeys is typed
setlocal indentexpr=GetSQLIndent()
" Only define the functions once.
if exists("*GetSQLIndent")
finish
endif
" List of all the statements that start a new block.
" These are typically words that start a line.
" IS is excluded, since it is difficult to determine when the
" ending block is (especially for procedures/functions).
let s:SQLBlockStart = '^\s*\%('.
\ 'if\|else\|elseif\|elsif\|'.
\ 'while\|loop\|do\|'.
\ 'begin\|'.
\ 'case\|when\|merge\|exception'.
\ '\)\>'
let s:SQLBlockEnd = '^\s*\(end\)\>'
" The indent level is also based on unmatched paranethesis
" If a line has an extra "(" increase the indent
" If a line has an extra ")" decrease the indent
function s:CountUnbalancedParan( line, paran_to_check )
let l = a:line
let lp = substitute(l, '[^(]', '', 'g')
let l = a:line
let rp = substitute(l, '[^)]', '', 'g')
if a:paran_to_check =~ ')'
" echom 'CountUnbalancedParan ) returning: ' .
" \ (strlen(rp) - strlen(lp))
return (strlen(rp) - strlen(lp))
elseif a:paran_to_check =~ '('
" echom 'CountUnbalancedParan ( returning: ' .
" \ (strlen(lp) - strlen(rp))
return (strlen(lp) - strlen(rp))
else
" echom 'CountUnbalancedParan unknown paran to check: ' .
" \ a:paran_to_check
return 0
endif
endfunction
" Unindent commands based on previous indent level
function s:CheckToIgnoreRightParan( prev_lnum, num_levels )
let lnum = a:prev_lnum
let line = getline(lnum)
let ends = 0
let num_right_paran = a:num_levels
let ignore_paran = 0
let vircol = 1
while num_right_paran > 0
silent! exec 'norm! '.lnum."G\<bar>".vircol."\<bar>"
let right_paran = search( ')', 'W' )
if right_paran != lnum
" This should not happen since there should be at least
" num_right_paran matches for this line
break
endif
let vircol = virtcol(".")
" if getline(".") =~ '^)'
let matching_paran = searchpair('(', '', ')', 'bW',
\ 'IsColComment(line("."), col("."))')
if matching_paran < 1
" No match found
" echom 'CTIRP - no match found, ignoring'
break
endif
if matching_paran == lnum
" This was not an unmatched parantenses, start the search again
" again after this column
" echom 'CTIRP - same line match, ignoring'
continue
endif
" echom 'CTIRP - match: ' . line(".") . ' ' . getline(".")
if getline(matching_paran) =~? '\(if\|while\)\>'
" echom 'CTIRP - if/while ignored: ' . line(".") . ' ' . getline(".")
let ignore_paran = ignore_paran + 1
endif
" One match found, decrease and check for further matches
let num_right_paran = num_right_paran - 1
endwhile
" Fallback - just move back one
" return a:prev_indent - &sw
return ignore_paran
endfunction
" Based on the keyword provided, loop through previous non empty
" non comment lines to find the statement that initated the keyword.
" Return its indent level
" CASE ..
" WHEN ...
" Should return indent level of CASE
" EXCEPTION ..
" WHEN ...
" something;
" WHEN ...
" Should return indent level of exception.
function s:GetStmtStarterIndent( keyword, curr_lnum )
let lnum = a:curr_lnum
" Default - reduce indent by 1
let ind = indent(a:curr_lnum) - &sw
if a:keyword =~? 'end'
exec 'normal! ^'
let stmts = '^\s*\%('.
\ '\<begin\>\|' .
\ '\%(\%(\<end\s\+\)\@<!\<loop\>\)\|' .
\ '\%(\%(\<end\s\+\)\@<!\<case\>\)\|' .
\ '\%(\%(\<end\s\+\)\@<!\<for\>\)\|' .
\ '\%(\%(\<end\s\+\)\@<!\<if\>\)'.
\ '\)'
let matching_lnum = searchpair(stmts, '', '\<end\>\zs', 'bW',
\ 'IsColComment(line("."), col(".")) == 1')
exec 'normal! $'
if matching_lnum > 0 && matching_lnum < a:curr_lnum
let ind = indent(matching_lnum)
endif
elseif a:keyword =~? 'when'
exec 'normal! ^'
let matching_lnum = searchpair(
\ '\%(\<end\s\+\)\@<!\<case\>\|\<exception\>\|\<merge\>',
\ '',
\ '\%(\%(\<when\s\+others\>\)\|\%(\<end\s\+case\>\)\)',
\ 'bW',
\ 'IsColComment(line("."), col(".")) == 1')
exec 'normal! $'
if matching_lnum > 0 && matching_lnum < a:curr_lnum
let ind = indent(matching_lnum)
else
let ind = indent(a:curr_lnum)
endif
endif
return ind
endfunction
" Check if the line is a comment
function IsLineComment(lnum)
let rc = synIDattr(
\ synID(a:lnum,
\ match(getline(a:lnum), '\S')+1, 0)
\ , "name")
\ =~? "comment"
return rc
endfunction
" Check if the column is a comment
function IsColComment(lnum, cnum)
let rc = synIDattr(synID(a:lnum, a:cnum, 0), "name")
\ =~? "comment"
return rc
endfunction
" Check if the column is a comment
function ModuloIndent(ind)
let ind = a:ind
if ind > 0
let modulo = ind % &shiftwidth
if modulo > 0
let ind = ind - modulo
endif
endif
return ind
endfunction
" Find correct indent of a new line based upon the previous line
function GetSQLIndent()
let lnum = v:lnum
let ind = indent(lnum)
" If the current line is a comment, leave the indent as is
" Comment out this additional check since it affects the
" indenting of =, and will not reindent comments as it should
" if IsLineComment(lnum) == 1
" return ind
" endif
" while 1
" Get previous non-blank line
let prevlnum = prevnonblank(lnum - 1)
if prevlnum <= 0
return ind
endif
if IsLineComment(prevlnum) == 1
if getline(v:lnum) =~ '^\s*\*'
let ind = ModuloIndent(indent(prevlnum))
return ind + 1
endif
" If the previous line is a comment, then return -1
" to tell Vim to use the formatoptions setting to determine
" the indent to use
" But only if the next line is blank. This would be true if
" the user is typing, but it would not be true if the user
" is reindenting the file
if getline(v:lnum) =~ '^\s*$'
return -1
endif
endif
" let prevline = getline(prevlnum)
" if prevline !~ '^\s*$'
" " echom 'previous non blank - break: ' . prevline
" break
" endif
" endwhile
" echom 'PREVIOUS INDENT: ' . indent(prevlnum) . ' LINE: ' . getline(prevlnum)
" This is the line you just hit return on, it is not the current line
" which is new and empty
" Based on this line, we can determine how much to indent the new
" line
" Get default indent (from prev. line)
let ind = indent(prevlnum)
let prevline = getline(prevlnum)
" Now check what's on the previous line to determine if the indent
" should be changed, for example IF, BEGIN, should increase the indent
" where END IF, END, should decrease the indent.
if prevline =~? s:SQLBlockStart
" Move indent in
let ind = ind + &sw
" echom 'prevl - SQLBlockStart - indent ' . ind . ' line: ' . prevline
elseif prevline =~ '[()]'
if prevline =~ '('
let num_unmatched_left = s:CountUnbalancedParan( prevline, '(' )
else
let num_unmatched_left = 0
endif
if prevline =~ ')'
let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' )
else
let num_unmatched_right = 0
" let num_unmatched_right = s:CountUnbalancedParan( prevline, ')' )
endif
if num_unmatched_left > 0
" There is a open left paranethesis
" increase indent
let ind = ind + ( &sw * num_unmatched_left )
elseif num_unmatched_right > 0
" if it is an unbalanced paranethesis only unindent if
" it was part of a command (ie create table(..) )
" instead of part of an if (ie if (....) then) which should
" maintain the indent level
let ignore = s:CheckToIgnoreRightParan( prevlnum, num_unmatched_right )
" echom 'prevl - ) unbalanced - CTIRP - ignore: ' . ignore
if prevline =~ '^\s*)'
let ignore = ignore + 1
" echom 'prevl - begins ) unbalanced ignore: ' . ignore
endif
if (num_unmatched_right - ignore) > 0
let ind = ind - ( &sw * (num_unmatched_right - ignore) )
endif
endif
endif
" echom 'CURRENT INDENT: ' . ind . ' LINE: ' . getline(v:lnum)
" This is a new blank line since we just typed a carriage return
" Check current line; search for simplistic matching start-of-block
let line = getline(v:lnum)
if line =~? '^\s*els'
" Any line when you type else will automatically back up one
" ident level (ie else, elseif, elsif)
let ind = ind - &sw
" echom 'curr - else - indent ' . ind
elseif line =~? '^\s*end\>'
let ind = s:GetStmtStarterIndent('end', v:lnum)
" General case for end
" let ind = ind - &sw
" echom 'curr - end - indent ' . ind
elseif line =~? '^\s*when\>'
let ind = s:GetStmtStarterIndent('when', v:lnum)
" If the WHEN clause is used with a MERGE or EXCEPTION
" clause, do not change the indent level, since these
" statements do not have a corresponding END statement.
" if stmt_starter =~? 'case'
" let ind = ind - &sw
" endif
" elseif line =~ '^\s*)\s*;\?\s*$'
" elseif line =~ '^\s*)'
elseif line =~ '^\s*)'
let num_unmatched_right = s:CountUnbalancedParan( line, ')' )
let ignore = s:CheckToIgnoreRightParan( v:lnum, num_unmatched_right )
" If the line ends in a ), then reduce the indent
" This catches items like:
" CREATE TABLE T1(
" c1 int,
" c2 int
" );
" But we do not want to unindent a line like:
" IF ( c1 = 1
" AND c2 = 3 ) THEN
" let num_unmatched_right = s:CountUnbalancedParan( line, ')' )
" if num_unmatched_right > 0
" elseif strpart( line, strlen(line)-1, 1 ) =~ ')'
" let ind = ind - &sw
if line =~ '^\s*)'
" let ignore = ignore + 1
" echom 'curr - begins ) unbalanced ignore: ' . ignore
endif
if (num_unmatched_right - ignore) > 0
let ind = ind - ( &sw * (num_unmatched_right - ignore) )
endif
" endif
endif
" echom 'final - indent ' . ind
return ModuloIndent(ind)
endfunction
" vim:sw=4:ff=unix:

464
runtime/indent/vhdl.vim Normal file
View File

@@ -0,0 +1,464 @@
" VHDL indent ('93 syntax)
" Language: VHDL
" Maintainer: Gerald Lai <laigera+vim?gmail.com>
" Version: 1.34
" Last Change: 2006 Feb 11
" URL: http://www.vim.org/scripts/script.php?script_id=1450
" only load this indent file when no other was loaded
if exists("b:did_indent")
finish
endif
let b:did_indent = 1
" setup indent options for local VHDL buffer
setlocal indentexpr=GetVHDLindent()
setlocal indentkeys=!^F,o,O,e,0(,0)
setlocal indentkeys+==~if,=~then,=~elsif,=~else
setlocal indentkeys+==~begin,=~is,=~select,=~--
" count repeat
function! <SID>CountWrapper(cmd)
let i = v:count1
if a:cmd[0] == ":"
while i > 0
execute a:cmd
let i = i - 1
endwhile
else
execute "normal! gv\<Esc>"
execute "normal ".i.a:cmd
let curcol = col(".")
let curline = line(".")
normal! gv
call cursor(curline, curcol)
endif
endfunction
" explore motion
" keywords: "architecture", "block", "configuration", "component", "entity", "function", "package", "procedure", "process", "record", "units"
let b:vhdl_explore = '\%(architecture\|block\|configuration\|component\|entity\|function\|package\|procedure\|process\|record\|units\)'
noremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
noremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\%(\\<end\\s\\+\\)\\@<!\\<".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
noremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%^","bW")')<CR>
noremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper(':cal search("\\%(--.*\\)\\@<!\\<end\\s\\+".b:vhdl_explore."\\>\\c\\<Bar>\\%$","W")')<CR>
vnoremap <buffer><silent>[[ :<C-u>cal <SID>CountWrapper('[[')<CR>
vnoremap <buffer><silent>]] :<C-u>cal <SID>CountWrapper(']]')<CR>
vnoremap <buffer><silent>[] :<C-u>cal <SID>CountWrapper('[]')<CR>
vnoremap <buffer><silent>][ :<C-u>cal <SID>CountWrapper('][')<CR>
" constants
" not a comment
let s:NC = '\%(--.*\)\@<!'
" end of string
let s:ES = '\s*\%(--.*\)\=$'
" no "end" keyword in front
let s:NE = '\%(\<end\s\+\)\@<!'
" for matchit plugin
if exists("loaded_matchit")
let b:match_ignorecase = 1
let b:match_words =
\ s:NE.'\<if\>:\<elsif\>:\<else\>:\<end\s\+if\>,'.
\ s:NE.'\<case\>:\<when\>:\<end\s\+case\>,'.
\ s:NE.'\<loop\>:\<end\s\+loop\>,'.
\ s:NE.'\<for\>:\<end\s\+for\>,'.
\ s:NE.'\<generate\>:\<end\s\+generate\>,'.
\ s:NE.'\<record\>:\<end\s\+record\>,'.
\ s:NE.'\<units\>:\<end\s\+units\>,'.
\ s:NE.'\<process\>:\<end\s\+process\>,'.
\ s:NE.'\<block\>:\<end\s\+block\>,'.
\ s:NE.'\<function\>:\<end\s\+function\>,'.
\ s:NE.'\<entity\>:\<end\s\+entity\>,'.
\ s:NE.'\<component\>:\<end\s\+component\>,'.
\ s:NE.'\<architecture\>:\<end\s\+architecture\>,'.
\ s:NE.'\<package\>:\<end\s\+package\>,'.
\ s:NE.'\<procedure\>:\<end\s\+procedure\>,'.
\ s:NE.'\<configuration\>:\<end\s\+configuration\>'
endif
" only define indent function once
if exists("*GetVHDLindent")
finish
endif
function GetVHDLindent()
" store current line & string
let curn = v:lnum
let curs = getline(curn)
" find previous line that is not a comment
let prevn = prevnonblank(curn - 1)
let prevs = getline(prevn)
while prevn > 0 && prevs =~ '^\s*--'
let prevn = prevnonblank(prevn - 1)
let prevs = getline(prevn)
endwhile
" default indent starts as previous non-comment line's indent
let ind = prevn > 0 ? indent(prevn) : 0
" backup default
let ind2 = ind
" indent: special; kill string so it would not affect other filters
" keywords: "report" + string
" where: anywhere in current or previous line
let s0 = s:NC.'\<report\>\s*".*"'
if curs =~? s0
let curs = ""
endif
if prevs =~? s0
let prevs = ""
endif
" indent: previous line's comment position, otherwise follow next non-comment line if possible
" keyword: "--"
" where: start of current line
if curs =~ '^\s*--'
let pn = curn - 1
let ps = getline(pn)
if ps =~ '--'
return stridx(ps, '--')
else
" find nextnonblank line that is not a comment
let nn = nextnonblank(curn + 1)
let ns = getline(nn)
while nn > 0 && ns =~ '^\s*--'
let nn = nextnonblank(nn + 1)
let ns = getline(nn)
endwhile
let n = indent(nn)
return n != -1 ? n : ind
endif
endif
" ****************************************************************************************
" indent: align generic variables & port names
" keywords: "generic", "map", "port" + "(", provided current line is part of mapping
" where: anywhere in previous 2 lines
" find following previous non-comment line
let pn = prevnonblank(prevn - 1)
let ps = getline(pn)
while pn > 0 && ps =~ '^\s*--'
let pn = prevnonblank(pn - 1)
let ps = getline(pn)
endwhile
if (curs =~ '^\s*)' || curs =~? '^\s*\%(\<\%(generic\|map\|port\)\>.*\)\@<!\S\+\s*\%(=>\s*\S\+\|:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)\)') && (prevs =~? s:NC.'\<\%(generic\|map\|port\)\s*(\%(\s*\w\)\=' || (ps =~? s:NC.'\<\%(generic\|map\|port\)'.s:ES && prevs =~ '^\s*('))
" align closing ")" with opening "("
if curs =~ '^\s*)'
return stridx(prevs, '(')
endif
let m = matchend(prevs, '(\s*\ze\w')
if m != -1
return m
else
return stridx(prevs, '(') + &sw
endif
endif
" indent: align conditional/select statement
" keywords: variable + "<=" without ";" ending
" where: start of previous line
if prevs =~? '^\s*\S\+\s*<=[^;]*'.s:ES
return matchend(prevs, '<=\s*\ze.')
endif
" indent: backtrace previous non-comment lines for next smaller or equal size indent
" keywords: "end" + "record", "units"
" where: start of previous line
" keyword: ")"
" where: start of previous line
" keyword: without "<=" + ";" ending
" where: anywhere in previous line
" keyword: "=>" + ")" ending, provided current line does not begin with ")"
" where: anywhere in previous line
" _note_: indent allowed to leave this filter
let m = 0
if prevs =~? '^\s*end\s\+\%(record\|units\)\>'
let m = 3
elseif prevs =~ '^\s*)'
let m = 1
elseif prevs =~ s:NC.'\%(<=.*\)\@<!;'.s:ES || (curs !~ '^\s*)' && prevs =~ s:NC.'=>.*'.s:NC.')'.s:ES)
let m = 2
endif
if m > 0
let pn = prevnonblank(prevn - 1)
let ps = getline(pn)
while pn > 0
let t = indent(pn)
if ps !~ '^\s*--' && t < ind
" make sure one of these is true
" keywords: variable + "<=" without ";" ending
" where: start of previous non-comment line
" keywords: "generic", "map", "port"
" where: anywhere in previous non-comment line
" keyword: "("
" where: start of previous non-comment line
if m < 3 && ps !~? '^\s*\S\+\s*<=[^;]*'.s:ES
if ps =~? s:NC.'\<\%(generic\|map\|port\)\>' || ps =~ '^\s*('
let ind = t
endif
break
endif
let ind = t
if m > 1
" find following previous non-comment line
let ppn = prevnonblank(pn - 1)
let pps = getline(ppn)
while ppn > 0 && pps =~ '^\s*--'
let ppn = prevnonblank(ppn - 1)
let pps = getline(ppn)
endwhile
" indent: follow
" keyword: "select"
" where: end of following previous non-comment line
" keyword: "type"
" where: start of following previous non-comment line
if m == 2
let s1 = s:NC.'\<select'.s:ES
if ps !~? s1 && pps =~? s1
let ind = indent(ppn)
endif
elseif m == 3
let s1 = '^\s*type\>'
if ps !~? s1 && pps =~? s1
let ind = indent(ppn)
endif
endif
endif
break
endif
let pn = prevnonblank(pn - 1)
let ps = getline(pn)
endwhile
endif
" indent: follow indent of previous opening statement, otherwise -sw
" keyword: "begin"
" where: anywhere in current line
if curs =~? s:NC.'\<begin\>'
let ind = ind - &sw
" find previous opening statement of
" keywords: "architecture", "block", "entity", "function", "generate", "procedure", "process"
let s2 = s:NC.s:NE.'\<\%(architecture\|block\|entity\|function\|generate\|procedure\|process\)\>'
if curs !~? s2.'.*'.s:NC.'\<begin\>.*'.s:ES && prevs =~? s2
let ind = ind + &sw
endif
return ind
endif
" indent: +sw if previous line is previous opening statement
" keywords: "record", "units"
" where: anywhere in current line
if curs =~? s:NC.s:NE.'\<\%(record\|units\)\>'
" find previous opening statement of
" keyword: "type"
let s3 = s:NC.s:NE.'\<type\>'
if curs !~? s3.'.*'.s:NC.'\<\%(record\|units\)\>.*'.s:ES && prevs =~? s3
let ind = ind + &sw
endif
return ind
endif
" ****************************************************************************************
" indent: 0
" keywords: "architecture", "configuration", "entity", "library", "package"
" where: start of current line
if curs =~? '^\s*\%(architecture\|configuration\|entity\|library\|package\)\>'
return 0
endif
" indent: maintain indent of previous opening statement
" keyword: "is"
" where: start of current line
" find previous opening statement of
" keywords: "architecture", "block", "configuration", "entity", "function", "package", "procedure", "process", "type"
if curs =~? '^\s*\<is\>' && prevs =~? s:NC.s:NE.'\<\%(architecture\|block\|configuration\|entity\|function\|package\|procedure\|process\|type\)\>'
return ind2
endif
" indent: maintain indent of previous opening statement
" keyword: "then"
" where: start of current line
" find previous opening statement of
" keywords: "elsif", "if"
if curs =~? '^\s*\<then\>' && prevs =~? s:NC.'\%(\<elsif\>\|'.s:NE.'\<if\>\)'
return ind2
endif
" indent: maintain indent of previous opening statement
" keyword: "generate"
" where: start of current line
" find previous opening statement of
" keywords: "for", "if"
if curs =~? '^\s*\<generate\>' && prevs =~? s:NC.s:NE.'\%(\%(\<wait\s\+\)\@<!\<for\>\|\<if\>\)'
return ind2
endif
" indent: +sw
" keywords: "begin", "block", "loop", "process", "record", "units"
" removed: "case", "elsif", "if", "while"
" where: anywhere in previous line
if prevs =~? s:NC.'\%(\<begin\>\|'.s:NE.'\<\%(block\|loop\|process\|record\|units\)\>\)'
return ind + &sw
endif
" indent: +sw
" keywords: "architecture", "component", "configuration", "entity", "for", "package"
" removed: "when", "with"
" where: start of previous line
if prevs =~? '^\s*\%(architecture\|component\|configuration\|entity\|for\|package\)\>'
return ind + &sw
endif
" indent: +sw
" keyword: "generate", "is", "select", "=>"
" where: end of previous line
if prevs =~? s:NC.'\%(\%('.s:NE.'\<generate\|\<is\|\<select\)\|=>\)'.s:ES
return ind + &sw
endif
" indent: +sw
" keyword: "else"
" where: start of previous line
" keyword: "then"
" where: end of previous line
" _note_: indent allowed to leave this filter
if prevs =~? '^\s*else\>' || prevs =~? s:NC.'\<then'.s:ES
let ind = ind + &sw
endif
" ****************************************************************************************
" indent: -sw
" keywords: "when", provided previous line does not begin with "when"
" where: start of current line
let s4 = '^\s*when\>'
if curs =~? s4
if prevs !~? s4
return ind - &sw
else
return ind2
endif
endif
" indent: -sw
" keywords: "else", "elsif", provided previous line does not contain "then"
" where: start of current line
if curs =~? '^\s*\%(else\|elsif\)\>'
if prevs !~? s:NC.'\<then\>'
return ind - &sw
else
return ind2
endif
endif
" indent: -sw
" keywords: "end" + "if", provided previous line does not begin with "else", not contain "then"
" where: start of current line
if curs =~? '^\s*end\s\+if\>'
if prevs !~? '^\s*else\>' && prevs !~? s:NC.'\<then\>'
return ind - &sw
else
return ind2
endif
endif
" indent: -sw
" keywords: "end" + "function", "procedure", provided previous line does not contain "begin"
" where: start of current line
if curs =~? '^\s*end\s\+\%(function\|procedure\)\>'
if prevs !~? s:NC.'\<begin\>'
return ind - &sw
else
return ind2
endif
endif
" indent: -sw
" keywords: "end" + "block", "for", "generate", "loop", "process", "record", "units"
" where: start of current line
if curs =~? '^\s*end\s\+\%(block\|for\|generate\|loop\|process\|record\|units\)\>'
return ind - &sw
endif
" indent: backtrace previous non-comment lines
" keyword: "end" + "case", "component"
" where: start of current line
let m = 0
if curs =~? '^\s*end\s\+case\>'
let m = 1
elseif curs =~? '^\s*end\s\+component\>'
let m = 2
endif
if m > 0
" find following previous non-comment line
let pn = prevn
let ps = getline(pn)
while pn > 0
if ps !~ '^\s*--'
"indent: -2sw
"keywords: "end" + "case"
"where: start of previous non-comment line
"indent: -sw
"keywords: "when"
"where: start of previous non-comment line
"indent: follow
"keywords: "case"
"where: start of previous non-comment line
if m == 1
if ps =~? '^\s*end\s\+case\>'
return indent(pn) - 2 * &sw
elseif ps =~? '^\s*when\>'
return indent(pn) - &sw
elseif ps =~? '^\s*case\>'
return indent(pn)
endif
"indent: follow
"keyword: "component"
"where: anywhere in previous non-comment line
elseif m == 2
if ps =~? s:NC.s:NE.'\<component\>'
return indent(pn)
endif
endif
endif
let pn = prevnonblank(pn - 1)
let ps = getline(pn)
endwhile
return ind - &sw
endif
" indent: -sw
" keyword: ")"
" where: start of current line
if curs =~ '^\s*)'
return ind - &sw
endif
" indent: 0
" keywords: "end" + "architecture", "configuration", "entity", "package"
" where: start of current line
if curs =~? '^\s*end\s\+\%(architecture\|configuration\|entity\|package\)\>'
return 0
endif
" indent: -sw
" keywords: "end" + identifier
" where: start of current line
if curs =~? '^\s*end\s\+\w\+\>'
return ind - &sw
endif
" ****************************************************************************************
" indent: maintain indent of previous opening statement
" keywords: without "generic", "map", "port" + ":" but not ":=" + "in", "out", "inout", "buffer", "linkage", variable & ":="
" where: start of current line
if curs =~? '^\s*\%(\<\%(generic\|map\|port\)\>.*\)\@<!\S\+\s*:[^=]\@=\s*\%(\%(in\|out\|inout\|buffer\|linkage\)\>\|\w\+\s\+:=\)'
return ind2
endif
" return leftover filtered indent
return ind
endfunction

View File

@@ -0,0 +1,90 @@
" Vim Keymap file for ukrainian characters, layout 'jcuken', classical variant
" (compatible with XFree86 'uk' keymap)
" Derived from russian-jcuken.vim by Artem Chuprina <ran@ran.pp.ru>
" Useful mainly with utf-8 but may work with other encodings
" Maintainer: Anatoli Sakhnik <sakhnik@gmail.com>
" Last Changed: 2006 Mar 15
" All characters are given literally, conversion to another encoding (e.g.,
" UTF-8) should work.
scriptencoding utf-8
let b:keymap_name = "uk"
loadkeymap
~ ~
` '
F А CYRILLIC CAPITAL LETTER A
< Б CYRILLIC CAPITAL LETTER BE
D В CYRILLIC CAPITAL LETTER VE
U Г CYRILLIC CAPITAL LETTER GHE
L Д CYRILLIC CAPITAL LETTER DE
T Е CYRILLIC CAPITAL LETTER IE
: Ж CYRILLIC CAPITAL LETTER ZHE
P З CYRILLIC CAPITAL LETTER ZE
B И CYRILLIC CAPITAL LETTER I
Q Й CYRILLIC CAPITAL LETTER SHORT I
R К CYRILLIC CAPITAL LETTER KA
K Л CYRILLIC CAPITAL LETTER EL
V М CYRILLIC CAPITAL LETTER EM
Y Н CYRILLIC CAPITAL LETTER EN
J О CYRILLIC CAPITAL LETTER O
G П CYRILLIC CAPITAL LETTER PE
H Р CYRILLIC CAPITAL LETTER ER
C С CYRILLIC CAPITAL LETTER ES
N Т CYRILLIC CAPITAL LETTER TE
E У CYRILLIC CAPITAL LETTER U
A Ф CYRILLIC CAPITAL LETTER EF
{ Х CYRILLIC CAPITAL LETTER HA
W Ц CYRILLIC CAPITAL LETTER TSE
X Ч CYRILLIC CAPITAL LETTER CHE
I Ш CYRILLIC CAPITAL LETTER SHA
O Щ CYRILLIC CAPITAL LETTER SHCHA
} Ї CYRILLIC CAPITAL LETTER YI
S І CYRILLIC CAPITAL LETTER BYELORUSSION-UKRAINIAN I
M Ь CYRILLIC CAPITAL LETTER SOFT SIGN
\" Є CYRILLIC CAPITAL LETTER UKRAINIAN IE
> Ю CYRILLIC CAPITAL LETTER YU
Z Я CYRILLIC CAPITAL LETTER YA
| Ґ CYRILLIC CAPITAL LETTER GHE WITH UPTURN
f а CYRILLIC SMALL LETTER A
, б CYRILLIC SMALL LETTER BE
d в CYRILLIC SMALL LETTER VE
u г CYRILLIC SMALL LETTER GHE
l д CYRILLIC SMALL LETTER DE
t е CYRILLIC SMALL LETTER IE
; ж CYRILLIC SMALL LETTER ZHE
p з CYRILLIC SMALL LETTER ZE
b и CYRILLIC SMALL LETTER I
q й CYRILLIC SMALL LETTER SHORT I
r к CYRILLIC SMALL LETTER KA
k л CYRILLIC SMALL LETTER EL
v м CYRILLIC SMALL LETTER EM
y н CYRILLIC SMALL LETTER EN
j о CYRILLIC SMALL LETTER O
g п CYRILLIC SMALL LETTER PE
h р CYRILLIC SMALL LETTER ER
c с CYRILLIC SMALL LETTER ES
n т CYRILLIC SMALL LETTER TE
e у CYRILLIC SMALL LETTER U
a ф CYRILLIC SMALL LETTER EF
[ х CYRILLIC SMALL LETTER HA
w ц CYRILLIC SMALL LETTER TSE
x ч CYRILLIC SMALL LETTER CHE
i ш CYRILLIC SMALL LETTER SHA
o щ CYRILLIC SMALL LETTER SHCHA
] ї CYRILLIC SMALL LETTER YI
s і CYRILLIC SMALL LETTER BYELORUSSION-UKRAINIAN I
m ь CYRILLIC SMALL LETTER SOFT SIGN
' є CYRILLIC SMALL LETTER UKRAINIAN IE
. ю CYRILLIC SMALL LETTER YU
z я CYRILLIC SMALL LETTER YA
\\ ґ CYRILLIC SMALL LETTER GHE WITH UPTURN
@ "
# '
$ *
% :
^ ,
& .
* ;

View File

@@ -88,6 +88,23 @@ menutrans &Jump\ to\ this\ tag<Tab>g^] &Sko
menutrans Jump\ &back<Tab>^T Sko<EFBFBD>it\ &zp<EFBFBD>t<Tab>^T
menutrans Build\ &Tags\ File &Vytvo<EFBFBD>it\ soubor\ tag<EFBFBD>
menutrans &Spelling &Kontrola\ pravopisu
menutrans &Spell\ Check\ On Kontrola\ pravopisu\ &zapnuta
menutrans Spell\ Check\ &Off Kontrola\ pravopisu\ &vypnuta
menutrans To\ Next\ error<Tab>]s &Dal<EFBFBD><EFBFBD>\ chyba<Tab>]s
menutrans To\ Previous\ error<Tab>[s &P<EFBFBD>edchoz<EFBFBD>\ chyba<Tab>[s
menutrans Suggest\ Corrections<Tab>z? &N<EFBFBD>vrh\ oprav<Tab>z?
menutrans Repeat\ correction<Tab>:spellrepall Zopakovat\ &opravu<Tab>:spellrepall
menutrans Set\ language\ to\ "en" Nastav\ jazyk\ na\ "en"
menutrans Set\ language\ to\ "en_au" Nastav\ jazyk\ na\ "en_au"
menutrans Set\ language\ to\ "en_ca" Nastav\ jazyk\ na\ "en_ca"
menutrans Set\ language\ to\ "en_gb" Nastav\ jazyk\ na\ "en_gb"
menutrans Set\ language\ to\ "en_nz" Nastav\ jazyk\ na\ "en_nz"
menutrans Set\ language\ to\ "en_us" Nastav\ jazyk\ na\ "en_us"
menutrans Set\ language\ to\ "cz" Nastav\ jazyk\ na\ "cz"
menutrans Set\ language\ to\ "cs_cz" Nastav\ jazyk\ na\ "cs_cz"
menutrans &Find\ More\ Languages Nal<EFBFBD>zt\ dal<EFBFBD><EFBFBD>\ &jazyky
menutrans &Folding &Foldy
menutrans &Enable/Disable\ folds<Tab>zi &Ano/Ne<Tab>zi
menutrans &View\ Cursor\ Line<Tab>zv &Zobrazit\ <20><>dek\ kurzoru<Tab>zv
@@ -119,6 +136,7 @@ menutrans &Previous\ Error<Tab>:cp &P
menutrans &Older\ List<Tab>:cold Sta&r<EFBFBD><EFBFBD>\ seznam<Tab>:cold
menutrans N&ewer\ List<Tab>:cnew N&ov<EFBFBD>j<EFBFBD><EFBFBD>\ seznam<Tab>:cnew
menutrans Error\ &Window Chybov<EFBFBD>\ o&kno
menutrans SeT\ Compiler Nas&taven<EFBFBD>\ kompil<EFBFBD>toru
menutrans &Update<Tab>:cwin O&bnovit<Tab>:cwin
menutrans &Open<Tab>:copen &Otev<EFBFBD><EFBFBD>t<Tab>:copen
menutrans &Close<Tab>:cclose &Zav<EFBFBD><EFBFBD>t<Tab>:cclose

Some files were not shown because too many files have changed in this diff Show More