mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-19 22:24:57 +02:00
Compare commits
2447 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0a4683d908 | ||
|
|
4c280b0193 | ||
|
|
e88a3deafd | ||
|
|
bd172b3300 | ||
|
|
95c7a13cb5 | ||
|
|
b1ddf03385 | ||
|
|
a83c326736 | ||
|
|
b1acb56247 | ||
|
|
caa4731a13 | ||
|
|
5b0ece7a91 | ||
|
|
c8d64e0a06 | ||
|
|
1a3dea0de6 | ||
|
|
17b642280e | ||
|
|
1c1717b78b | ||
|
|
4bbbdf8108 | ||
|
|
04a193309d | ||
|
|
f106ffa176 | ||
|
|
8d5d099542 | ||
|
|
4849992ca9 | ||
|
|
623105650e | ||
|
|
5e2c01daa6 | ||
|
|
58bf3a4d30 | ||
|
|
2d434c38b9 | ||
|
|
246f5cd8cf | ||
|
|
5a174d21f1 | ||
|
|
e632c653f6 | ||
|
|
174d17b088 | ||
|
|
3a35c931e4 | ||
|
|
b768b26c85 | ||
|
|
123ce6ebaf | ||
|
|
276c8db512 | ||
|
|
f898b8d181 | ||
|
|
e9f9e531e4 | ||
|
|
a7d813cb86 | ||
|
|
75b6eedb12 | ||
|
|
ec6860aa90 | ||
|
|
5cf661c6ae | ||
|
|
8c62caae7c | ||
|
|
cc6fe21af6 | ||
|
|
1902151efa | ||
|
|
b7af1e6289 | ||
|
|
0c77b320db | ||
|
|
ee41adc4e9 | ||
|
|
93462d7505 | ||
|
|
2f5946640e | ||
|
|
7cdb7dc308 | ||
|
|
c0038d0373 | ||
|
|
2820decb5e | ||
|
|
c64f368e6a | ||
|
|
b7c8e84f5e | ||
|
|
5acf6c9158 | ||
|
|
a8197b0c84 | ||
|
|
2e03062c24 | ||
|
|
7fb60a185b | ||
|
|
0327ea972b | ||
|
|
561cc77ecc | ||
|
|
a1ab4acd14 | ||
|
|
d4939803da | ||
|
|
730ce3aca9 | ||
|
|
1893dc6afd | ||
|
|
6ec39314ee | ||
|
|
c87528939b | ||
|
|
e56646105d | ||
|
|
b8a40d93f7 | ||
|
|
4bfc025248 | ||
|
|
36f6027b0e | ||
|
|
e032377e68 | ||
|
|
929eee4a12 | ||
|
|
61ce50264a | ||
|
|
48927b1207 | ||
|
|
0820893dc6 | ||
|
|
dd6079cfa6 | ||
|
|
3d7d75bae4 | ||
|
|
6da4d0ce5e | ||
|
|
4994d70b1a | ||
|
|
c873081dc3 | ||
|
|
070237f77f | ||
|
|
eb01b25f35 | ||
|
|
c0c9cfaf86 | ||
|
|
304f860eb2 | ||
|
|
2f18b25593 | ||
|
|
14c8b6a248 | ||
|
|
adaa683e58 | ||
|
|
9b71215cde | ||
|
|
8be572f976 | ||
|
|
4f43bcffb9 | ||
|
|
29e4dc5fb5 | ||
|
|
0dc95cb13c | ||
|
|
5ee0a93675 | ||
|
|
767b3c4a39 | ||
|
|
bb948a463c | ||
|
|
e4e9a03d0a | ||
|
|
50ba386f59 | ||
|
|
79d0565c2d | ||
|
|
bcc9b0a7b1 | ||
|
|
2c8f4940b9 | ||
|
|
41876cf8fd | ||
|
|
f6fd0b52f0 | ||
|
|
843faa7cc6 | ||
|
|
a8af2c3242 | ||
|
|
e5bfad974e | ||
|
|
59d87e0c94 | ||
|
|
50c2d04503 | ||
|
|
480de62686 | ||
|
|
955b501058 | ||
|
|
d985527624 | ||
|
|
afbe7f0e69 | ||
|
|
94e65ddce6 | ||
|
|
cb9f144255 | ||
|
|
ac84624faa | ||
|
|
c2196785e7 | ||
|
|
30097fbae6 | ||
|
|
c295dd5c62 | ||
|
|
373fef2824 | ||
|
|
cfc255bf2b | ||
|
|
ea7e58535b | ||
|
|
ea342a8e4f | ||
|
|
0b67dd1d05 | ||
|
|
1519faef81 | ||
|
|
9fad4a74ed | ||
|
|
24f023c8b3 | ||
|
|
3eb46114f8 | ||
|
|
6a5fd30531 | ||
|
|
96e83150e5 | ||
|
|
b2b65c65b9 | ||
|
|
5b028b4fa3 | ||
|
|
8f4e1b3409 | ||
|
|
ff209d0120 | ||
|
|
ea2fe618b5 | ||
|
|
3403cdf84b | ||
|
|
4f9a6f3a7b | ||
|
|
c8d6d233e5 | ||
|
|
0cfb65a19a | ||
|
|
384d917021 | ||
|
|
f1c8c67789 | ||
|
|
75e8f4ec6d | ||
|
|
d1d0323112 | ||
|
|
ab31dae582 | ||
|
|
64f176cedb | ||
|
|
9e921d6621 | ||
|
|
a4b98f2848 | ||
|
|
0d190e4a63 | ||
|
|
13cdb7cc35 | ||
|
|
ca60c467f3 | ||
|
|
01abba7d2c | ||
|
|
80074177fc | ||
|
|
bf67f8984a | ||
|
|
b2267c4b6c | ||
|
|
c80d69a31c | ||
|
|
1b7c3f0da3 | ||
|
|
c1ff6e1498 | ||
|
|
50c04ce71c | ||
|
|
bc6ff6bc8e | ||
|
|
93bcf2a7e8 | ||
|
|
c3b503adff | ||
|
|
ecdcbdda10 | ||
|
|
b97c9a5ed0 | ||
|
|
84a6843a7b | ||
|
|
17eed7467c | ||
|
|
310ffc849c | ||
|
|
3e6756160a | ||
|
|
563e809a2d | ||
|
|
86ec3f3bcd | ||
|
|
7b225cb824 | ||
|
|
562e0b06df | ||
|
|
51ce064507 | ||
|
|
ebaeff9b4d | ||
|
|
8889e799ca | ||
|
|
668705e475 | ||
|
|
e428e909bf | ||
|
|
d755c751c2 | ||
|
|
312c547412 | ||
|
|
48d30f2a3c | ||
|
|
d8ed30df14 | ||
|
|
50176cb267 | ||
|
|
5898d21857 | ||
|
|
e3839bc0b2 | ||
|
|
f97555d4a8 | ||
|
|
79bdca9769 | ||
|
|
138c2956ac | ||
|
|
ced457dd94 | ||
|
|
784fc6c6fa | ||
|
|
b4e0ec282f | ||
|
|
cbf7dfabcb | ||
|
|
b8eb55d965 | ||
|
|
30662a8110 | ||
|
|
69a273982f | ||
|
|
f817e6cb7f | ||
|
|
eef1b25e9f | ||
|
|
622de851fe | ||
|
|
8cecb61d28 | ||
|
|
77d8d27dfa | ||
|
|
340f259b17 | ||
|
|
5cf68a7f06 | ||
|
|
6a622565ca | ||
|
|
0ae5abcd0c | ||
|
|
b6cecb2125 | ||
|
|
3aa3a9c9a8 | ||
|
|
2c11ed43e4 | ||
|
|
23126aeb6d | ||
|
|
61fd67472b | ||
|
|
be0bee672e | ||
|
|
105c073e1f | ||
|
|
b695e3c646 | ||
|
|
33840dc5cd | ||
|
|
255f2f59fc | ||
|
|
200f3484b6 | ||
|
|
6a40eb48fe | ||
|
|
fb3e9ce9f3 | ||
|
|
91865460a2 | ||
|
|
644afe541e | ||
|
|
232303f06a | ||
|
|
280845610b | ||
|
|
6108c9d6d2 | ||
|
|
ce04e995ee | ||
|
|
d7fca09f0a | ||
|
|
917b77c8ad | ||
|
|
a2cd8ec19c | ||
|
|
6300d39065 | ||
|
|
2457079724 | ||
|
|
ba84e723e8 | ||
|
|
bf75e75d6f | ||
|
|
c3183a8bd7 | ||
|
|
7c162fc7ed | ||
|
|
529c5ac8d7 | ||
|
|
60e619e45e | ||
|
|
a89bdcdd3b | ||
|
|
09fbdf5541 | ||
|
|
0b517671cb | ||
|
|
a15dc3ed60 | ||
|
|
b7d60f4cb5 | ||
|
|
82a331a940 | ||
|
|
c31e688f11 | ||
|
|
0c887027d3 | ||
|
|
7c7df85d1a | ||
|
|
a7c025d927 | ||
|
|
424598b92f | ||
|
|
dc713c477b | ||
|
|
7e71edaee2 | ||
|
|
3f8925cbb0 | ||
|
|
5f9e24b314 | ||
|
|
dcd799ad85 | ||
|
|
ff0d7a4345 | ||
|
|
d68bad313e | ||
|
|
bd09917396 | ||
|
|
eeaa2fe882 | ||
|
|
32ac0e77fa | ||
|
|
947a1aa9f5 | ||
|
|
17a87f80e3 | ||
|
|
59f4dc8c78 | ||
|
|
6434a06c08 | ||
|
|
6133ab509d | ||
|
|
572a96328a | ||
|
|
a7ac3bec7f | ||
|
|
3e78f50a76 | ||
|
|
a4843e57cb | ||
|
|
d6d90dda58 | ||
|
|
c92c5e234c | ||
|
|
987f06d518 | ||
|
|
eaf7476785 | ||
|
|
3b39656280 | ||
|
|
5c559f921d | ||
|
|
77f6b3fcb8 | ||
|
|
f56ed7fd50 | ||
|
|
a470b579a9 | ||
|
|
a2eb7d44c0 | ||
|
|
dfc83a7aea | ||
|
|
71686e45e3 | ||
|
|
b0ac35a51b | ||
|
|
d836320b31 | ||
|
|
19e7c058c3 | ||
|
|
f1ae3607e4 | ||
|
|
d03bfaeb53 | ||
|
|
33f363cb31 | ||
|
|
cdb87b6a70 | ||
|
|
b5497d83a9 | ||
|
|
802b7c33b6 | ||
|
|
bb4f81fb84 | ||
|
|
10a02e98e9 | ||
|
|
32075ef758 | ||
|
|
998073ac7f | ||
|
|
93c7a5bdd2 | ||
|
|
3fb2ce47e9 | ||
|
|
61a8217d83 | ||
|
|
ad5e4341fa | ||
|
|
5b192795e6 | ||
|
|
5db9c5d31e | ||
|
|
ff469a386e | ||
|
|
3a90cf0e7b | ||
|
|
07dbad8c70 | ||
|
|
e8ba919661 | ||
|
|
390d92b16f | ||
|
|
d45d56f330 | ||
|
|
2e7cde3ca5 | ||
|
|
0594ea0b98 | ||
|
|
37d09781b4 | ||
|
|
b0f3a0ea30 | ||
|
|
8282abf264 | ||
|
|
4153b58502 | ||
|
|
b62b940cd4 | ||
|
|
ca9cf02361 | ||
|
|
e863ffd949 | ||
|
|
eb4bb3f238 | ||
|
|
d3d35bbea1 | ||
|
|
8eff6d80a2 | ||
|
|
77c8947ccd | ||
|
|
48556f6917 | ||
|
|
2e8dc4234f | ||
|
|
a6a60b6e71 | ||
|
|
eba9eaf37a | ||
|
|
ae31b1c23d | ||
|
|
535a0532df | ||
|
|
0579d242f6 | ||
|
|
b4910ed8f4 | ||
|
|
2bb1399ae7 | ||
|
|
062ada96ff | ||
|
|
bb94238e9c | ||
|
|
43a40c1f6b | ||
|
|
639866a9e1 | ||
|
|
05bbe6b799 | ||
|
|
e19b1c8bf0 | ||
|
|
0648d621b5 | ||
|
|
93c0de9ebb | ||
|
|
0220b3f3cd | ||
|
|
1af7f9388d | ||
|
|
76f0eaebce | ||
|
|
ae71957236 | ||
|
|
5004f0280e | ||
|
|
52967368ff | ||
|
|
8a63fa42ae | ||
|
|
05ecb92a88 | ||
|
|
829619d901 | ||
|
|
c74b60820b | ||
|
|
cd741fe7fd | ||
|
|
3b26cd845a | ||
|
|
d05cc3cd35 | ||
|
|
96dff832ba | ||
|
|
e43339613c | ||
|
|
e025bc2912 | ||
|
|
a4be636f9d | ||
|
|
a2bae6795f | ||
|
|
28d9bd0c73 | ||
|
|
8e12c9bef0 | ||
|
|
88926c3eef | ||
|
|
8dd774446b | ||
|
|
46cf112378 | ||
|
|
5d2520d057 | ||
|
|
a6ea89162a | ||
|
|
1039cf661d | ||
|
|
eaf9f0bbfa | ||
|
|
9e036176ef | ||
|
|
31e1edcc72 | ||
|
|
7d9d8d4a02 | ||
|
|
71cb43e751 | ||
|
|
f27e00500e | ||
|
|
617c0e3813 | ||
|
|
76634e3eed | ||
|
|
21c16b26c9 | ||
|
|
21536fb3ef | ||
|
|
7c0ee2429d | ||
|
|
9d6f43cfeb | ||
|
|
cdcb31cf2f | ||
|
|
e17f571dba | ||
|
|
629c48bba0 | ||
|
|
5078df6caf | ||
|
|
2c5c4d9714 | ||
|
|
316cd2c02c | ||
|
|
e56f08505f | ||
|
|
58a1f9e275 | ||
|
|
bfdf54db67 | ||
|
|
df8598a6f4 | ||
|
|
4ca9e74249 | ||
|
|
33caeeaf1d | ||
|
|
53a8c3ecc8 | ||
|
|
0ddb7f971d | ||
|
|
fabe066f94 | ||
|
|
5672bc0fb2 | ||
|
|
c77f43e7c7 | ||
|
|
d47ad34909 | ||
|
|
96f731e9c9 | ||
|
|
1b9376a9f5 | ||
|
|
1425ee0048 | ||
|
|
3a014b2a13 | ||
|
|
38c4e6bebc | ||
|
|
171404bf43 | ||
|
|
73b1adce1b | ||
|
|
90f55821e0 | ||
|
|
fee8009f38 | ||
|
|
8d698aeacd | ||
|
|
fbd588444f | ||
|
|
5735769ee7 | ||
|
|
150f9190d5 | ||
|
|
6a1e8a0c22 | ||
|
|
66fca4a921 | ||
|
|
9a2accc74b | ||
|
|
5584b5ec3a | ||
|
|
3b4121f59a | ||
|
|
35eb6c2974 | ||
|
|
e51deac151 | ||
|
|
c9bb160291 | ||
|
|
586979644c | ||
|
|
0d376eaa1d | ||
|
|
086c3d1a24 | ||
|
|
91e75561a3 | ||
|
|
979bf26441 | ||
|
|
49844ddd9b | ||
|
|
d095ebb2f3 | ||
|
|
36f473508a | ||
|
|
5eb2810352 | ||
|
|
ee9e3a6673 | ||
|
|
81a6bd528d | ||
|
|
0cd32c97c4 | ||
|
|
9bef55c63e | ||
|
|
9b8686c25f | ||
|
|
7130760114 | ||
|
|
c6390874a2 | ||
|
|
bf758dcd32 | ||
|
|
2258ffa5eb | ||
|
|
20b8e8db8b | ||
|
|
0738d965fd | ||
|
|
a3a421410f | ||
|
|
1921bef0ea | ||
|
|
70270830dc | ||
|
|
d57f465e60 | ||
|
|
03c38e3454 | ||
|
|
be7d632cba | ||
|
|
8c0a85abf4 | ||
|
|
497e8c06f1 | ||
|
|
c1bf84605c | ||
|
|
e362f12394 | ||
|
|
02d201a2f1 | ||
|
|
48915cc6ad | ||
|
|
02b065cc2c | ||
|
|
a255597bc0 | ||
|
|
29858e8b10 | ||
|
|
972cfb265b | ||
|
|
5e8a3afe61 | ||
|
|
700decb2e0 | ||
|
|
8368055397 | ||
|
|
0d0f1f1c0c | ||
|
|
db68ae5cea | ||
|
|
0fd7c4aa4f | ||
|
|
8592e6ef60 | ||
|
|
e9fb02220a | ||
|
|
aa54a0cd98 | ||
|
|
eb724c8753 | ||
|
|
1bb0caa704 | ||
|
|
5bf2bc4a7b | ||
|
|
70fd7ef89d | ||
|
|
50d8e79571 | ||
|
|
c236ddd967 | ||
|
|
b551518911 | ||
|
|
1be49b06f3 | ||
|
|
200a9c6318 | ||
|
|
9f10106d75 | ||
|
|
6d4ff752a0 | ||
|
|
29ecae66a9 | ||
|
|
9c5f50d0a6 | ||
|
|
8fcc9ac1e2 | ||
|
|
8d83b3b1e7 | ||
|
|
155570b6bf | ||
|
|
831dc35935 | ||
|
|
b641f1b67c | ||
|
|
3c4906b8ac | ||
|
|
a575bc92cc | ||
|
|
7794e9ccd2 | ||
|
|
4f5301a7e0 | ||
|
|
6842936a75 | ||
|
|
a0bf6599fa | ||
|
|
c0384949a3 | ||
|
|
371f4b128e | ||
|
|
29fc776293 | ||
|
|
bbdf87190c | ||
|
|
02a448f284 | ||
|
|
8665878b04 | ||
|
|
c23812941b | ||
|
|
fdac774745 | ||
|
|
0a38b65ded | ||
|
|
a7f44c8dd1 | ||
|
|
2444bd3c2d | ||
|
|
27f74844cc | ||
|
|
d041712bd8 | ||
|
|
ef0f2024c2 | ||
|
|
bef3b3ba62 | ||
|
|
037aee7c59 | ||
|
|
0e3c13099b | ||
|
|
8e3515bc34 | ||
|
|
c736de7875 | ||
|
|
42375d143e | ||
|
|
7e6d7aed20 | ||
|
|
ea68d0c28f | ||
|
|
9cc82aedf2 | ||
|
|
c52abce656 | ||
|
|
65d8368ad4 | ||
|
|
cf2f223ad4 | ||
|
|
daae1aec6c | ||
|
|
59bcd24c47 | ||
|
|
44e224489b | ||
|
|
8134e0223f | ||
|
|
482249a05b | ||
|
|
d0998dc093 | ||
|
|
848bb01c10 | ||
|
|
e39eb76aca | ||
|
|
d6d2a55747 | ||
|
|
355fa1a622 | ||
|
|
fb007b8835 | ||
|
|
256f5fcd0e | ||
|
|
e698c950a3 | ||
|
|
d0b9c3c118 | ||
|
|
24358ca1a9 | ||
|
|
6a21c94a0c | ||
|
|
2d39a1e4b8 | ||
|
|
e97a8da721 | ||
|
|
665aaa3af9 | ||
|
|
17fe1da4ed | ||
|
|
cb6c94b4f9 | ||
|
|
6fd6765bee | ||
|
|
66b7019da9 | ||
|
|
2c11624e32 | ||
|
|
e44d7e6d49 | ||
|
|
261911f6de | ||
|
|
fe714a9003 | ||
|
|
e8501a658b | ||
|
|
3fb4830456 | ||
|
|
39982b507a | ||
|
|
4bd4f3ac68 | ||
|
|
8533ef7739 | ||
|
|
bd6d61c8c7 | ||
|
|
7045ffbdb8 | ||
|
|
9e47f4a7c3 | ||
|
|
c886e49682 | ||
|
|
8fdec8e816 | ||
|
|
131387d0ff | ||
|
|
f4a2b83afc | ||
|
|
1c02ad6b4c | ||
|
|
d93890ddcb | ||
|
|
ca530159bb | ||
|
|
b76b747235 | ||
|
|
67896b7d3a | ||
|
|
3b598a6f45 | ||
|
|
62466123ff | ||
|
|
14163a0791 | ||
|
|
52a8a175a6 | ||
|
|
0a83b0826a | ||
|
|
d854cd7024 | ||
|
|
7ac8d7a43a | ||
|
|
b012618968 | ||
|
|
fba59ff347 | ||
|
|
60caac5139 | ||
|
|
27d2742386 | ||
|
|
5ef25cfa6f | ||
|
|
17e3dfe2bb | ||
|
|
307e438a1e | ||
|
|
89489f7c7f | ||
|
|
923a4706a0 | ||
|
|
2594c7179e | ||
|
|
a334ff33cd | ||
|
|
0e2289caa6 | ||
|
|
be26968237 | ||
|
|
b0c1ecfdc5 | ||
|
|
b4d5dcbf57 | ||
|
|
3161ba8983 | ||
|
|
022f1ededc | ||
|
|
70a19dd95d | ||
|
|
00b3f5b9f5 | ||
|
|
8b0bb413d8 | ||
|
|
bd5e7d94fe | ||
|
|
d43b2364a0 | ||
|
|
610e73d9e3 | ||
|
|
6f2a454d46 | ||
|
|
4edce29d53 | ||
|
|
ed2b8dd129 | ||
|
|
42cdb36a51 | ||
|
|
159c22ac21 | ||
|
|
75b6833245 | ||
|
|
b567717c75 | ||
|
|
b2af829e2e | ||
|
|
6e81714937 | ||
|
|
cb9474d8d0 | ||
|
|
be47e4c050 | ||
|
|
c301898147 | ||
|
|
8324561022 | ||
|
|
834d630ef7 | ||
|
|
c6259adad1 | ||
|
|
9d1be34958 | ||
|
|
ce4e64ec40 | ||
|
|
92125b49f0 | ||
|
|
b017466270 | ||
|
|
568d2304ea | ||
|
|
5dc1b245d0 | ||
|
|
978d95b351 | ||
|
|
90079c9dfe | ||
|
|
57dec7e211 | ||
|
|
fa75c853a7 | ||
|
|
0887a57e29 | ||
|
|
18901dcd44 | ||
|
|
a6e0fbd5e6 | ||
|
|
c07d0353f0 | ||
|
|
caecbe5b63 | ||
|
|
077cab656b | ||
|
|
95d7a7e860 | ||
|
|
77a77c34b8 | ||
|
|
fa78cc2a9f | ||
|
|
03f18af66f | ||
|
|
4e21145808 | ||
|
|
258557ee5d | ||
|
|
88ad420716 | ||
|
|
4828e40f0d | ||
|
|
5be29f5a07 | ||
|
|
48ac99a29b | ||
|
|
2c4f2139dd | ||
|
|
47236c1e6c | ||
|
|
5d8996dc38 | ||
|
|
9feff84125 | ||
|
|
c0fc62a1d6 | ||
|
|
6b06d58759 | ||
|
|
d06f2a2d18 | ||
|
|
7c5dca202e | ||
|
|
055e006c27 | ||
|
|
2f11451f9d | ||
|
|
5b8d5ca72a | ||
|
|
40cd8b65d7 | ||
|
|
3ec6bb84ee | ||
|
|
180c870208 | ||
|
|
5a81d02271 | ||
|
|
465abf47c8 | ||
|
|
54544c2683 | ||
|
|
cf41b8745a | ||
|
|
1a1fc8604a | ||
|
|
b9ecf20596 | ||
|
|
1326e8470a | ||
|
|
68ae03ef85 | ||
|
|
8750c30b7d | ||
|
|
869945e68c | ||
|
|
c263881586 | ||
|
|
b56c82cefb | ||
|
|
7d936041c0 | ||
|
|
8208def57a | ||
|
|
a0ead808d5 | ||
|
|
95e7464962 | ||
|
|
21a299cb2b | ||
|
|
4f644ee1fe | ||
|
|
0f7528b73b | ||
|
|
354262ba9b | ||
|
|
7790674d9d | ||
|
|
707fb53dda | ||
|
|
6f356f8390 | ||
|
|
dc2530957f | ||
|
|
e88dcae1a0 | ||
|
|
a5fff878c5 | ||
|
|
d71d66e8be | ||
|
|
54275a8870 | ||
|
|
90eda82045 | ||
|
|
6816dc4f75 | ||
|
|
c17ad0ef2d | ||
|
|
3f71f58454 | ||
|
|
b2055ad44f | ||
|
|
b3eefc9e25 | ||
|
|
41baee7b43 | ||
|
|
fc7d6589bf | ||
|
|
e0e94e482a | ||
|
|
c5964c270d | ||
|
|
69c850d1ac | ||
|
|
004d0146b7 | ||
|
|
cee9c81496 | ||
|
|
1c01097491 | ||
|
|
ae08438b7b | ||
|
|
440b60bdba | ||
|
|
d83bab55aa | ||
|
|
e1f582bcfc | ||
|
|
e50f95abb3 | ||
|
|
4e16a8b6f9 | ||
|
|
cf1ec16fdd | ||
|
|
e23f5cb159 | ||
|
|
4d07171aaa | ||
|
|
7c50662ef6 | ||
|
|
90126b4d29 | ||
|
|
7580af1b5f | ||
|
|
8188203aed | ||
|
|
d91f5461d5 | ||
|
|
066b18c792 | ||
|
|
91de1004e6 | ||
|
|
fecd2d7111 | ||
|
|
07dd0884f3 | ||
|
|
a1fb97bd90 | ||
|
|
2e002d76b2 | ||
|
|
aa13742c9a | ||
|
|
7effcb3aac | ||
|
|
19a4610373 | ||
|
|
4cdbbaa35d | ||
|
|
e2a8ba7f0c | ||
|
|
1923e14ac4 | ||
|
|
6d1869af61 | ||
|
|
6e005a0c62 | ||
|
|
5d88558b36 | ||
|
|
2770634627 | ||
|
|
1602ab2355 | ||
|
|
7a37cb6f0b | ||
|
|
4d6de7500e | ||
|
|
13d36de121 | ||
|
|
ae992ed366 | ||
|
|
c03b16a6e8 | ||
|
|
7823291b44 | ||
|
|
59d79cc329 | ||
|
|
c24ebf3427 | ||
|
|
434d5be26c | ||
|
|
f904ceae7a | ||
|
|
9e62eefee0 | ||
|
|
7fdb31abf0 | ||
|
|
e1d4e2f526 | ||
|
|
f18e317dcf | ||
|
|
e143a286ef | ||
|
|
faa9c26283 | ||
|
|
da182f5539 | ||
|
|
ced51e37b4 | ||
|
|
f61134fd69 | ||
|
|
578f60ba91 | ||
|
|
02effac75c | ||
|
|
72f4b21aea | ||
|
|
1aa59afaf0 | ||
|
|
45df3ed168 | ||
|
|
b344972931 | ||
|
|
7886a816b2 | ||
|
|
4722730aff | ||
|
|
27a2c6192f | ||
|
|
db77d133dc | ||
|
|
000ebfaf2f | ||
|
|
a47001516d | ||
|
|
fa9901271a | ||
|
|
913e8c355b | ||
|
|
aeef2f8948 | ||
|
|
9be8e2b5b9 | ||
|
|
99b68801d9 | ||
|
|
4c766298f1 | ||
|
|
2618d09ef8 | ||
|
|
2bef98408c | ||
|
|
dbf90d4f37 | ||
|
|
1e378dd1dd | ||
|
|
fa51c25919 | ||
|
|
c880f49b81 | ||
|
|
1835220ba3 | ||
|
|
813126cecb | ||
|
|
86dbd3a03a | ||
|
|
948c2cd021 | ||
|
|
f9ca77a982 | ||
|
|
2aa45b8794 | ||
|
|
3a056dc844 | ||
|
|
2b2fc27899 | ||
|
|
35d5eb1713 | ||
|
|
86fab38407 | ||
|
|
866fe5cc8d | ||
|
|
2845f8543c | ||
|
|
011699d58f | ||
|
|
ddd37f5bee | ||
|
|
44202b5c4d | ||
|
|
b157d07b6d | ||
|
|
31d30a9115 | ||
|
|
cc7ee5acc0 | ||
|
|
35bcb627c2 | ||
|
|
a7882fadba | ||
|
|
fe4525b441 | ||
|
|
e17594a7aa | ||
|
|
416357bf27 | ||
|
|
ae021ea930 | ||
|
|
32735a5e06 | ||
|
|
5b1d26263b | ||
|
|
84be5bc732 | ||
|
|
bf1dee2bc4 | ||
|
|
e0aadacf93 | ||
|
|
35481682a9 | ||
|
|
64291d336c | ||
|
|
3fe1ee4bd8 | ||
|
|
130a8d0f00 | ||
|
|
36c4596a08 | ||
|
|
ebad3812e4 | ||
|
|
004c1c915f | ||
|
|
39bd13a6ca | ||
|
|
f10ac679e2 | ||
|
|
8d49012d64 | ||
|
|
91392c1e83 | ||
|
|
65bb31e92a | ||
|
|
c06fa72936 | ||
|
|
a1adb1eb43 | ||
|
|
778ddb0e75 | ||
|
|
e919a026b7 | ||
|
|
a78f78604a | ||
|
|
eeea093bb8 | ||
|
|
b795c62ab7 | ||
|
|
b7c7b268d4 | ||
|
|
f7b9351e38 | ||
|
|
4e205d078d | ||
|
|
16016cb13d | ||
|
|
4754fff89b | ||
|
|
f88ed69f1f | ||
|
|
2e7f7cf642 | ||
|
|
60f9403657 | ||
|
|
4c9974f7eb | ||
|
|
eace5c5543 | ||
|
|
f6d16ea4d9 | ||
|
|
ac2f11360c | ||
|
|
48a5eee9ab | ||
|
|
380156aa4b | ||
|
|
d4cd8a228f | ||
|
|
6081f1d5ff | ||
|
|
0139967b29 | ||
|
|
0a30a42b2e | ||
|
|
ff54bfa5b3 | ||
|
|
22445f6df9 | ||
|
|
272aa9513a | ||
|
|
4b1abfc60f | ||
|
|
b3130f38f2 | ||
|
|
32fdbaccc3 | ||
|
|
8a4d3f5d80 | ||
|
|
920af04b04 | ||
|
|
7d13d22650 | ||
|
|
6c17725823 | ||
|
|
f3b1ddf439 | ||
|
|
c7de374943 | ||
|
|
1bb6345fcb | ||
|
|
cbc5e8aea1 | ||
|
|
7ebb888c31 | ||
|
|
93c6a03287 | ||
|
|
ae97fbbcc3 | ||
|
|
7ef381f1a4 | ||
|
|
70fad46534 | ||
|
|
cb8d253dc5 | ||
|
|
cacab1e039 | ||
|
|
0bf49ebe9a | ||
|
|
fa9b1933fa | ||
|
|
444f676d2d | ||
|
|
2ccba4b345 | ||
|
|
0b76e86ace | ||
|
|
f40a86e744 | ||
|
|
5b594a4a7b | ||
|
|
ea857b9c7b | ||
|
|
14a11f06e5 | ||
|
|
987c89774c | ||
|
|
52d0c44014 | ||
|
|
e70d188b82 | ||
|
|
9419c4b796 | ||
|
|
58c6aba6af | ||
|
|
d09ae1a66e | ||
|
|
12717d13de | ||
|
|
b363a05a7d | ||
|
|
318515db6f | ||
|
|
da7ff06734 | ||
|
|
86f4a2743a | ||
|
|
f86a1a0002 | ||
|
|
e5d4a5f061 | ||
|
|
7be884b138 | ||
|
|
4eacdeec5e | ||
|
|
8a9a5919f2 | ||
|
|
442883c377 | ||
|
|
33939917c0 | ||
|
|
e1721bf337 | ||
|
|
5081ede268 | ||
|
|
393416a925 | ||
|
|
34ec791ba3 | ||
|
|
f4b80d4d80 | ||
|
|
fcbc1773ad | ||
|
|
4d971be732 | ||
|
|
deff56db29 | ||
|
|
5b78a02a53 | ||
|
|
9c5420c79c | ||
|
|
bd58802ed6 | ||
|
|
71504d0ded | ||
|
|
3aff7693c7 | ||
|
|
b46f426f30 | ||
|
|
70652d445c | ||
|
|
35f96b28bc | ||
|
|
dd40bb3850 | ||
|
|
849c0cbd49 | ||
|
|
201d613ac1 | ||
|
|
8897ecd0d5 | ||
|
|
784a8e625f | ||
|
|
770cc2cd72 | ||
|
|
fa620be738 | ||
|
|
34893e7847 | ||
|
|
c49d5b4ffa | ||
|
|
c37387db64 | ||
|
|
83b626b77e | ||
|
|
45932d9189 | ||
|
|
fe01820f3f | ||
|
|
2ad4436cef | ||
|
|
5b8fb49d4c | ||
|
|
dca0240c13 | ||
|
|
ce692df94f | ||
|
|
dbcf2acce4 | ||
|
|
3bc628417f | ||
|
|
45b286206f | ||
|
|
bdc9b78ec8 | ||
|
|
e23c11f15a | ||
|
|
6865d25035 | ||
|
|
bfcc75f754 | ||
|
|
25289ed4c5 | ||
|
|
2c32cbfbfd | ||
|
|
310d664fdc | ||
|
|
74dce4b70a | ||
|
|
187963cc38 | ||
|
|
afd618c61a | ||
|
|
4196ec5093 | ||
|
|
49d28f1eeb | ||
|
|
90640c9378 | ||
|
|
bf0e9fb107 | ||
|
|
eba0bf8f41 | ||
|
|
66dc40f6e2 | ||
|
|
caa0caf297 | ||
|
|
e6a36178ff | ||
|
|
263cc2df2a | ||
|
|
da556e0546 | ||
|
|
3180ae1a41 | ||
|
|
b3bf33f488 | ||
|
|
58081ed0ef | ||
|
|
f80111299f | ||
|
|
f5dd1722f5 | ||
|
|
4237ce9b3c | ||
|
|
b3f3a307ba | ||
|
|
381e84e649 | ||
|
|
4ccddf839f | ||
|
|
f40ee92826 | ||
|
|
686c774e0f | ||
|
|
13b28e6f1c | ||
|
|
7fe0609e9e | ||
|
|
b24aec26c0 | ||
|
|
c465d303e5 | ||
|
|
13e80db668 | ||
|
|
712e3df4b8 | ||
|
|
98d22523be | ||
|
|
6326360595 | ||
|
|
7cfbddfd35 | ||
|
|
92eb6dab2f | ||
|
|
7cebdc7270 | ||
|
|
f9094223ba | ||
|
|
849e0964ba | ||
|
|
096ed14978 | ||
|
|
d04196ec7c | ||
|
|
bf7f6054c6 | ||
|
|
afe745dc44 | ||
|
|
5032bc4da7 | ||
|
|
10c19bbb94 | ||
|
|
7519eb1f43 | ||
|
|
95b800638b | ||
|
|
ff9a3a55e2 | ||
|
|
56b4e50aab | ||
|
|
32d513a74f | ||
|
|
8ce4768aa6 | ||
|
|
13128d354d | ||
|
|
31b41cacba | ||
|
|
ddaf190c3c | ||
|
|
e873009aeb | ||
|
|
7ec3abb069 | ||
|
|
5b628c2f48 | ||
|
|
dcb2300699 | ||
|
|
cfd69d1603 | ||
|
|
f816bc23e9 | ||
|
|
8601730dd8 | ||
|
|
336342c72e | ||
|
|
357763ff55 | ||
|
|
45b757697a | ||
|
|
a9a0d6233e | ||
|
|
91dbf51d8b | ||
|
|
af79066c26 | ||
|
|
c5f6676ac2 | ||
|
|
906d2a4168 | ||
|
|
b85b4a7f72 | ||
|
|
3b360c807e | ||
|
|
d0bec7db4d | ||
|
|
7af5d8debd | ||
|
|
e7603a78d0 | ||
|
|
3a728df3b1 | ||
|
|
417fa314b4 | ||
|
|
73cfd71bd4 | ||
|
|
3a092012bb | ||
|
|
415abd13c9 | ||
|
|
e94eac77eb | ||
|
|
25b11349a4 | ||
|
|
4ea8e15710 | ||
|
|
890562e810 | ||
|
|
9b4d38ed3c | ||
|
|
33c33431f9 | ||
|
|
53d3e0db88 | ||
|
|
94e4556bee | ||
|
|
1ad9dd4a28 | ||
|
|
e15f0e07dd | ||
|
|
eda734e728 | ||
|
|
205c6e9ed2 | ||
|
|
5132327d62 | ||
|
|
55e0200fb6 | ||
|
|
fefd6699f3 | ||
|
|
963840612c | ||
|
|
fd8e567c60 | ||
|
|
69d02b8abb | ||
|
|
ccf721fd6c | ||
|
|
98c4bb2c4f | ||
|
|
55bd13c3f2 | ||
|
|
95c5256fe3 | ||
|
|
f8de555032 | ||
|
|
060d27f57a | ||
|
|
917d3a4ded | ||
|
|
13b75dea27 | ||
|
|
9487cd2b0b | ||
|
|
20dbe1bde6 | ||
|
|
c7f42cfca8 | ||
|
|
3f9585b1fb | ||
|
|
e021663975 | ||
|
|
8c1cca0d57 | ||
|
|
6d74480998 | ||
|
|
31bad3a1e1 | ||
|
|
f0ccf6c3a5 | ||
|
|
367b13cdad | ||
|
|
47ac879ed9 | ||
|
|
28a50c00bb | ||
|
|
6ceb74cb33 | ||
|
|
9f682cded0 | ||
|
|
40ddc506a7 | ||
|
|
74d5144892 | ||
|
|
ea2f2ba213 | ||
|
|
970a5e19d0 | ||
|
|
3786660ecd | ||
|
|
c0d72d25f8 | ||
|
|
b69d7f9729 | ||
|
|
03a934a8e9 | ||
|
|
215df5cc03 | ||
|
|
cfcdbffa7f | ||
|
|
7b32b75052 | ||
|
|
f6549aca76 | ||
|
|
4ce3cff2bf | ||
|
|
c4c8b8c9e1 | ||
|
|
23ce30a7fc | ||
|
|
2fd23af04a | ||
|
|
33534d50cd | ||
|
|
79aed6b7b0 | ||
|
|
740ef8a2d7 | ||
|
|
68efd8f3d0 | ||
|
|
6fe6e83cb9 | ||
|
|
7ed7ac817d | ||
|
|
dc39f8fe76 | ||
|
|
519cbfe38b | ||
|
|
f1fd5f2aa6 | ||
|
|
2b5d06a6dc | ||
|
|
ef13d04a98 | ||
|
|
fb3f3c7405 | ||
|
|
a9df13e4d7 | ||
|
|
a46c5383cd | ||
|
|
a133a94dbe | ||
|
|
bf5cab0062 | ||
|
|
4e64838613 | ||
|
|
2f894a5f2f | ||
|
|
3903f6c709 | ||
|
|
78ab61ec0c | ||
|
|
be8a5f535c | ||
|
|
53a5762f98 | ||
|
|
85c92935d3 | ||
|
|
ed51a60dfe | ||
|
|
6ad7771fed | ||
|
|
63f87cdb18 | ||
|
|
73f670212e | ||
|
|
7418c6db73 | ||
|
|
6892db0056 | ||
|
|
2f6bd2c287 | ||
|
|
4bff954c3b | ||
|
|
e70f535ad3 | ||
|
|
da66981a1f | ||
|
|
ab9ba94dbf | ||
|
|
0d15b9117f | ||
|
|
4de8e8e291 | ||
|
|
ced99152a1 | ||
|
|
c30cd23b89 | ||
|
|
1e58173241 | ||
|
|
062d7d3f71 | ||
|
|
284983a4a7 | ||
|
|
b590762259 | ||
|
|
1763eb2f17 | ||
|
|
5be2ca8efc | ||
|
|
826b3d6803 | ||
|
|
6852463b53 | ||
|
|
9546f6069c | ||
|
|
d65955647c | ||
|
|
5200ff8e84 | ||
|
|
f1a667ae2e | ||
|
|
82682ece5e | ||
|
|
61f9184728 | ||
|
|
a220be8136 | ||
|
|
11b2096dba | ||
|
|
8370248390 | ||
|
|
f528269bc6 | ||
|
|
d551531603 | ||
|
|
3b50bd8509 | ||
|
|
8bc73a0101 | ||
|
|
419c15d0c3 | ||
|
|
be90776588 | ||
|
|
7c8cc16768 | ||
|
|
1596b0addc | ||
|
|
886bbe1111 | ||
|
|
de266f12a4 | ||
|
|
f9a5bc00e7 | ||
|
|
356c122767 | ||
|
|
e9b94033c5 | ||
|
|
8e1385e4e1 | ||
|
|
e881ed0d9a | ||
|
|
26d03d49b1 | ||
|
|
082a3b21e1 | ||
|
|
15e6e8435a | ||
|
|
2d67067159 | ||
|
|
3fb3aaad2a | ||
|
|
616479c4fc | ||
|
|
9b4c732dca | ||
|
|
249be00463 | ||
|
|
febcccc670 | ||
|
|
2d4eed726f | ||
|
|
98de7888cd | ||
|
|
24eb376bed | ||
|
|
75fbc0f939 | ||
|
|
c8c1993db3 | ||
|
|
628cb33e44 | ||
|
|
8160df000b | ||
|
|
d0a39ef32f | ||
|
|
f6e7019b51 | ||
|
|
b7d82cddbc | ||
|
|
22ce6fbf09 | ||
|
|
c202394c3c | ||
|
|
900f415c6b | ||
|
|
38a4fd5fbc | ||
|
|
9f629132e4 | ||
|
|
32ba7895a3 | ||
|
|
65627da72b | ||
|
|
00de654ca5 | ||
|
|
0f5ca758b8 | ||
|
|
857a5b4d52 | ||
|
|
3757da0f5f | ||
|
|
4befd155a1 | ||
|
|
bb7c2390b1 | ||
|
|
c70d30744c | ||
|
|
4b49bb6d18 | ||
|
|
58481c81a0 | ||
|
|
465ed569a1 | ||
|
|
547a159fb3 | ||
|
|
ea4fc32e60 | ||
|
|
47db118c21 | ||
|
|
a1ff484c85 | ||
|
|
6ebedb9219 | ||
|
|
c717bed4fb | ||
|
|
170bff5a3f | ||
|
|
41ea121377 | ||
|
|
b55615fffa | ||
|
|
b3de48fdd2 | ||
|
|
f58eda97c8 | ||
|
|
7958aa3881 | ||
|
|
ad69ab7579 | ||
|
|
8b88be5742 | ||
|
|
6f31dae429 | ||
|
|
e67ac4c3ad | ||
|
|
a52984f515 | ||
|
|
746dbc2533 | ||
|
|
b2c462fbaa | ||
|
|
42171e5680 | ||
|
|
10ddc61fb7 | ||
|
|
ae1d3d9c09 | ||
|
|
990caaa75d | ||
|
|
00dc6fe775 | ||
|
|
3fa9f258d7 | ||
|
|
33fd60e743 | ||
|
|
fbac63085f | ||
|
|
35ce221cab | ||
|
|
4599d76ce4 | ||
|
|
6a6632e363 | ||
|
|
5c18dd0603 | ||
|
|
245c48d78f | ||
|
|
e5d880b516 | ||
|
|
ff02161062 | ||
|
|
0475610f59 | ||
|
|
215b94046a | ||
|
|
a1236d855b | ||
|
|
0f835fd3ba | ||
|
|
cbb0d1a05e | ||
|
|
7bb7386c83 | ||
|
|
48bef164ef | ||
|
|
434c1ef275 | ||
|
|
6772b08745 | ||
|
|
7c8d560f9e | ||
|
|
29d3e4fd5b | ||
|
|
db0e95deac | ||
|
|
b8748916a7 | ||
|
|
e7c5a20ab0 | ||
|
|
bac754ac4b | ||
|
|
e028215718 | ||
|
|
908a0929f0 | ||
|
|
6565ad8e96 | ||
|
|
c0819a83f0 | ||
|
|
d35f017db5 | ||
|
|
3b8da702a7 | ||
|
|
24c24f40ab | ||
|
|
865a888363 | ||
|
|
1cd56cb6d1 | ||
|
|
f10ef8fd70 | ||
|
|
cdff9e28a1 | ||
|
|
ca2924510a | ||
|
|
42cbbbfc3a | ||
|
|
d8d1daca67 | ||
|
|
1aa021b157 | ||
|
|
5e99c45fa1 | ||
|
|
687a601772 | ||
|
|
4bc2880505 | ||
|
|
0f474d7f3e | ||
|
|
fe5342d63c | ||
|
|
2f9de59b79 | ||
|
|
18d18118a0 | ||
|
|
b074b5ac70 | ||
|
|
a38231fb1b | ||
|
|
740abc1e70 | ||
|
|
2761dfb06f | ||
|
|
93ce46bb7c | ||
|
|
7e23fca598 | ||
|
|
472e14f339 | ||
|
|
0c2631622e | ||
|
|
2285034a62 | ||
|
|
49e28839f7 | ||
|
|
b2533565ad | ||
|
|
a96a1730a1 | ||
|
|
d027d7e099 | ||
|
|
cf5a5564ca | ||
|
|
e183067257 | ||
|
|
7ab15f7f89 | ||
|
|
1a91f0cbcb | ||
|
|
30241e0837 | ||
|
|
aea098b668 | ||
|
|
c34948190a | ||
|
|
95a441b5b1 | ||
|
|
21b9b1d7f1 | ||
|
|
bd36a6d528 | ||
|
|
aca77e1279 | ||
|
|
f7b604cb9b | ||
|
|
9c5cfd6bca | ||
|
|
f657ecac6f | ||
|
|
69aaca33a5 | ||
|
|
08168a7877 | ||
|
|
9054f48f88 | ||
|
|
fbe6b5a3a3 | ||
|
|
b114f4ee96 | ||
|
|
8af5634431 | ||
|
|
1b61598149 | ||
|
|
2cfc180df7 | ||
|
|
4d20e8fb28 | ||
|
|
8f3d570bf6 | ||
|
|
276b19bf09 | ||
|
|
b0ebbdd7ff | ||
|
|
5014de6d9d | ||
|
|
6dc9843aa9 | ||
|
|
ad6e3dee6c | ||
|
|
e0e51835b5 | ||
|
|
7bccc2fbdb | ||
|
|
c2da601722 | ||
|
|
e8fea2e969 | ||
|
|
ebe23989a7 | ||
|
|
278a2dfc07 | ||
|
|
1fb93ea73d | ||
|
|
bfc5aaa2de | ||
|
|
183fbafaae | ||
|
|
470f15fd3c | ||
|
|
d8a5209ec4 | ||
|
|
99c6b4552a | ||
|
|
d69bf5d76f | ||
|
|
ac484e36fa | ||
|
|
dc88cbd902 | ||
|
|
fb277e9e49 | ||
|
|
8c6e4ecefc | ||
|
|
582393a462 | ||
|
|
c118bacffd | ||
|
|
132f52785c | ||
|
|
0c1a08b231 | ||
|
|
b88f13ee32 | ||
|
|
c556ec2001 | ||
|
|
d49683ab2f | ||
|
|
810c3cd561 | ||
|
|
b909157f4b | ||
|
|
21c1232ba6 | ||
|
|
ff61a42670 | ||
|
|
f160d855c0 | ||
|
|
51685a2094 | ||
|
|
487c71ec15 | ||
|
|
39aa60850d | ||
|
|
872921e6b7 | ||
|
|
89788df95c | ||
|
|
6ccd8ed0b8 | ||
|
|
aa7e3bfa69 | ||
|
|
00154f2b9f | ||
|
|
531a9c28ae | ||
|
|
63be2c28e9 | ||
|
|
56c4e3e31f | ||
|
|
ef2497cadc | ||
|
|
95f56a8869 | ||
|
|
f5b1112304 | ||
|
|
333a5be30b | ||
|
|
6c9e697892 | ||
|
|
7663eb531e | ||
|
|
5e80e402ee | ||
|
|
33499fe945 | ||
|
|
2882b638e5 | ||
|
|
5529bf284a | ||
|
|
9e2400de69 | ||
|
|
81c92cda79 | ||
|
|
6506935d03 | ||
|
|
b6be26231f | ||
|
|
a96ba9f717 | ||
|
|
173f570230 | ||
|
|
57dcaba367 | ||
|
|
d9f7955356 | ||
|
|
9cf264998f | ||
|
|
0dc67ae467 | ||
|
|
75c1c0b839 | ||
|
|
1feac95069 | ||
|
|
ed3f87e6a8 | ||
|
|
43662318be | ||
|
|
785d1a04da | ||
|
|
cc76c7f0f3 | ||
|
|
57741cd5ce | ||
|
|
69bd71148c | ||
|
|
528e363d64 | ||
|
|
bd772daee0 | ||
|
|
23fa55ea11 | ||
|
|
0a052e7bb3 | ||
|
|
60a96e9542 | ||
|
|
f3f9abef0c | ||
|
|
58fc34d9f7 | ||
|
|
6fdd769d0f | ||
|
|
b54384bb33 | ||
|
|
c57f98591a | ||
|
|
7dcacd3b01 | ||
|
|
2225033b7c | ||
|
|
7c5194fbaa | ||
|
|
cded76d1a2 | ||
|
|
361284fe06 | ||
|
|
aa3e55cacc | ||
|
|
73987eaf23 | ||
|
|
06058a45c0 | ||
|
|
d46cab6fc8 | ||
|
|
77bd800d95 | ||
|
|
831373c292 | ||
|
|
9c5e5e117a | ||
|
|
346ada2eff | ||
|
|
485ff37b22 | ||
|
|
47ef6f4844 | ||
|
|
cd288ec125 | ||
|
|
bde2eb786d | ||
|
|
b6896e28c8 | ||
|
|
15dc233a86 | ||
|
|
b070549eca | ||
|
|
71a3df028b | ||
|
|
73ef8c821b | ||
|
|
bbd314b6df | ||
|
|
5764fe7555 | ||
|
|
44cc17cb84 | ||
|
|
dba8879576 | ||
|
|
1deb48bf60 | ||
|
|
11174b8581 | ||
|
|
bd35f71c6a | ||
|
|
d29ae6a64d | ||
|
|
5b69b9beae | ||
|
|
0c78741642 | ||
|
|
a9440f41a7 | ||
|
|
8fc4306d76 | ||
|
|
371d7385ed | ||
|
|
2cacdbaf00 | ||
|
|
3041fe7c3b | ||
|
|
436e96f734 | ||
|
|
67a9e1f8c5 | ||
|
|
fc0a950af1 | ||
|
|
e1872387d4 | ||
|
|
ac10b96280 | ||
|
|
d5313ebbda | ||
|
|
c3d1e5c58c | ||
|
|
478c0cd443 | ||
|
|
2be2d861c9 | ||
|
|
9731980fe6 | ||
|
|
392f8e5e60 | ||
|
|
a7e1275b5f | ||
|
|
29a6d47cca | ||
|
|
65483dd34a | ||
|
|
3b290fe356 | ||
|
|
2648913b61 | ||
|
|
d386e49bd5 | ||
|
|
f3c66d131e | ||
|
|
c1b4671435 | ||
|
|
cbeb0d229b | ||
|
|
7f8db50017 | ||
|
|
0c5ca37412 | ||
|
|
602071a440 | ||
|
|
7061b58940 | ||
|
|
76c2c54e5a | ||
|
|
f256da8a16 | ||
|
|
ffcf7d0630 | ||
|
|
b80205200c | ||
|
|
40d0f6c1e2 | ||
|
|
bddd4db2b2 | ||
|
|
7ee18e81c7 | ||
|
|
700240d441 | ||
|
|
539d38259c | ||
|
|
2efb0dfb17 | ||
|
|
f38bf65656 | ||
|
|
947d32d905 | ||
|
|
56569966a6 | ||
|
|
6092535041 | ||
|
|
d965eb0d7e | ||
|
|
44a53ce28e | ||
|
|
a228f32f34 | ||
|
|
2082981bd6 | ||
|
|
994ad0b06c | ||
|
|
3c59ee79f6 | ||
|
|
b3ebd7c29d | ||
|
|
fcc2355037 | ||
|
|
76a5c39fdc | ||
|
|
f4ec448d75 | ||
|
|
e38390f8a1 | ||
|
|
2990389ea5 | ||
|
|
249dfb166d | ||
|
|
4c06d21396 | ||
|
|
a046f2975f | ||
|
|
0bf217ef36 | ||
|
|
f2712d8cfb | ||
|
|
bb32e7adb4 | ||
|
|
cadaec585b | ||
|
|
11c2f5014f | ||
|
|
2326489658 | ||
|
|
01ec08e20b | ||
|
|
69ebcc17e9 | ||
|
|
b86bdd7847 | ||
|
|
fbd7409851 | ||
|
|
0773c886ee | ||
|
|
d05c7268d9 | ||
|
|
80d0748edd | ||
|
|
fcbf228d35 | ||
|
|
34feb27bef | ||
|
|
86f707bc51 | ||
|
|
07f74f82b5 | ||
|
|
60917433d2 | ||
|
|
dd59e0704a | ||
|
|
d4bf472291 | ||
|
|
039b650953 | ||
|
|
0148860b2d | ||
|
|
49590c831f | ||
|
|
9aed0ce621 | ||
|
|
9b653a7c63 | ||
|
|
8d919d6ec8 | ||
|
|
bb0094038a | ||
|
|
c29764b164 | ||
|
|
ae55f5d605 | ||
|
|
81ca21517a | ||
|
|
24a4167296 | ||
|
|
3ffd967b00 | ||
|
|
a2a1f4806a | ||
|
|
6b56d7d1cd | ||
|
|
b5a802bf30 | ||
|
|
b4586779b3 | ||
|
|
d92d5a1b33 | ||
|
|
52ec080343 | ||
|
|
5bff61c2ee | ||
|
|
c12b713543 | ||
|
|
7bafa0f8c8 | ||
|
|
a47cdb9f35 | ||
|
|
bd9ac3b031 | ||
|
|
22ad45cd58 | ||
|
|
58e0b7704b | ||
|
|
b78854b8de | ||
|
|
ae61ed456f | ||
|
|
bdc1103641 | ||
|
|
689d19759d | ||
|
|
7f34b826b2 | ||
|
|
064d3765c0 | ||
|
|
752814a5fb | ||
|
|
861028ef5c | ||
|
|
dad0d8e559 | ||
|
|
75f88c539c | ||
|
|
1109650fde | ||
|
|
704f8d7e9d | ||
|
|
4a2c3d9098 | ||
|
|
d21b04acb5 | ||
|
|
5403336c78 | ||
|
|
def6d2bd5b | ||
|
|
04db2764c1 | ||
|
|
0e9b2250bd | ||
|
|
654d345d78 | ||
|
|
99e379392b | ||
|
|
1debd99701 | ||
|
|
a099070c79 | ||
|
|
0a09b8bd5a | ||
|
|
b3750dd24d | ||
|
|
db1b0c2516 | ||
|
|
fc6208b95d | ||
|
|
e68d3eac7d | ||
|
|
d093b446c2 | ||
|
|
be839051d5 | ||
|
|
8937068b5f | ||
|
|
3f82020100 | ||
|
|
63ee6bbc56 | ||
|
|
7046680765 | ||
|
|
c17334f17f | ||
|
|
ecd40231a5 | ||
|
|
c3935aafc9 | ||
|
|
9b751da31c | ||
|
|
b464d99bd5 | ||
|
|
f3d168f19f | ||
|
|
bb8fa94668 | ||
|
|
4f4d9fda0b | ||
|
|
24994fa387 | ||
|
|
f4bb745519 | ||
|
|
a03258999a | ||
|
|
3f45200cb9 | ||
|
|
4703e75003 | ||
|
|
39b166b87f | ||
|
|
ded21efe5f | ||
|
|
4952ddc494 | ||
|
|
8ffc9b6581 | ||
|
|
f0be6581b2 | ||
|
|
356217a6af | ||
|
|
9b5c86211b | ||
|
|
ef470bd890 | ||
|
|
428d75968c | ||
|
|
dca4b0a399 | ||
|
|
2380e1b013 | ||
|
|
9718445b44 | ||
|
|
7f897440b7 | ||
|
|
5b21074b9d | ||
|
|
b0714075eb | ||
|
|
956b56a772 | ||
|
|
50b2093548 | ||
|
|
bc5ca28b13 | ||
|
|
653a62b5e4 | ||
|
|
08780e1a5c | ||
|
|
ce39355025 | ||
|
|
3eed987488 | ||
|
|
6f633700ae | ||
|
|
a7670829d5 | ||
|
|
6fb8817391 | ||
|
|
e90b7276cb | ||
|
|
a1ba5fec2b | ||
|
|
6606211233 | ||
|
|
b1daacc9fb | ||
|
|
03fe7d9ea2 | ||
|
|
2d3da163a8 | ||
|
|
49c59764ac | ||
|
|
06cc59b7a3 | ||
|
|
7754080323 | ||
|
|
ebf081e273 | ||
|
|
258467467b | ||
|
|
bbea7e787f | ||
|
|
4f468cace7 | ||
|
|
b2f736adf5 | ||
|
|
9ddedbe752 | ||
|
|
63b237114a | ||
|
|
29c789dcf3 | ||
|
|
59e2ae552e | ||
|
|
9d396a5cfa | ||
|
|
422557d4ce | ||
|
|
04ebbcc3a9 | ||
|
|
0919e9d560 | ||
|
|
8af14edf21 | ||
|
|
13c475d73c | ||
|
|
1373af6f66 | ||
|
|
291ad2906d | ||
|
|
be5532b35d | ||
|
|
b2402aad2e | ||
|
|
3b46e44e4f | ||
|
|
537ec30936 | ||
|
|
a75db02d05 | ||
|
|
4698f1be5c | ||
|
|
1db103e352 | ||
|
|
5037a1182f | ||
|
|
6b476fa75f | ||
|
|
4d46000ec6 | ||
|
|
56ad6b4c0d | ||
|
|
ab750b6e75 | ||
|
|
44a4a858fe | ||
|
|
74fb59640d | ||
|
|
797bfaaf3d | ||
|
|
0015a4357e | ||
|
|
dbdc15f21f | ||
|
|
c9236527e4 | ||
|
|
1a8c72d721 | ||
|
|
739ef487fa | ||
|
|
b7273bc4f2 | ||
|
|
c3e9452fdc | ||
|
|
a4e34caa5d | ||
|
|
fea2f0ba1e | ||
|
|
b98427472f | ||
|
|
bf42822626 | ||
|
|
b71eb465cb | ||
|
|
f072638c8c | ||
|
|
79afcd4b65 | ||
|
|
595482048c | ||
|
|
2c99da538e | ||
|
|
1393e60ca8 | ||
|
|
2e67c704f7 | ||
|
|
c0410131bf | ||
|
|
473a305e5f | ||
|
|
d53ca6cd90 | ||
|
|
bd84babecd | ||
|
|
1b83231b1c | ||
|
|
f39ad34057 | ||
|
|
942b64052d | ||
|
|
559aabd6b8 | ||
|
|
52d26f9fb6 | ||
|
|
b7d124ce8d | ||
|
|
6a5c70ee6a | ||
|
|
a76b41b737 | ||
|
|
2fc6553203 | ||
|
|
98b003e601 | ||
|
|
0dda443cc8 | ||
|
|
9322283cb1 | ||
|
|
95d412c78d | ||
|
|
6245b15d8f | ||
|
|
ab1d7ba6cb | ||
|
|
ef05491991 | ||
|
|
113642c8f5 | ||
|
|
088dd98e0d | ||
|
|
7e0046a715 | ||
|
|
1a11d5df35 | ||
|
|
57b5b319a7 | ||
|
|
0a4672c050 | ||
|
|
8808b651e2 | ||
|
|
e9fca757b7 | ||
|
|
98a3801f6a | ||
|
|
82dfcdd5df | ||
|
|
e97c49a032 | ||
|
|
0335b344a1 | ||
|
|
63b7bed61a | ||
|
|
44b9946bb0 | ||
|
|
6efd4023fd | ||
|
|
49ecfd6879 | ||
|
|
4d4b5967da | ||
|
|
a882e37d04 | ||
|
|
4734d23e29 | ||
|
|
b7416da26d | ||
|
|
36e768ab37 | ||
|
|
ede0bd8623 | ||
|
|
b4072eb62d | ||
|
|
120b69c439 | ||
|
|
b68daf3f3e | ||
|
|
c32a1a5e5b | ||
|
|
a5e303d1ca | ||
|
|
c4d8cef44d | ||
|
|
72fbe758b4 | ||
|
|
3344bb3254 | ||
|
|
6b9ab7163a | ||
|
|
563092cffb | ||
|
|
9a2a0c3b0e | ||
|
|
f3b4726b34 | ||
|
|
30d7c6edf1 | ||
|
|
f33f73d2f5 | ||
|
|
b595dfd443 | ||
|
|
a3e15b5c76 | ||
|
|
31d85c0221 | ||
|
|
124bd55e18 | ||
|
|
bb9b5b5bde | ||
|
|
f586e6dd29 | ||
|
|
c2b1b67b6b | ||
|
|
2cb29233c8 | ||
|
|
b0e0bebb7e | ||
|
|
364b3567fc | ||
|
|
b5ea2127d9 | ||
|
|
9522a51dc7 | ||
|
|
75335a8a01 | ||
|
|
0bf561e326 | ||
|
|
7e6c2c2a7c | ||
|
|
b132d490f0 | ||
|
|
3fde0fc209 | ||
|
|
24bc09796f | ||
|
|
758bff79d6 | ||
|
|
3b0660799b | ||
|
|
6880afa73c | ||
|
|
01aae065ff | ||
|
|
8ee49edef0 | ||
|
|
e09f6c7886 | ||
|
|
dd0a7207d5 | ||
|
|
17700a6537 | ||
|
|
949444f6dd | ||
|
|
31832ac230 | ||
|
|
33200f8208 | ||
|
|
893cd17c1a | ||
|
|
c471ddd12f | ||
|
|
b0ac8f89c5 | ||
|
|
a47338d8b7 | ||
|
|
76d00ab47f | ||
|
|
22b8552939 | ||
|
|
1d25a04377 | ||
|
|
52148f69c1 | ||
|
|
f280f8138d | ||
|
|
530846bc7a | ||
|
|
27adde7af0 | ||
|
|
e3869a201f | ||
|
|
745a356c87 | ||
|
|
b16a4a1343 | ||
|
|
36e41555ea | ||
|
|
3f824cf205 | ||
|
|
c61b3c2f29 | ||
|
|
fd97cfbd15 | ||
|
|
4b4c293008 | ||
|
|
69a573a279 | ||
|
|
c33d4d989e | ||
|
|
3cd1134973 | ||
|
|
4f42d4dc4f | ||
|
|
a3b4aecded | ||
|
|
534ae6aa81 | ||
|
|
7e1e50ffde | ||
|
|
ab3cbb113e | ||
|
|
1c7e6af1fc | ||
|
|
84f7e25c5e | ||
|
|
458fe97b75 | ||
|
|
31364607f5 | ||
|
|
56ec2c7ebc | ||
|
|
f944d91d62 | ||
|
|
2cf7d89581 | ||
|
|
91546700d4 | ||
|
|
a972aec9b0 | ||
|
|
6328575639 | ||
|
|
af534c9209 | ||
|
|
82a1e920e0 | ||
|
|
d46d292865 | ||
|
|
1a96533a3c | ||
|
|
2d86054fe8 | ||
|
|
50e3af7b82 | ||
|
|
27af4b926b | ||
|
|
1d035acb6d | ||
|
|
3704c321fa | ||
|
|
9c6f35f3bd | ||
|
|
47b49c3e03 | ||
|
|
7a99261979 | ||
|
|
8eda58825f | ||
|
|
6ee43c0014 | ||
|
|
bea3d58ddb | ||
|
|
71b121c15c | ||
|
|
7c8b6d2fe6 | ||
|
|
5d33c46e6b | ||
|
|
8aac0ebdb6 | ||
|
|
6072aae338 | ||
|
|
872b916d46 | ||
|
|
86303b58df | ||
|
|
78b1ad6df6 | ||
|
|
e5ac7ee607 | ||
|
|
480b32b5af | ||
|
|
8c9cf09bd8 | ||
|
|
7ceea17050 | ||
|
|
76333c5a24 | ||
|
|
85857a3319 | ||
|
|
5ad2bb4bea | ||
|
|
cb9d205336 | ||
|
|
e1a292ba33 | ||
|
|
fa4e54b32e | ||
|
|
3ba41ac458 | ||
|
|
2fbe85e60f | ||
|
|
676a518fa8 | ||
|
|
992c1923f6 | ||
|
|
a22afdd0f6 | ||
|
|
0da8625f30 | ||
|
|
4cc784eb95 | ||
|
|
ee3bec9eed | ||
|
|
24788ac86f | ||
|
|
9af3c732b5 | ||
|
|
e5873fe5f9 | ||
|
|
39f088cdcd | ||
|
|
e805852721 | ||
|
|
e136ecc1f8 | ||
|
|
efa4001440 | ||
|
|
52a0af1636 | ||
|
|
5fc66b5896 | ||
|
|
80dec29832 | ||
|
|
2c7d3c9971 | ||
|
|
30a16e9496 | ||
|
|
0d6526ea31 | ||
|
|
4428340fd9 | ||
|
|
900ce21445 | ||
|
|
68c20ed48d | ||
|
|
c5760ceaab | ||
|
|
8c7c9a67a6 | ||
|
|
efad5545de | ||
|
|
afb411dd35 | ||
|
|
fe1184b0d3 | ||
|
|
85231b314f | ||
|
|
210b2efd47 | ||
|
|
ae5b1385ea | ||
|
|
011ce28251 | ||
|
|
efb58b45df | ||
|
|
7d033787eb | ||
|
|
3a47583cf9 | ||
|
|
565b4b3f2f | ||
|
|
574f32a6dd | ||
|
|
0e67c8ff69 | ||
|
|
b886073c11 | ||
|
|
57c35b9a74 | ||
|
|
f5100694d6 | ||
|
|
3ff9bfcc13 | ||
|
|
6c8d2bfd9e | ||
|
|
637f7f48ad | ||
|
|
8eae80d30f | ||
|
|
9a103276e3 | ||
|
|
6386f011f7 | ||
|
|
742d6e63d9 | ||
|
|
f6141603ef | ||
|
|
7a5b4e565a | ||
|
|
373e1527c1 | ||
|
|
9cb05b6a7d | ||
|
|
74bf5ff044 | ||
|
|
0f7e9d11b6 | ||
|
|
5fadc2fb9f | ||
|
|
96bbcf623f | ||
|
|
89e853158c | ||
|
|
5c31fcc03e | ||
|
|
3fee4a803b | ||
|
|
8b61f559d7 | ||
|
|
4bd058f5dc | ||
|
|
999ccf87fc | ||
|
|
4e45e885b9 | ||
|
|
6aee9ccaf1 | ||
|
|
af3c6ff012 | ||
|
|
0c9bdf5168 | ||
|
|
82a9587b4f | ||
|
|
850f4d7ec5 | ||
|
|
8d1dcc4568 | ||
|
|
3650ab85df | ||
|
|
e1e1cc2666 | ||
|
|
79fd32088b | ||
|
|
458e0fc76d | ||
|
|
5090c81632 | ||
|
|
dcd035353b | ||
|
|
8606ce21bd | ||
|
|
72537c6ffb | ||
|
|
30f9888f51 | ||
|
|
d5a2b92121 | ||
|
|
fd3eee6870 | ||
|
|
2d6d1003b7 | ||
|
|
499c590f5a | ||
|
|
787b78ef36 | ||
|
|
88a0b0fa23 | ||
|
|
1519f04930 | ||
|
|
e0a1291de0 | ||
|
|
8a2d881002 | ||
|
|
4802b6f460 | ||
|
|
8c0e116a1c | ||
|
|
8862878011 | ||
|
|
bdf3361243 | ||
|
|
6b5216077b | ||
|
|
7e119f7963 | ||
|
|
933cbc7e51 | ||
|
|
65f30d4480 | ||
|
|
1f8d3f119e | ||
|
|
45fe858503 | ||
|
|
0cc06ad186 | ||
|
|
18cd7547ad | ||
|
|
7746a26062 | ||
|
|
a47fc9d3be | ||
|
|
8fdf75330c | ||
|
|
d6ebaa26b0 | ||
|
|
27bd7ec836 | ||
|
|
6752058922 | ||
|
|
b965108dad | ||
|
|
6bf0f36567 | ||
|
|
69f1a70968 | ||
|
|
47edfcac5e | ||
|
|
c34599b954 | ||
|
|
48b371c985 | ||
|
|
47165e7b9d | ||
|
|
69f4611552 | ||
|
|
31a25449a8 | ||
|
|
26a247c0bf | ||
|
|
1c7cd23475 | ||
|
|
296ef1bdf9 | ||
|
|
f2a0408801 | ||
|
|
642659bc9b | ||
|
|
f0e8d065b7 | ||
|
|
520d852c04 | ||
|
|
8d4d7a421a | ||
|
|
802b83b0fe | ||
|
|
7ccb6c8411 | ||
|
|
1518831f37 | ||
|
|
3bdfaa02e1 | ||
|
|
e8de9f915c | ||
|
|
31f598d1e1 | ||
|
|
46e6fd0847 | ||
|
|
1441a60f4b | ||
|
|
ebdf107946 | ||
|
|
38d672c9f9 | ||
|
|
75d34abd45 | ||
|
|
1d98738e4d | ||
|
|
3cfa0e1844 | ||
|
|
82211a4373 | ||
|
|
e324b04a94 | ||
|
|
49d0c51d97 | ||
|
|
fe4bc3b4a9 | ||
|
|
58d964063c | ||
|
|
17d3e37e1d | ||
|
|
54f6a16bd6 | ||
|
|
f4ffc5d198 | ||
|
|
3d8010bf88 | ||
|
|
ec2cc3a7f9 | ||
|
|
52b7b9bcd8 | ||
|
|
8ad0fcf42d | ||
|
|
aa6cc45988 | ||
|
|
da22b8297b | ||
|
|
798d82e941 | ||
|
|
ac8ac302ca | ||
|
|
22c3a73102 | ||
|
|
1222fdb043 | ||
|
|
78a50c2f53 | ||
|
|
6d261a7afa | ||
|
|
2e37292478 | ||
|
|
a4907ec9c8 | ||
|
|
992bfe73b6 | ||
|
|
c186254a7e | ||
|
|
1dc739f32c | ||
|
|
9804cd83a6 | ||
|
|
aa5b99c47a | ||
|
|
f95f5e8901 | ||
|
|
206b303407 | ||
|
|
751bff53ee | ||
|
|
b6ef0c509d | ||
|
|
30304d6836 | ||
|
|
f5df49b139 | ||
|
|
bf8ba1a49b | ||
|
|
9f2697658b | ||
|
|
36fd59b92c | ||
|
|
88d946546a | ||
|
|
6036c0c262 | ||
|
|
20e831b56a | ||
|
|
72b74e075c | ||
|
|
3c6ede2f8f | ||
|
|
5434edbd54 | ||
|
|
6a8c7e4b17 | ||
|
|
0ac659f2d1 | ||
|
|
7eae40ca9a | ||
|
|
b3d12c8b58 | ||
|
|
3f92dba1b7 | ||
|
|
0aedc08cfa | ||
|
|
8312f5cffd | ||
|
|
9f6338441e | ||
|
|
27efe0c9d6 | ||
|
|
b5bf6c08d8 | ||
|
|
e3fce51ea1 | ||
|
|
13b4e93bf4 | ||
|
|
4ec0ab281f | ||
|
|
39c96019b6 | ||
|
|
21f2f60355 | ||
|
|
0de654dcaf | ||
|
|
d59e472814 | ||
|
|
cc2ed452f0 | ||
|
|
d4d3843725 | ||
|
|
dee16da1c2 | ||
|
|
e09b85870f | ||
|
|
8596911a0e | ||
|
|
6c2de9f151 | ||
|
|
d3a6b1e39e | ||
|
|
3cb9b19aea | ||
|
|
86aa59bb29 | ||
|
|
c6eeaed7da | ||
|
|
edba90f188 | ||
|
|
26b49b1a0c | ||
|
|
ef32648ddc | ||
|
|
c873524cb1 | ||
|
|
7943e34bde | ||
|
|
74970c74b4 | ||
|
|
2d11561041 | ||
|
|
f7643b6bb3 | ||
|
|
d3afd83e8e | ||
|
|
969ca0119a | ||
|
|
722431f5b2 | ||
|
|
6a1c792cda | ||
|
|
c0ba39ab40 | ||
|
|
3e0e08c5e1 | ||
|
|
3d64373c22 | ||
|
|
2557688657 | ||
|
|
fcc564df25 | ||
|
|
4ecbb93d01 | ||
|
|
9bdc9b3634 | ||
|
|
f46c3b0aa9 | ||
|
|
095fdf07c5 | ||
|
|
648e988b64 | ||
|
|
b1add735d6 | ||
|
|
3f5882118e | ||
|
|
4e83f56696 | ||
|
|
ab250f1d9c | ||
|
|
4672dece51 | ||
|
|
a632de9214 | ||
|
|
e8ebba8b3d | ||
|
|
5cf8181474 | ||
|
|
a717e4785d | ||
|
|
16ce16c632 | ||
|
|
8d7bf2661a | ||
|
|
9e1b026a88 | ||
|
|
df8e455a6d | ||
|
|
b35bec2839 | ||
|
|
19365effa9 | ||
|
|
3750417323 | ||
|
|
d7bfb1ff10 | ||
|
|
1797771527 | ||
|
|
e564eb5878 | ||
|
|
9cd620af58 | ||
|
|
1414ef8a4f | ||
|
|
110623f6ef | ||
|
|
0887c72486 | ||
|
|
a516fd880e | ||
|
|
50e15112d6 | ||
|
|
8b6f99385a | ||
|
|
2d1b40f00c | ||
|
|
2fc2f30055 | ||
|
|
2094a19723 | ||
|
|
5b1416424d | ||
|
|
8b9e737c05 | ||
|
|
cc0f4acec6 | ||
|
|
30884162a0 | ||
|
|
f1e7a8c444 | ||
|
|
3271939c87 | ||
|
|
c9cb487cbc | ||
|
|
56f6b69adf | ||
|
|
77dcee1269 | ||
|
|
c9068ee4d1 | ||
|
|
e7addf7fa8 | ||
|
|
7cc0a8db92 | ||
|
|
bccb62a84f | ||
|
|
d47570664b | ||
|
|
a7137558cc | ||
|
|
0251c5a33d | ||
|
|
365722ef7e | ||
|
|
77e0c30e57 | ||
|
|
8a0cad765a | ||
|
|
272378b800 | ||
|
|
a34d17ff95 | ||
|
|
82c782e9f0 | ||
|
|
b7b46d2fee | ||
|
|
8916f0f314 | ||
|
|
8d727ef508 | ||
|
|
fd0be10492 | ||
|
|
a810f95101 | ||
|
|
8857545cf0 | ||
|
|
2300c0005f | ||
|
|
827b91286f | ||
|
|
4d8e35655d | ||
|
|
f7e6ae9f3c | ||
|
|
67679843b4 | ||
|
|
b67b072be2 | ||
|
|
d6896e4e76 | ||
|
|
f86c24a695 | ||
|
|
b200c842b4 | ||
|
|
c8df52a86c | ||
|
|
b17a592c95 | ||
|
|
f71d6c7fab | ||
|
|
30cfae91c0 | ||
|
|
5332128852 | ||
|
|
b593d90dff | ||
|
|
02fac3b931 | ||
|
|
446ffc3602 | ||
|
|
44c1a2e139 | ||
|
|
f6cb04c7ef | ||
|
|
276755ae9d | ||
|
|
6ee0b821cc | ||
|
|
72dc121fcd | ||
|
|
786c4dc817 | ||
|
|
c7cfbaed0a | ||
|
|
4351d5c366 | ||
|
|
ff3795798f | ||
|
|
45281adfd9 | ||
|
|
0d813afc67 | ||
|
|
e9e5c77cd3 | ||
|
|
4d4bcbb365 | ||
|
|
bd5a2976fd | ||
|
|
cc6488ee2d | ||
|
|
52068198a5 | ||
|
|
5cdcd9d4d4 | ||
|
|
fbeaa35d10 | ||
|
|
1ac4bb38be | ||
|
|
69c2a096ab | ||
|
|
3dccf1b215 | ||
|
|
035cb02362 | ||
|
|
43d33a4502 | ||
|
|
2b6e8dc566 | ||
|
|
6388cc0639 | ||
|
|
00bd6d2e3a | ||
|
|
1f842b6d31 | ||
|
|
954d7bd14c | ||
|
|
d358893579 | ||
|
|
3cb40cb09d | ||
|
|
a4a8faedbb | ||
|
|
c32fa2b53f | ||
|
|
1d0b1791c4 | ||
|
|
7251c8976d | ||
|
|
684531aaae | ||
|
|
4a1504f9e0 | ||
|
|
ee1a6bbbd9 | ||
|
|
52c86d8c27 | ||
|
|
07e59536f3 | ||
|
|
63f31b9b01 | ||
|
|
4b6bf1bb9f | ||
|
|
f03c202b46 | ||
|
|
eb8a4a0e6a | ||
|
|
c04b04f701 | ||
|
|
2a0833e3b5 | ||
|
|
6acc89331d | ||
|
|
35afd9b92f | ||
|
|
c16d83ceab | ||
|
|
a7820f4fd0 | ||
|
|
12dd338914 | ||
|
|
720d552a21 | ||
|
|
a0477f499b | ||
|
|
20a4639995 | ||
|
|
3d7a0e7917 | ||
|
|
c9c1295001 | ||
|
|
c93daf78f6 | ||
|
|
c77812d2a8 | ||
|
|
c7107b7ad7 | ||
|
|
a9a28b259f | ||
|
|
5f1a1d0aa0 | ||
|
|
2f5dd3f2b1 | ||
|
|
779909bdeb | ||
|
|
e76bee2afa | ||
|
|
bb9d551dad | ||
|
|
db6399f1c5 | ||
|
|
32ee6be7f9 | ||
|
|
33a5dd9e1c | ||
|
|
0c59182eb8 | ||
|
|
391e14a05b | ||
|
|
c3259faf42 | ||
|
|
f588e473a1 | ||
|
|
a076b4d71c | ||
|
|
4540c75498 | ||
|
|
239199462f | ||
|
|
b703a7eabb | ||
|
|
3cafe72f8f | ||
|
|
48375c37de | ||
|
|
f9ceb506d7 | ||
|
|
a7a054f4e4 | ||
|
|
f8781353a2 | ||
|
|
b0760222f0 | ||
|
|
66bcacc2c4 | ||
|
|
5868f8a2a5 | ||
|
|
8e54e24e03 | ||
|
|
f511e6ea34 | ||
|
|
6c9608a9ee | ||
|
|
4a0f95f0f0 | ||
|
|
e3e7bcffa0 | ||
|
|
9340208c2c | ||
|
|
a658b8d8bd | ||
|
|
0b9946eaf9 | ||
|
|
6ea255f125 | ||
|
|
0225975e20 | ||
|
|
af406c7d14 | ||
|
|
a146e2c303 | ||
|
|
f285051a9a | ||
|
|
936f7e5d7c | ||
|
|
463c8defa4 | ||
|
|
19f0399f28 | ||
|
|
05436427ee | ||
|
|
2f6d4c9ff2 | ||
|
|
64790c531e | ||
|
|
9c209d2fb2 | ||
|
|
8420ca355b | ||
|
|
0aebcbd71e | ||
|
|
13528667c8 | ||
|
|
3b3fa3a455 | ||
|
|
13d3d4e990 | ||
|
|
b69d475e15 | ||
|
|
b6f840aacb | ||
|
|
ea454d3c07 | ||
|
|
fb72d5d782 | ||
|
|
d4b8c09b02 | ||
|
|
254339037b | ||
|
|
800e3a3012 | ||
|
|
44a5021786 | ||
|
|
db80629cbb | ||
|
|
1c3a1c132b | ||
|
|
751831f3b7 | ||
|
|
d226d58e38 | ||
|
|
230364ac87 | ||
|
|
9df61bba7e | ||
|
|
9ee1910a01 | ||
|
|
46e10e1599 | ||
|
|
ed29f7c1db | ||
|
|
60f4c7b02e | ||
|
|
5616723fa4 | ||
|
|
724698df08 | ||
|
|
9bdb99d948 | ||
|
|
efc340a37a | ||
|
|
58548a39d3 | ||
|
|
638a205b6c | ||
|
|
3031dbc600 | ||
|
|
36dcb53e14 | ||
|
|
1a94f4f12f | ||
|
|
d87a241e34 | ||
|
|
ddd28c9a44 | ||
|
|
9637edf30e | ||
|
|
b0a5e6d375 | ||
|
|
6bec99b631 | ||
|
|
a95b65067d | ||
|
|
ac5c176deb | ||
|
|
5d385eb26d | ||
|
|
611620555f | ||
|
|
d44412c712 | ||
|
|
761719fffd | ||
|
|
3015a4a8a2 | ||
|
|
e8f579bf74 | ||
|
|
f8da48f61d | ||
|
|
5b21015f5b | ||
|
|
326d62d815 | ||
|
|
f5f6c92e59 | ||
|
|
b56654c217 | ||
|
|
f5e8572a73 | ||
|
|
95a395ed70 | ||
|
|
c08c122ea6 | ||
|
|
95460df473 | ||
|
|
ab489faa56 | ||
|
|
48e49fe92d | ||
|
|
441a296bde | ||
|
|
7359ed74ad | ||
|
|
dd56ec6b4c | ||
|
|
2d271008f3 | ||
|
|
d06340ac3c | ||
|
|
f9a67c5180 | ||
|
|
b4cce0980a | ||
|
|
4a7557c5ba | ||
|
|
4e84f056aa | ||
|
|
68f938d476 | ||
|
|
6a7135d2bc | ||
|
|
58ab3ab1bb | ||
|
|
78beef71ce | ||
|
|
b05892e97d | ||
|
|
f71e24d17e | ||
|
|
3968e7741f | ||
|
|
aa75245d79 | ||
|
|
e8c97ba6bf | ||
|
|
27bbae3ccd | ||
|
|
305c03458a | ||
|
|
8143114a86 | ||
|
|
a39a56cd39 | ||
|
|
c1c076830a | ||
|
|
d3d63395b3 | ||
|
|
5a9a53d235 | ||
|
|
b7e37aeb20 | ||
|
|
a86ef05d52 | ||
|
|
1be2d9affc | ||
|
|
43e9469546 | ||
|
|
23bb0679dd | ||
|
|
04c41414da | ||
|
|
3490d83ce6 | ||
|
|
13fc780287 | ||
|
|
f0c234a5de | ||
|
|
7f8050e645 | ||
|
|
e8b27724c9 | ||
|
|
327cd2c524 | ||
|
|
1366e859be | ||
|
|
17b779b494 | ||
|
|
7e30b7c7a7 | ||
|
|
b1b8c49c43 | ||
|
|
876c35c212 | ||
|
|
e758e3d457 | ||
|
|
91e7bfce1d | ||
|
|
2e6c53fb52 | ||
|
|
510edeb9a6 | ||
|
|
8566e7bf46 | ||
|
|
7dfea2feb6 | ||
|
|
fcb9de1930 | ||
|
|
2c7a3b877c | ||
|
|
e4ae7f8566 | ||
|
|
94f8544dfa | ||
|
|
0159155e1c | ||
|
|
b45e32dd3f | ||
|
|
f3d66b3356 | ||
|
|
f21190cb24 | ||
|
|
9554eb0990 | ||
|
|
9c04525df8 | ||
|
|
26555c6ad6 | ||
|
|
d6ee29dc91 | ||
|
|
e6dacd0b84 | ||
|
|
acf75ad080 | ||
|
|
92067b2577 | ||
|
|
24f197ce99 | ||
|
|
39cc7db50b | ||
|
|
510a6d12a7 | ||
|
|
cb8c1ea4b5 | ||
|
|
3284102dde | ||
|
|
4a5457ad49 | ||
|
|
39ed9265d7 | ||
|
|
2fc721f220 | ||
|
|
28c658810f | ||
|
|
2f2ecc252e | ||
|
|
9f2613c56a | ||
|
|
a58929d4fb | ||
|
|
fa13be1e15 | ||
|
|
7a4d900b06 | ||
|
|
421ce832dd | ||
|
|
987781f826 | ||
|
|
d85a41ea98 | ||
|
|
42f86a3f73 | ||
|
|
0241b58777 | ||
|
|
97a2c73efe | ||
|
|
5f1e46ca82 | ||
|
|
805779144e | ||
|
|
c65e21708c | ||
|
|
08e546b677 | ||
|
|
11cf8454ad | ||
|
|
c3494803dc | ||
|
|
c84496b942 | ||
|
|
c4eb8e5752 | ||
|
|
7702d3a695 | ||
|
|
fbff8ed2c0 | ||
|
|
5b5b6188da | ||
|
|
6a1707a7e6 | ||
|
|
b625fd3df9 | ||
|
|
ffaf2cc451 | ||
|
|
dcc9b5a37e | ||
|
|
1b4a51f770 | ||
|
|
f8d2ee2dd7 | ||
|
|
348d88d543 | ||
|
|
38b859e555 | ||
|
|
ca8026f612 | ||
|
|
befcf4298f | ||
|
|
2e0bbcc75d | ||
|
|
2204fe6451 | ||
|
|
12bc68bc02 | ||
|
|
290370f744 | ||
|
|
79acef46ce | ||
|
|
0054eb5279 | ||
|
|
e0eb919e51 | ||
|
|
7c3d5a7946 | ||
|
|
38cb20d1bd | ||
|
|
505fcf5b31 | ||
|
|
d744d45ccd | ||
|
|
2e2e7a7df6 | ||
|
|
db5ff05bb3 | ||
|
|
566273fe83 | ||
|
|
decb17e665 | ||
|
|
46c27bbd10 | ||
|
|
72f98cef14 | ||
|
|
0f8cfa289d | ||
|
|
0cb420c557 | ||
|
|
79df0b0594 | ||
|
|
dfbddb4050 | ||
|
|
0f88495f29 | ||
|
|
2b31ef3f16 | ||
|
|
8fa6bc1b69 | ||
|
|
f485b1eb50 | ||
|
|
8515eac900 | ||
|
|
d9e068f794 | ||
|
|
ed5358a6d6 | ||
|
|
7b6163c968 | ||
|
|
c4927372ec | ||
|
|
f3cd21009b | ||
|
|
a71c75b53e | ||
|
|
d95f67748c | ||
|
|
e11bf264b5 | ||
|
|
db382816f5 | ||
|
|
01732eb443 | ||
|
|
fc9605565a | ||
|
|
7d018760ca | ||
|
|
d52679eae8 | ||
|
|
aa9c317831 | ||
|
|
44b280962f | ||
|
|
6a90f95712 | ||
|
|
910c51004d | ||
|
|
bdb05d1dee | ||
|
|
abc68eb900 | ||
|
|
5a50c9e5ac | ||
|
|
1d15417a83 | ||
|
|
233d318e48 | ||
|
|
a0c52f017c | ||
|
|
f89d824367 | ||
|
|
d5daf5de67 | ||
|
|
49459b2d81 | ||
|
|
c495f5ccdf | ||
|
|
25e631aa73 | ||
|
|
6c2dc0a048 | ||
|
|
13f2ad34fc | ||
|
|
fde7764759 | ||
|
|
fa96e5d530 | ||
|
|
d7d963ebed | ||
|
|
591317ebbe | ||
|
|
a67a717b34 | ||
|
|
b042328b3b | ||
|
|
0374dba8f0 | ||
|
|
9089517868 | ||
|
|
ef7a1eb323 | ||
|
|
ae819000e7 | ||
|
|
56223d51a6 | ||
|
|
a75d6ca01a | ||
|
|
b03e542a33 | ||
|
|
98a4a05155 | ||
|
|
64a69a2060 | ||
|
|
4f6b6adf39 | ||
|
|
d77ebbc7f1 | ||
|
|
0eeba4eeaf | ||
|
|
15f61c1667 | ||
|
|
daf6eccc83 | ||
|
|
7173df2062 | ||
|
|
bcf1cfaa27 | ||
|
|
68b9f27a30 | ||
|
|
722920f001 | ||
|
|
4952265b7e | ||
|
|
2d3baebdb9 | ||
|
|
6271060c94 | ||
|
|
1324c232d7 | ||
|
|
4b84469137 | ||
|
|
b09c1365c1 | ||
|
|
f3d1ddabb1 | ||
|
|
2203ae8c23 | ||
|
|
8a8c7c3cca | ||
|
|
db55808213 | ||
|
|
a95fb5e517 | ||
|
|
14733a1d6a | ||
|
|
669b16fe68 | ||
|
|
399c42d5e4 | ||
|
|
cd81ed8b15 | ||
|
|
59c5afa9ee | ||
|
|
2c8057cb39 | ||
|
|
18e2af740f | ||
|
|
51837c9e9e | ||
|
|
1195b3e507 | ||
|
|
1a3b35020c | ||
|
|
b608e05fe5 | ||
|
|
7ca90e97a1 | ||
|
|
6e6de46937 | ||
|
|
39aade79a0 | ||
|
|
2186945729 | ||
|
|
13fb42b736 | ||
|
|
c7855a98c4 | ||
|
|
de318dc975 | ||
|
|
5d7c578828 | ||
|
|
dd2837ebc6 | ||
|
|
7360f964b1 | ||
|
|
0bf4dc1dd8 | ||
|
|
c51b09acb1 | ||
|
|
a3f330f9d9 | ||
|
|
8f463c7a11 | ||
|
|
8199a8739f | ||
|
|
2f688704ef | ||
|
|
4e39cbd881 | ||
|
|
de3473b0a2 | ||
|
|
5c792fc542 | ||
|
|
054a4f9935 | ||
|
|
21df9a9ac6 | ||
|
|
e89e428217 | ||
|
|
a8fbafc4ab | ||
|
|
4ded6b0a79 | ||
|
|
44cb5c7d5c | ||
|
|
266f0202cd | ||
|
|
e14e4de469 | ||
|
|
de1705b85a | ||
|
|
f27081cfe4 | ||
|
|
b4f4bd5648 | ||
|
|
05043571dc | ||
|
|
536322427b | ||
|
|
e25fd643d2 | ||
|
|
3ed6ebde7b |
9
.editorconfig
Normal file
9
.editorconfig
Normal file
@@ -0,0 +1,9 @@
|
||||
root = true
|
||||
|
||||
[*.java]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
|
||||
[*.kt]
|
||||
indent_size = 2
|
||||
indent_style = space
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,4 +1,6 @@
|
||||
*.swp
|
||||
/.gradle/
|
||||
/.idea/
|
||||
/idea/
|
||||
/build/
|
||||
/out/
|
||||
/tmp/
|
||||
/tmp/
|
||||
299
AUTHORS.md
Normal file
299
AUTHORS.md
Normal file
@@ -0,0 +1,299 @@
|
||||
IdeaVim Authors
|
||||
===============
|
||||
|
||||
The original author:
|
||||
|
||||
* [![icon][mail]](mailto:rmaddy@maddyhome.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Rick Maddy
|
||||
|
||||
The current maintainers:
|
||||
|
||||
* [![icon][mail]](mailto:andrey.vlasovskikh@gmail.com)
|
||||
[![icon][github]](https://github.com/vlasovskikh)
|
||||
|
||||
Andrey Vlasovskikh
|
||||
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||
[![icon][github]](https://github.com/AlexPl292)
|
||||
|
||||
Alex Plate
|
||||
|
||||
Previous maintainers:
|
||||
|
||||
* [![icon][mail]](mailto:oleg.shpynov@jetbrains.com)
|
||||
[![icon][github]](https://github.com/olegs)
|
||||
|
||||
Oleg Shpynov
|
||||
|
||||
Contributors:
|
||||
* [![icon][mail]](mailto:yole@jetbrains.com)
|
||||
[![icon][github]](https://github.com/yole)
|
||||
|
||||
Dmitry Jemerov
|
||||
* [![icon][mail]](mailto:marquis@marquiswang.com)
|
||||
[![icon][github]](https://github.com/marquiswang)
|
||||
|
||||
Marquis Wang
|
||||
* [![icon][mail]](mailto:madgnome@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Julien Hoarau
|
||||
* [![icon][mail]](mailto:masanobu.imai@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Masanobu Imai
|
||||
* [![icon][mail]](mailto:poxvuibr@gmail.com)
|
||||
[![icon][github]](https://github.com/poxu)
|
||||
|
||||
poxu
|
||||
* [![icon][mail]](mailto:alexander.zolotov@jetbrains.com)
|
||||
[![icon][github]](https://github.com/zolotov)
|
||||
|
||||
Alexander Zolotov
|
||||
* [![icon][mail]](mailto:johnlindquist@gmail.com)
|
||||
[![icon][github]](https://github.com/johnlindquist)
|
||||
|
||||
John Lindquist
|
||||
* [![icon][mail]](mailto:iklotzko@ltech.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Ira Klotzko
|
||||
* [![icon][mail]](mailto:alex@selesse.com)
|
||||
[![icon][github]](https://github.com/selesse)
|
||||
|
||||
Alex Selesse
|
||||
* [![icon][mail]](mailto:dbennett@palantir.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Dathan Bennett
|
||||
* [![icon][mail]](mailto:kphayen@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
salaam
|
||||
* [![icon][mail]](mailto:rasen.dubi@gmail.com)
|
||||
[![icon][github]](https://github.com/rasendubi)
|
||||
|
||||
Alexey Shmalko
|
||||
* [![icon][mail]](mailto:a.m.brookins@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Andrew Brookins
|
||||
* [![icon][mail]](mailto:changwang83@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Chang Wang
|
||||
* [![icon][mail]](mailto:josejaime.sanchez@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Jaime Sanchez
|
||||
* [![icon][mail]](mailto:thomas@homburg.dk)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Thomas B Homburg
|
||||
* [![icon][mail]](mailto:smartbomb@server.fake)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
smartbomb
|
||||
* [![icon][mail]](mailto:tuomas.tynkkynen@iki.fi)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Tuomas Tynkkynen
|
||||
* [![icon][mail]](mailto:jackson@donorschoose.org)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Jackson Popkin
|
||||
* [![icon][mail]](mailto:yuyuyu1999@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Teruo Kunihiro
|
||||
* [![icon][mail]](mailto:lubashka.994@mail.ru)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Liubov Paina
|
||||
* [![icon][mail]](mailto:me@dhleong.net)
|
||||
[![icon][github]](https://github.com/dhleong)
|
||||
|
||||
Daniel Leong
|
||||
* [![icon][mail]](mailto:aleksey@pri-num.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Aleksey Lagoshin
|
||||
* [![icon][mail]](mailto:pbu_98@yahoo.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Paulo Bu
|
||||
* [![icon][mail]](mailto:gaganis@yahoo.com)
|
||||
[![icon][github]](https://github.com/gaganis)
|
||||
|
||||
Giorgos Gaganis
|
||||
* [![icon][mail]](mailto:pavel.fatin@jetbrains.com)
|
||||
[![icon][github]](https://github.com/pavelfatin)
|
||||
|
||||
Pavel Fatin
|
||||
* [![icon][mail]](mailto:tietyt@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
tieTYT
|
||||
* [![icon][mail]](mailto:nickgieschen@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Nick Gieschen
|
||||
* [![icon][mail]](mailto:ikenox@gmail.com)
|
||||
[![icon][github]](https://github.com/ikenox)
|
||||
|
||||
Naoto Ikeno
|
||||
* [![icon][mail]](mailto:qzed@users.noreply.github.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Maximilian Luz
|
||||
* [![icon][mail]](mailto:vparfinenko@excelsior-usa.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Vladimir Parfinenko
|
||||
* [![icon][mail]](mailto:hassmann@hwdev.de)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Florian Hassmann
|
||||
* [![icon][mail]](mailto:jpalus@fastmail.com)
|
||||
[![icon][github]](https://github.com/jpalus)
|
||||
|
||||
Jan Palus
|
||||
* [![icon][mail]](mailto:kpetrov@ripe.net)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Konstantin Petrov
|
||||
* [![icon][mail]](mailto:ya-ikmik2012@yandex.ru)
|
||||
[![icon][github]](https://github.com/vasalf)
|
||||
|
||||
Vasily Alferov
|
||||
* [![icon][mail]](mailto:fkve97@gmail.com)
|
||||
[![icon][github]](https://github.com/karavaevitalii)
|
||||
|
||||
Vitalii Karavaev
|
||||
* [![icon][mail]](mailto:johnlinp@gmail.com)
|
||||
[![icon][github]](https://github.com/johnlinp)
|
||||
|
||||
John Lin
|
||||
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||
[![icon][github]](https://github.com/AlexPl292)
|
||||
|
||||
Alex Plate
|
||||
* [![icon][mail]](mailto:m.t.ellis@gmail.com)
|
||||
[![icon][github]](https://github.com/citizenmatt)
|
||||
|
||||
Matt Ellis
|
||||
* [![icon][mail]](mailto:johngrib82@gmail.com)
|
||||
[![icon][github]](https://github.com/johngrib)
|
||||
|
||||
John Grib
|
||||
* [![icon][mail]](mailto:hild@b4mad.net)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Marcel Hild
|
||||
* [![icon][mail]](mailto:vedranb@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Vedran Budimcic
|
||||
* [![icon][mail]](mailto:andreigasparovici1@gmail.com)
|
||||
[![icon][github]](https://github.com/andreigasparovici)
|
||||
|
||||
Andrei Gasparovici
|
||||
* [![icon][mail]](mailto:qtankle@gmail.com)
|
||||
[![icon][github]](https://github.com/dos65)
|
||||
|
||||
dos65
|
||||
* [![icon][mail]](mailto:ttonyarra@gmail.com)
|
||||
[![icon][github]](https://github.com/TonyArra)
|
||||
|
||||
Tony Arra
|
||||
* [![icon][mail]](mailto:bradziolko@gmail.com)
|
||||
[![icon][github]](https://github.com/bradziolko)
|
||||
|
||||
Brad Ziolko
|
||||
* [![icon][mail]](mailto:sumoooru2@gmail.com)
|
||||
[![icon][github]](https://github.com/sumoooru2)
|
||||
|
||||
sumoooru2
|
||||
* [![icon][mail]](mailto:aqwsedrft1234@yahoo.co.jp)
|
||||
[![icon][github]](https://github.com/gecko655)
|
||||
|
||||
gecko655
|
||||
* [![icon][mail]](mailto:megna.dany@gmail.com)
|
||||
[![icon][github]](https://github.com/danielemegna)
|
||||
|
||||
Daniele Megna
|
||||
* [![icon][mail]](mailto:apottere@gmail.com)
|
||||
[![icon][github]](https://github.com/apottere)
|
||||
|
||||
Andrew Potter
|
||||
* [![icon][mail]](mailto:romain.gautier@nimamoh.net)
|
||||
[![icon][github]](https://github.com/Nimamoh)
|
||||
|
||||
Romain Gautier
|
||||
* [![icon][mail]](mailto:elliot.courant@wheniwork.com)
|
||||
[![icon][github]](https://github.com/ECourant)
|
||||
|
||||
Elliot Courant
|
||||
* [![icon][mail]](mailto:simon.rainer@fau.de)
|
||||
[![icon][github]](https://github.com/Vvalter)
|
||||
|
||||
Simon Rainer
|
||||
* [![icon][mail]](mailto:mziwisky@instructure.com)
|
||||
[![icon][github]](https://github.com/mziwisky)
|
||||
|
||||
Michael Ziwisky
|
||||
* [![icon][mail]](mailto:pierce@plasticcow.com)
|
||||
[![icon][github]](https://github.com/thecodewarrior)
|
||||
|
||||
Pierce Corcoran
|
||||
* [![icon][mail]](mailto:jonatantierno@gmail.com)
|
||||
[![icon][github]](https://github.com/jonatantierno)
|
||||
|
||||
Jonatan Tierno
|
||||
* [![icon][mail]](mailto:brendan@annable.me)
|
||||
[![icon][github]](https://github.com/BrendanAnnable)
|
||||
|
||||
Brendan Annable
|
||||
* [![icon][mail]](mailto:nerd.naveen@gmail.com)
|
||||
[![icon][github]](https://github.com/NOLFXceptMe)
|
||||
|
||||
Naveen Kumar Molleti
|
||||
* [![icon][mail]](mailto:jorgen.granseth@bekk.no)
|
||||
[![icon][github]](https://github.com/jorgengranseth)
|
||||
|
||||
Jørgen Granseth
|
||||
* [![icon][mail]](mailto:rafal@hajdacki.com)
|
||||
[![icon][github]](https://github.com/hajdamak)
|
||||
|
||||
Rafał Hajdacki
|
||||
* [![icon][mail]](mailto:igrek+github@fastem.com)
|
||||
[![icon][github]](https://github.com/igrekster)
|
||||
|
||||
igrekster
|
||||
* [![icon][mail]](mailto:lokomot476@gmail.com)
|
||||
[![icon][github]](https://github.com/fan-tom)
|
||||
|
||||
Alexey Gerasimov
|
||||
* [![icon][mail]](mailto:a.grison+github@gmail.com)
|
||||
[![icon][github]](https://github.com/agrison)
|
||||
|
||||
Alexandre Grison
|
||||
* [![icon][mail]](mailto:angel@knight-industries.com)
|
||||
[![icon][github]](https://github.com/angelbot)
|
||||
|
||||
John Weigel
|
||||
* [![icon][mail]](mailto:kevinz@weghst.com)
|
||||
[![icon][github]](https://github.com/kevin70)
|
||||
|
||||
kk
|
||||
|
||||
If you are a contributor and your name is not listed here, feel free to
|
||||
contact the maintainers.
|
||||
|
||||
<a href="https://icons8.com">Icons by Icons8</a>
|
||||
|
||||
[mail]: resources/icons/mail.png
|
||||
[github]: resources/icons/github.png
|
||||
|
||||
[github-off]: resources/icons/github-off.png
|
||||
1109
CHANGES.md
Normal file
1109
CHANGES.md
Normal file
File diff suppressed because it is too large
Load Diff
433
CHANGES.txt
433
CHANGES.txt
@@ -1,433 +0,0 @@
|
||||
The Changelog
|
||||
=============
|
||||
|
||||
History of changes in IdeaVim for the IntelliJ platform.
|
||||
|
||||
|
||||
0.23.115, 2012-11-14
|
||||
--------------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
* VIM-318 Fixed executing editor commands for editors not bound to a project
|
||||
* VIM-321 Fixed IOOBE in delete empty range
|
||||
* VIM-112 Delete a single previous word with <C-W> in insert mode, not all inserted words
|
||||
|
||||
|
||||
0.23.111, 2012-11-12
|
||||
--------------------
|
||||
|
||||
A bugfix release.
|
||||
|
||||
* Register action for 'iW' selection
|
||||
* Vim compatible regexp substitutions for '\n' and '\r'
|
||||
* Index of supported commands covered with tests
|
||||
* VIM-276 T and F motions are exclusive, not inclusive
|
||||
* VIM-289 Fixed regexp substitute when the substitution contained newlines
|
||||
* VIM-185 Fixed NPE in KeyHandler.handleKey()
|
||||
* VIM-226 Added tests for the bug fixed together with VIM-146
|
||||
* VIM-146 Fixed handling of '$' in search and substitute commands
|
||||
* VIM-198 Fixed indexing bug in offset normalization
|
||||
* VIM-311 Test for single command sub-mode of insert mode
|
||||
* EA-33193 Fixed access to context data from different Swing events
|
||||
* Fixed command handling when motion expected, but another type of argument
|
||||
found
|
||||
|
||||
|
||||
0.23.93, 2012-03-21
|
||||
-------------------
|
||||
|
||||
A bugfix release. Vim.xml was fixed to use Command+C, Command+V on Mac OS.
|
||||
Unfortunately you need to update Vim.xml manually this time.
|
||||
|
||||
...
|
||||
|
||||
|
||||
Previous Releases
|
||||
-----------------
|
||||
|
||||
... from 0.8.4
|
||||
Bug Fixes
|
||||
- The Escape key is passed up to IDEA if not used by VIM first. This fix solves
|
||||
minor issues such as not being able to clear highlighted text using the
|
||||
Ctrl-Shift-F7, for example.
|
||||
- :quit command now works in all forms (e.g. :q, :qu, :qui, :quit).
|
||||
- Performing a change command while in visual mode now properly terminates
|
||||
visual mode.
|
||||
- Fixed internal error caused when trying to use visual mode with IDEA's
|
||||
"column mode".
|
||||
|
||||
0.8.3 from 0.8.2
|
||||
Bug Fixes
|
||||
- After a fresh install it is possible to get a NPE when loading the first
|
||||
project. Now fixed.
|
||||
- Fixed :class and :find. These were also broken by the focus fix in 0.7.2.
|
||||
- Fixed * and # commands on one letter words.
|
||||
- Fixed * and # commands on last word of line with trailing punctuation.
|
||||
- Fixed b and e commands when trying to move to first or last word of file and
|
||||
the first or last character of the file was punctuation.
|
||||
- Fixed NullPointerException appearing in system log when viewing a .form file.
|
||||
- Fixed extraneous characters getting added to a register during recording.
|
||||
- Use file type's indent size instead of tab size for indenting text.
|
||||
- Restore caret if plugin is disabled.
|
||||
- Fixed ability to delete blank line at end of files.
|
||||
|
||||
0.8.2 from 0.8.1
|
||||
- Fixed typo in plugin.xml for new 'since-build'
|
||||
|
||||
0.8.1 from 0.8.0
|
||||
Bug Fixes
|
||||
- Updated to show up in the plugin list for Pallada.
|
||||
- Fixed NullPointerException when using the :qall, :q, or :wq commands.
|
||||
- Fixed the :edit, :next, :previous, :argument, :first, and :last commands.
|
||||
These were broken by the focus fix in 0.7.2.
|
||||
|
||||
0.8.0 from 0.7.3
|
||||
New Features
|
||||
- Support for Pallada (IDEA 4.5)
|
||||
- Support for the hlsearch option and the :nohlsearch command. Now when a
|
||||
search is done, all matching text is highlighted. The highlight attributes
|
||||
are based on the "General|Search result" color setting. (Not for 4.0.x)
|
||||
- Support for aw, aW, iw, and iW while in visual mode or as arguments to the
|
||||
y, gu, gU, g~, c, d, and ! commands.
|
||||
|
||||
Bug Fixes
|
||||
- e and E while on the last word of a file didn't work.
|
||||
- b and B while on the first word of a file didn't work.
|
||||
|
||||
0.7.3 from 0.7.2
|
||||
|
||||
New Features
|
||||
- Added support for digraphs. Currently you can use Ctrl-k {char1}{char2} to
|
||||
enter a special character. This works while in Insert/Replace mode, as an
|
||||
argument to the r, F, T, f, and t commands, or while entering an ex command.
|
||||
The :digraphs command has been added to display the currently supported
|
||||
digraphs. Certain special cases of the Ctrl-K {char1}{char2} sequence are not
|
||||
supported. This supports all two character digraphs as listed in RFC1345.
|
||||
This amounts to 1,338 digraphs! Ensure the file encoding can handle the
|
||||
characters you enter.
|
||||
- Added support for the 'digraph' option. If set, digraphs may be entered using
|
||||
{char1} [BackSpace] {char2}. This works in Insert/Replace mode or while
|
||||
entering an ex command.
|
||||
- Added support for Ctrl-v {digits}. This works while in Insert/Replace mode,
|
||||
as an argument to the r, F, T, f, and t commands, or while entering an ex
|
||||
command.
|
||||
- A new Vim.xml keymap needs to be installed or Ctrl-K needs to be removed
|
||||
from all source control menus.
|
||||
|
||||
Bug Fixes
|
||||
- Fixed backspace in ex entry. Deleting the first character was closing the ex
|
||||
entry window.
|
||||
|
||||
0.7.2 from 0.7.1
|
||||
|
||||
Bug Fixes
|
||||
- Fixed c<motion and d<motion> exception if the motion was invalid.
|
||||
- Fixed focus problem with : and / and ? commands.
|
||||
- Fixed word motion on strings such as 1/2/3.
|
||||
- Fixed <count><word motion> which didn't always match doing <count>
|
||||
independent <word motion> commands.
|
||||
- Fixed <count>cw on strings such as 1/2/3.
|
||||
- Fixed <count>dw which could delete <count> lines instead.
|
||||
- The results of the :registers, :marks, and :set commands are now displayed
|
||||
properly. This "more" window hadn't been working for a while.
|
||||
- Fixed cursor position when issuing the O command on the first line.
|
||||
- The confirmation dialog used with the :s//c command now has a default button
|
||||
and mnemonics for all buttons.
|
||||
- A space is now properly allowed between the range and the command in a :
|
||||
command such as :1,2 co 4
|
||||
|
||||
0.7.1 from 0.7.0
|
||||
|
||||
Bug Fixes
|
||||
- Opening a non-text file resulted in some exceptions. This could happen when
|
||||
opening an image with the ImageViewer plugin.
|
||||
- Better handling of trying to edit a VCS controlled read-only file.
|
||||
- Properly handle multiple < or > in the :> and :< commands.
|
||||
- Fixed an exception and assertions when reopening a project.
|
||||
- Fixed cursor position problem when issuing a c<motion> command that changed
|
||||
text up to the end of line.
|
||||
- Using the C command on an empty file caused an error.
|
||||
- Changing the last word on the last line leaves cursor correctly.
|
||||
|
||||
0.7.0 from 0.6.5
|
||||
|
||||
New Features
|
||||
- Highlighting lines of code by clicking and/or dragging in the line number area
|
||||
now leaves you in visual line mode.
|
||||
- Undoing all changes in a file now correctly marks the file as unchanged if it
|
||||
hasn't been saved in the meantime.
|
||||
- All the :write commands (:w :wn :wN :wq) save just the one file now. To save
|
||||
all files use the :wall command.
|
||||
- Enhanced the :e command. Support for :e# and :e <filename> have been added.
|
||||
:e# selects the previous tab. :e <filename> will search the entire project
|
||||
and open the first matching file. Relative paths are supported too. :e with
|
||||
no argument will still bring up the File Open dialog.
|
||||
- Added support for the gP and gp commands.
|
||||
- Added support for the z+ and z^ commands.
|
||||
- Added :class command to bring up "Go To Class" dialog. If followed by a
|
||||
classname, open the corresponding Java file. Not in VIM.
|
||||
- Added :symbol command to bring up "Go To Symbol" dialog. Not in VIM.
|
||||
- Editors use block cursor for command mode and a vertical bar for
|
||||
insert/replace mode.
|
||||
- Better support for split view editing.
|
||||
- Text selection is reflected in all editors of a file.
|
||||
|
||||
Bug Fixes
|
||||
- Under certain conditions, highlighting text left you in multiple layers of
|
||||
visual mode. This is now fixed.
|
||||
- The gv command resulted in too much text being selected in many cases.
|
||||
- The gv command now properly restores the cursor position.
|
||||
- Fixed exception caused by using the :undo and :redo commands.
|
||||
- Re-enabled all the :write related commands. Hopefully the deadlock has been
|
||||
solved.
|
||||
- Fixed error referencing unknown class FileCloseAction.
|
||||
- Fixed several exceptions related to edit fields in dialog boxes.
|
||||
- Fixed some exceptions related to the undo manager.
|
||||
- Status was not always show proper mode.
|
||||
- r<Enter> now works as expected.
|
||||
- Toggling between insert and replace mode wasn't working properly.
|
||||
- The cursor wasn't always restored correctly after an undo.
|
||||
- Yanking the last line and then putting it elsewhere sometimes resulted in the
|
||||
old and new line not having a newline between them.
|
||||
- Repeating of o and O commands, including with count, works properly now.
|
||||
- dw, dW, and d[w now act like d$ if deleting the last word of a line.
|
||||
- cW now properly behaves like cE.
|
||||
|
||||
0.6.5 from 0.6.4
|
||||
|
||||
Support for Aurora build #1050 and higher.
|
||||
|
||||
0.6.4 from 0.6.3
|
||||
|
||||
Support for Aurora build #1035 and higher.
|
||||
|
||||
New Features
|
||||
- Added support for {, }, '{, '}, `{, and `} commands (previous and next
|
||||
paragraph).
|
||||
|
||||
Bug Fixes
|
||||
- Fixed cursor movement problem introduced in version 0.6.3.
|
||||
- Fixed issues with visual ranges introduced in version 0.6.3.
|
||||
- Fixed bug with cursor placement when clicking on a blank line.
|
||||
- Triple clicking text now properly puts the user in Visual Line mode.
|
||||
|
||||
Clean-up
|
||||
- Removed use of newly deprecated methods in Open API.
|
||||
- Some basic code cleanup.
|
||||
|
||||
0.6.3 from 0.6.2
|
||||
|
||||
Support for Aurora build #992 and higher.
|
||||
|
||||
0.6.2 from 0.6.1
|
||||
|
||||
Repackaged to install as a zip directory instead of a jar file. This provides
|
||||
better support for the new plugins repository.
|
||||
|
||||
0.6.1 from 0.6.0
|
||||
|
||||
Support for Aurora build #963.
|
||||
|
||||
Changed Features
|
||||
- Removed the VIM icon from the toolbar. This was only used to display status
|
||||
messages. Now display status messages in the IDEA status bar.
|
||||
|
||||
Bug Unfixes
|
||||
- Removed, again, support for :w related ex commands
|
||||
|
||||
0.6.0 from 0.4.1
|
||||
|
||||
Support for Aurora build #939. It may work with slightly older versions too.
|
||||
This version will not work with IDEA 3.x. For IDEA 3.x you must use IdeaVim
|
||||
versions prior to 0.6.0.
|
||||
|
||||
Bug Fixes
|
||||
- Put back file saving for the :w related ex commands
|
||||
|
||||
0.4.1 from 0.4.0
|
||||
|
||||
Bug Fixes
|
||||
- Fixed vim.xml for Windows. This file was getting deleted by Idea on Windows
|
||||
due to a mismatch in the case of the name.
|
||||
- The O command now properly indents the new line.
|
||||
- Fixed Null Pointer Exception when editing file templates.
|
||||
|
||||
Temporary Work-arounds
|
||||
- Disabled the saving of files when using any of the :w related commands until
|
||||
a fix can be found for the dead-lock bug. ZZ and ZQ still save files.
|
||||
|
||||
0.4.0 from 0.3.2
|
||||
|
||||
New Features
|
||||
- A VIM tool window has been added. This is used to show the current mode (if
|
||||
:set showmode is set) and any messages normally shown on the last line in
|
||||
VIM. To make this useful you should do the following:
|
||||
- Show the VIM tool window.
|
||||
- Make the VIM tool window docked.
|
||||
- Turn off auto-hide for the VIM tool window.
|
||||
- Shrink the tool window so just the window title is visible.
|
||||
- Do not move the VIM tool window to the left or right - leave on the bottom
|
||||
or top.
|
||||
- Various error messages are now displayed in the new status bar.
|
||||
- Added support for : register
|
||||
- Added support for / register
|
||||
|
||||
New Commands
|
||||
- Added support for q{register} command - macro recording.
|
||||
- Added support for @{register} and @@ commands - playback register contents.
|
||||
- Added support for :@{register}, :@@, and :@: - run register as command or
|
||||
repeat last :@ command.
|
||||
|
||||
New :set Options
|
||||
- showmode is now supported.
|
||||
|
||||
Bug Fixes
|
||||
- Hitting escape while entering a search string resulted in a search for the
|
||||
previous search string instead of doing nothing.
|
||||
- The :registers command didn't display trailing newlines in a register
|
||||
- Fixed focus problem if user hits escape in the find dialog after entering
|
||||
the :find command.
|
||||
- All the search and substitute commands acted strangely if the text contained
|
||||
real tab characters. Tabs are now properly handled.
|
||||
- gd and gD weren't working in read-only files.
|
||||
|
||||
0.3.2 from 0.3.1
|
||||
|
||||
New Commands
|
||||
- Added support for {visual}!{filter}, !{motion}{filter}, and !!{filter}.
|
||||
- Added support for [p, ]p, [P, ]P - put text but do not autoindent. Note -
|
||||
This plugin's support for putting text with or without proper indenting is
|
||||
reversed from VIM.
|
||||
|
||||
New Features
|
||||
- Entering a count before the v or V command to start Visual mode is now
|
||||
supported.
|
||||
- Repeating Visual commands is now supported.
|
||||
|
||||
Bug Fixes
|
||||
- Now properly handle :0, :1, and :<negative> commands
|
||||
- More problems with Visual mode - none of the visual change commands left
|
||||
you in insert mode after deleting the text and undo wouldn't put the text
|
||||
back.
|
||||
- Fixed the handling of undo/redo with regard to text added to a file while not
|
||||
in insert mode. This can happen with the use of the Generate... menu for
|
||||
adding constructors, getters, etc. This also can happen when IDEA adds an
|
||||
import statement automatically. This also allows you to undo import
|
||||
optimizations!
|
||||
- Doing a cw or cW when the cursor is already on the end of a word/WORD now
|
||||
correctly deletes only the last character of the word/WORD and not the next
|
||||
word too.
|
||||
- gd and gD now properly save the jump location before moving to the
|
||||
declaration.
|
||||
- z<Enter>, z-, and z. now move the cursor to the start of the line.
|
||||
- Visual mode is now exited after issuing the = or gq command.
|
||||
- The commands c% and d% where not removing the closing match as expected.
|
||||
- The d{motion} command now becomes linewise when the motion covers more than
|
||||
one line and there is just whitespace before the start and after the end.
|
||||
- Renamed some source files to avoid problems on case insensitive platforms.
|
||||
- Entering a count for the . (repeat) command sometimes results in an internal
|
||||
error.
|
||||
- Repeating an R command resulted in the text being inserted instead of
|
||||
overwriting old text. This now works properly.
|
||||
- Issuing a p command when on the last line of a file pasted the line before
|
||||
the last line instead of after the last line.
|
||||
|
||||
0.3.1 from 0.3.0
|
||||
|
||||
New Commands
|
||||
- Added support for [w, ]w, [b, and ]b. These move the cursor forward to start
|
||||
of next camel word, forward to end of next camel word, backward to start of
|
||||
previous camel word, and backward to end of previous camel word respectively.
|
||||
These are NOT in VIM but are very useful when working with mixed case method
|
||||
and variable names. Like their normal w, e, b, and ge counterparts, these may
|
||||
be used as operators for the c and d commands.
|
||||
- :qall, :quitall, :wqall, and :xall - closes all editors.
|
||||
- :wall - same as :write - save all files.
|
||||
- :xit and :exit - same :wq - save files and close current editor.
|
||||
- :close and :hide - same as :quit - close current editor.
|
||||
- :only - Close all editors except the current editor.
|
||||
- :display - same as :registers - display register contents.
|
||||
- :undo - same as u - undo last change.
|
||||
- :redo - same as Ctrl-R - redo last undone change.
|
||||
- :wnext - save files and move to next editor.
|
||||
- :wNext and :wprevious - save files and move to previous editor.
|
||||
|
||||
Changed Commands
|
||||
- ZZ, ZQ, :q and :wq will not exit IDEA anymore
|
||||
|
||||
Bug Fixes
|
||||
- Visual mode became unusable without doing a Ctrl-\ Ctrl-n command after each
|
||||
visual mode command. This unstable mode also caused undo to work improperly
|
||||
resulting in garbled text.
|
||||
- Ex commands that take a count instead of a range (:next, :Next, etc.) were
|
||||
getting the current line number as the count instead of one.
|
||||
- The == command can now be repeated with the . command.
|
||||
- Backslashes (\) in the replace text of a :substitute command was not being
|
||||
handled correctly in all cases.
|
||||
|
||||
0.3.0 from 0.2.0
|
||||
|
||||
Redone Commands
|
||||
- / and ? and all their variants are now supported properly, including offsets.
|
||||
- n and N are now supported properly
|
||||
- Ex command ranges now fully support searches
|
||||
- :substitute command now fully supports all Vim style search and replaces
|
||||
|
||||
New Commands
|
||||
- Added support for :set. Only a small number of options are supported.
|
||||
- Load .vimrc or _vimrc from user's home directory. Only set commands are
|
||||
honored.
|
||||
- Added support for *, #, g*, and g# - search for word under cursor.
|
||||
|
||||
Supported Set Options
|
||||
- gdefault - Indicates of the global flag in on by default for the :substitute
|
||||
command.
|
||||
- ignorecase - The default case sensitivity for searchs and substitutes.
|
||||
- matchpairs - Specify the character pairs used by the % command
|
||||
- more - Indicates whether 'more' is used or not for display windows
|
||||
- scroll - Specifies the number of lines scrolled by the Ctrl-D and Ctrl-U
|
||||
commands. Set to zero for half page.
|
||||
- selection - Specifies how the cursor can be moved at the ends of lines in
|
||||
Visual mode. It also controls whether the Visual mode selection is inclusive
|
||||
or exclusive.
|
||||
- smartcase - Overrides ignorecase if set and pattern has uppercase characters.
|
||||
- undolevels - Set to 0 for Vi style undo (1 level). Set to other number to
|
||||
specify how many levels of undo are supported per editor.
|
||||
- visualbell - controls whether the plugin beeps or not.
|
||||
- wrapscan - Determines is searches wrap around the start or end of the file.
|
||||
|
||||
0.2.0 from 0.1.1
|
||||
|
||||
New Commands
|
||||
- Added support for Ctrl-U while in insert mode
|
||||
- Added support for 0 Ctrl-D to remove all indent in current line
|
||||
- Added support for F1 while in insert - exit insert and bring up help topics
|
||||
- Added support for F1 while in normal mode - bring up help topics
|
||||
- Added support for :promptfind - Brings up Search Dialog
|
||||
- Added support for :promptrepl - Brings up Search/Replace Dialog
|
||||
- Added real support for :substitute - search and replace
|
||||
- Added support for :& - search and replace
|
||||
- Added support for :~ - search and replace
|
||||
- Added support for @: - repeat last Ex command
|
||||
- Added support for :{range}!{filter} [arg] command - filter text
|
||||
- Added support for :{range}!! command - repeat filter
|
||||
- Added support for :marks - display marks
|
||||
- Added support for :registers - display registers
|
||||
|
||||
Bug Fixes
|
||||
- Using the '%' range in Ex commands ignored the first line
|
||||
- Selecting a register for a command after using Ctrl-O in insert mode sent
|
||||
the user back to insert mode before they could enter the command.
|
||||
- Many commands caused exceptions if the current file is empty.
|
||||
- Let mouse clicks move cursor to end-of-line while in Insert or Replace mode.
|
||||
|
||||
Keymappings - Install new plugin.xml or manually add keymapping
|
||||
- F1
|
||||
|
||||
0.1.1 from 0.1.0
|
||||
- Fixed text of README file (NAME and VERSION weren't properly substituted)
|
||||
- Fixed issue with pressing Enter when entering an Ex command (no more beep or
|
||||
IDEA error message)
|
||||
- Fixed issue with pressing Backspace in the Ex command entry window when there
|
||||
are no characters. The beep is gone and the command entry is properly exited.
|
||||
4
CODE_OF_CONDUCT.md
Normal file
4
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,4 @@
|
||||
## Code of Conduct
|
||||
|
||||
This project and the corresponding community is governed by the [JetBrains Open Source and Community Code of Conduct](https://confluence.jetbrains.com/display/ALL/JetBrains+Open+Source+and+Community+Code+of+Conduct). Please make sure you read it.
|
||||
|
||||
124
CONTRIBUTING.md
Normal file
124
CONTRIBUTING.md
Normal file
@@ -0,0 +1,124 @@
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20183&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20183)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2018.3 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2019.1 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20192&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20192)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2019.2 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20193&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20193)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2019.3 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20201&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20201)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2020.1 Tests</span>
|
||||
</div>
|
||||
|
||||
|
||||
### Where to Start
|
||||
|
||||
In order to contribute to IdeaVim, you should have some understanding of [Kotlin](https://kotlinlang.org/) or Java.
|
||||
|
||||
See also these docs on the IntelliJ API:
|
||||
|
||||
* [IntelliJ architectural overview](https://www.jetbrains.org/intellij/sdk/docs/platform/fundamentals.html)
|
||||
* [IntelliJ plugin development resources](https://www.jetbrains.org/intellij/sdk/docs/welcome.html)
|
||||
|
||||
You can start by:
|
||||
|
||||
- Picking relatively simple tasks that are tagged with
|
||||
[#patch_welcome](https://youtrack.jetbrains.com/issues/VIM?q=%23patch_welcome%20%23Unresolved%20sort%20by:%20votes%20)
|
||||
in the issue tracker.
|
||||
- Read about the `@VimBehaviorDiffers` annotation and fix the corresponding functionality.
|
||||
|
||||
|
||||
### Development Environment
|
||||
|
||||
1. Fork IdeaVim on GitHub and clone the repository on your local machine.
|
||||
|
||||
2. Import the project from the existing sources in IntelliJ IDEA 2018.1 or newer (Community or
|
||||
Ultimate), by selecting "File | New | Project from Existing Sources..." or selecting "Import
|
||||
Project" from the Welcome screen.
|
||||
|
||||
* In the project wizard, select "Import project from external model | Gradle".
|
||||
|
||||
* Select your Java 8+ JDK as the Gradle JVM; leave other parameters unchanged.
|
||||
|
||||
3. Run your IdeaVim plugin within IntelliJ via a Gradle task:
|
||||
|
||||
* Select the "View | Tool Windows | Gradle" tool window.
|
||||
|
||||
* Launch "ideavim | intellij | runIde" from the tool window.
|
||||
|
||||
4. Run IdeaVim tests via a Gradle task:
|
||||
|
||||
* Select the "View | Tool Windows | Gradle" tool window.
|
||||
|
||||
* Launch "ideavim | verification | test" from the tool window.
|
||||
|
||||
5. Build the plugin distribution by running `./gradlew clean buildPlugin` in the
|
||||
terminal in your project root.
|
||||
|
||||
* The resulting distribution file will be located at build/distributions/IdeaVim-VERSION.zip
|
||||
|
||||
* You can install this file by selecting "Settings | Plugins | Install plugin
|
||||
from disk...".
|
||||
|
||||
### Copyright
|
||||
|
||||
1. Go to `Preferences | Appearance & Behavior | Scopes`, press "+" button, `Shared`.
|
||||
Name: Copyright scope
|
||||
Pattern: `file[IdeaVIM.main]:com//*||file[IdeaVIM.test]:*/`
|
||||
|
||||
2. Go to `Preferences | Editor | Copyright | Copyright Profiles` and click the "+" button.
|
||||
Name: IdeaVim
|
||||
Text:
|
||||
|
||||
IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||
Copyright (C) 2003-$today.year The IdeaVim authors
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
3. Go to `Preferences | Editor | Copyright`, click the "+" button.
|
||||
Scope: Copyright scope
|
||||
Copyright: IdeaVim
|
||||
|
||||
### Testing
|
||||
|
||||
1. Read about the `@VimBehaviorDiffers` annotation.
|
||||
|
||||
2. Please avoid senseless text like "dhjkwaldjwa", "asdasdasd",
|
||||
"123 123 123 123", etc. Try to choose an example text that is easy to
|
||||
read and understand what is wrong if the test fails.
|
||||
For example, take a few lines from your favorite poem, or use
|
||||
"Vladimir Nabokov – A Discovery" if you don't have one.
|
||||
|
||||
3. Test your functionality properly.
|
||||
Especially check whether your command works with:
|
||||
line start, line end, file start, file end, empty line, multiple carets, dollar motion, etc.
|
||||
@@ -1,12 +1,12 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
@@ -15,7 +15,7 @@ software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Library General Public License instead.) You can apply it to
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
@@ -55,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
@@ -110,7 +110,7 @@ above, provided that you also meet all of these conditions:
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
@@ -168,7 +168,7 @@ access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
@@ -225,7 +225,7 @@ impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
@@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
@@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
@@ -291,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) 19yy <name of author>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -303,17 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) 19yy name of author
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
@@ -336,5 +335,5 @@ necessary. Here is a sample; alter the names:
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Library General
|
||||
Public License instead of this License.
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
246
README.md
Normal file
246
README.md
Normal file
@@ -0,0 +1,246 @@
|
||||
<img src="resources/META-INF/pluginIcon.svg" width="80" height="80" alt="icon" align="left"/>
|
||||
|
||||
IdeaVim
|
||||
===
|
||||
|
||||
<div>
|
||||
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
||||
<img src="https://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||
</a>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20201&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20201)/statusIcon.svg?guest=1" alt="TeamCity Build"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
IdeaVim is a Vim emulation plugin for IDEs based on the IntelliJ Platform.
|
||||
IdeaVim can be used with IntelliJ IDEA, PyCharm, CLion, PhpStorm, WebStorm,
|
||||
RubyMine, AppCode, DataGrip, GoLand, Rider, Cursive, and Android Studio.
|
||||
|
||||
Resources:
|
||||
|
||||
* [Plugin homepage](https://plugins.jetbrains.com/plugin/164-ideavim)
|
||||
* [Changelog](CHANGES.md)
|
||||
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||
* [Continuous integration builds](https://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Use the IDE's plugin manager to install the latest version of the plugin.
|
||||
Start the IDE normally and enable the Vim emulation using "Tools | Vim
|
||||
Emulator" menu item. At this point you must use Vim keystrokes in all editors.
|
||||
|
||||
If you wish to disable the plugin, select the "Tools | Vim Emulator" menu so
|
||||
it is unchecked. At this point your IDE will work with its regular keyboard
|
||||
shortcuts.
|
||||
|
||||
Keyboard shortcut conflicts between the Vim emulation and the IDE can be
|
||||
resolved via "File | Settings | Editor | Vim Emulation", "File | Settings |
|
||||
Keymap" on Linux & Windows, and via "Preferences | Editor | Vim Emulation",
|
||||
"Preferences | Keymap" on macOS. They can also be resolved by key-mapping
|
||||
commands in your ~/.ideavimrc file.
|
||||
|
||||
|
||||
Get Early Access
|
||||
-------------------
|
||||
|
||||
Would you like to try new features and fixes? Join the Early Access Program and
|
||||
receive EAP builds as updates!
|
||||
|
||||
1. Click the IdeaVim icon in the status bar | `EAP` | `Get Early Access...`
|
||||
|
||||
Or subscribe to EAP updates manually:
|
||||
|
||||
1. Open `Settings | Plugins`
|
||||
2. Click the gear icon :gear:, select `Manage Plugin Repositories`, and add the following url:
|
||||
`https://plugins.jetbrains.com/plugins/eap/ideavim`
|
||||
|
||||
See [the changelog](CHANGES.md) for the list of hot unreleased features.
|
||||
|
||||
It is important to distinguish EAP builds from traditional pre-release software.
|
||||
Please note that the quality of EAP versions may at times be way below even
|
||||
usual beta standards.
|
||||
|
||||
You can always leave your feedback with:
|
||||
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||
|
||||
|
||||
Summary of Supported Vim Features
|
||||
---------------------------------
|
||||
|
||||
Supported:
|
||||
|
||||
* Motion keys
|
||||
* Deletion/changing
|
||||
* Insert mode commands
|
||||
* Marks
|
||||
* Registers
|
||||
* Undo/redo
|
||||
* Visual mode commands
|
||||
* Some Ex commands
|
||||
* Some [:set options](doc/set-commands.md)
|
||||
* Full Vim regexps for search and search/replace
|
||||
* Key mappings
|
||||
* Macros
|
||||
* Digraphs
|
||||
* Command line and search history
|
||||
* Window commands
|
||||
* Vim web help
|
||||
* Select mode
|
||||
|
||||
Emulated Vim plugins:
|
||||
|
||||
* vim-easymotion
|
||||
* vim-surround
|
||||
* vim-multiple-cursors
|
||||
* vim-commentary
|
||||
* argtextobj.vim
|
||||
* vim-textobj-entire
|
||||
* ReplaceWithRegister
|
||||
|
||||
Not supported (yet):
|
||||
|
||||
* Jump lists
|
||||
* Various less-used commands
|
||||
|
||||
See also:
|
||||
|
||||
* [The list of all supported commands](src/com/maddyhome/idea/vim/package-info.java)
|
||||
* [Top features and bugs](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
||||
|
||||
|
||||
Files
|
||||
-----
|
||||
|
||||
* ~/.ideavimrc
|
||||
* Your IdeaVim-specific Vim initialization commands
|
||||
|
||||
You can read your ~/.vimrc file from ~/.ideavimrc with this command:
|
||||
|
||||
source ~/.vimrc
|
||||
|
||||
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching.
|
||||
See [VIM-669](https://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||
of VimL files.
|
||||
|
||||
Also note that if you have overridden the `user.home` JVM option, this
|
||||
will affect where IdeaVim looks for your .ideavimrc file. For example, if you
|
||||
have `-Duser.home=/my/alternate/home` then IdeaVim will source
|
||||
`/my/alternate/home/.ideavimrc` instead of `~/.ideavimrc`.
|
||||
|
||||
Alternatively, you can set up initialization commands using [XDG](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) standard.
|
||||
Put your settings to `$XDG_CONFIG_HOME$/ideavim/ideavimrc` file.
|
||||
|
||||
|
||||
Emulated Vim Plugins
|
||||
--------------------
|
||||
|
||||
IdeaVim extensions emulate some plugins of the original Vim. In order to use
|
||||
IdeaVim extensions, you have to enable them via this command in your `~/.ideavimrc`:
|
||||
|
||||
set <extension-name>
|
||||
|
||||
Available extensions:
|
||||
|
||||
* easymotion
|
||||
* Setup:
|
||||
* Install [IdeaVim-EasyMotion](https://plugins.jetbrains.com/plugin/13360-ideavim-easymotion/)
|
||||
and [AceJump](https://plugins.jetbrains.com/plugin/7086-acejump/) plugins.
|
||||
* `set easymotion`
|
||||
* Emulates [vim-easymotion](https://github.com/easymotion/vim-easymotion)
|
||||
* Commands: All commands with the mappings are supported. See the [full list of supported commands](https://github.com/AlexPl292/IdeaVim-EasyMotion#supported-commands).
|
||||
|
||||
* surround
|
||||
* Setup: `set surround`
|
||||
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||
* Commands: `ys`, `cs`, `ds`, `S`
|
||||
|
||||
* multiple-cursors
|
||||
* Setup: `set multiple-cursors`
|
||||
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||
|
||||
* commentary
|
||||
* Setup: `set commentary`
|
||||
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
||||
* Commands: `gcc`, `gc + motion`, `v_gc`
|
||||
|
||||
* ReplaceWithRegister
|
||||
* Setup: `set ReplaceWithRegister`
|
||||
* Emulates [ReplaceWithRegister](https://github.com/vim-scripts/ReplaceWithRegister)
|
||||
* Commands: `gr`, `grr`
|
||||
|
||||
* argtextobj
|
||||
* Setup:
|
||||
* `set argtextobj`
|
||||
* By default, only the arguments inside parenthesis are considered. To extend the functionality
|
||||
to other types of brackets, set `g:argtextobj_pairs` variable to a comma-separated
|
||||
list of colon-separated pairs (same as VIM's `matchpairs` option), like
|
||||
`let g:argtextobj_pairs="(:),{:},<:>"`. The order of pairs matters when
|
||||
handling symbols that can also be operators: `func(x << 5, 20) >> 17`. To handle
|
||||
this syntax parenthesis, must come before angle brackets in the list.
|
||||
* Emulates [argtextobj.vim](https://www.vim.org/scripts/script.php?script_id=2699)
|
||||
* Additional text objects: `aa`, `ia`
|
||||
|
||||
* textobj-entire
|
||||
* Setup: `set textobj-entire`
|
||||
* Emulates [vim-textobj-entire](https://github.com/kana/vim-textobj-entire)
|
||||
* Additional text objects: `ae`, `ie`
|
||||
|
||||
|
||||
Changes to the IDE
|
||||
------------------
|
||||
|
||||
### Undo/Redo
|
||||
|
||||
The IdeaVim plugin uses the undo/redo functionality of the IntelliJ Platform,
|
||||
so the behavior of the `u` and `<C-R>` commands may differ from the original
|
||||
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||
|
||||
See also [unresolved undo issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||
|
||||
### Escape
|
||||
|
||||
Using `<Esc>` in dialog windows remains problematic. For most dialog windows,
|
||||
the Vim emulator is put into insert mode with `<Esc>` not working. You
|
||||
should use `<C-c>` or `<C-[>` instead. In some dialog windows, the normal mode is
|
||||
switched by default. The usage of the Vim emulator in dialog windows is an area for
|
||||
improvement.
|
||||
|
||||
See also [unresolved escape issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||
|
||||
### Executing IDE Actions
|
||||
|
||||
IdeaVim adds two commands for listing and executing arbitrary IDE actions as
|
||||
Ex commands or via `:map` command mappings:
|
||||
|
||||
* `:actionlist [pattern]`
|
||||
* Find IDE actions by name or keymap pattern (E.g. `:actionlist extract`, `:actionlist <C-D`)
|
||||
* `:action {name}`
|
||||
* Execute an action named `NAME`
|
||||
|
||||
For example, here `\r` is mapped to the Reformat Code action:
|
||||
|
||||
:map \r :action ReformatCode<CR>
|
||||
|
||||
|
||||
Contributing
|
||||
------------
|
||||
|
||||
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||
|
||||
Authors
|
||||
-------
|
||||
|
||||
See [AUTHORS.md](AUTHORS.md)
|
||||
for a list of authors and contributors.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
IdeaVim is licensed under the terms of the GNU Public License version 2
|
||||
or any later version.
|
||||
120
README.txt
120
README.txt
@@ -1,120 +0,0 @@
|
||||
IdeaVim - Version @VERSION@ for IntellIJ platform version @PLATFORM_VERSION@
|
||||
|
||||
This plugin attempts to emulate the functionality of VIM within IntelliJ platform based products. It actually emulates 'gvim' more than 'vim'. IdeaVim can be used with IntellIJ IDEA, RubyMine, PyCharm, PhpStorm, WebStorm and AppCode.
|
||||
|
||||
Resources:
|
||||
Wiki: https://github.com/JetBrains/ideavim/wiki/About-IdeaVim-project
|
||||
Homepage: http://plugins.intellij.net/plugin/?id=164
|
||||
Automatic builds: http://teamcity.jetbrains.com/project.html?projectId=project55
|
||||
|
||||
Installation
|
||||
|
||||
Use the IDE's plugin manager to install the latest version of the plugin.
|
||||
Start the IDE normally and Enable VIM emulation using "Tools|VIM Emulator" menu item. At this point you must use VIM keystrokes in all editors.
|
||||
|
||||
Disabling the IdeaVim Plugin
|
||||
|
||||
If you wish to disable the plugin, select the "Tools|VIM Emulator" menu so
|
||||
it is unchecked. You must also select "Options|Keymaps" and make a keymap other
|
||||
than "vim" the active keymap. At this point IDE will work with it's regular
|
||||
keyboard shortcuts.
|
||||
|
||||
|
||||
Changes to the IDE
|
||||
|
||||
Undo/Redo
|
||||
|
||||
The IdeaVim plugin uses it's own undo/redo functionality so it is important
|
||||
that you use the standard VIM keys 'u' and 'Ctrl-R' for undo/redo instead of
|
||||
the built in undo/redo. An exception might occur if you wish to undo the creation
|
||||
of a new class. For this you must select the Edit|Undo menu since IdeaVim
|
||||
doesn't support this feature. Using the built in undo/redo while editing a
|
||||
file will result in strange behavior and you will most likely lose changes.
|
||||
|
||||
Escape
|
||||
|
||||
In the IDE, the Escape key is used during editing to cancel code completion
|
||||
windows and parameter tooltips. While in VIM Insert mode, Escape is used to
|
||||
return back to Normal mode. If you are typing in Insert mode and a code
|
||||
completion window is popped up, pressing Escape will both cancel the window
|
||||
and exit Insert mode. If a parameter tooltip appears, pressing Escape will not
|
||||
make the tooltip go away whether in Insert or Normal mode. The only way to make
|
||||
the tooltip disappear is to move the cursor outside of the parameter area of
|
||||
the method call. (I would love to receive solutions for both of these issues.)
|
||||
|
||||
Menu Changes
|
||||
|
||||
In order to emulate the keystrokes used by VIM, several of the default hotkeys
|
||||
used by IDE had to be changed. Below is a list of IDE menus, their default
|
||||
keyboard shortcuts, and their new VIM keystrokes.
|
||||
|
||||
File
|
||||
Save All Ctrl-S :w
|
||||
|
||||
Edit
|
||||
Undo Ctrl-Z u
|
||||
Redo Ctrl-Shift-Z Ctrl-R
|
||||
Cut Ctrl-X "+x
|
||||
Copy Ctrl-C "+y
|
||||
Paste Ctrl-V "+P
|
||||
Select All Ctrl-A ggVG
|
||||
|
||||
Search
|
||||
Find Ctrl-F /
|
||||
Replace Ctrl-R :s
|
||||
Find Next F3 n
|
||||
Find Previous Shift-F3 N
|
||||
|
||||
View
|
||||
Quick JavaDoc Ctrl-Q K
|
||||
Parameter Info Ctrl-P Ctrl-Shift-P
|
||||
Swap Panels Ctrl-U <None>
|
||||
Recent Files... Ctrl-E <None>
|
||||
Type Hierarchy Ctrl-H Ctrl-Alt-Shift-H
|
||||
|
||||
Goto
|
||||
Class... Ctrl-N Alt-Shift-N
|
||||
Line... Ctrl-G G
|
||||
Declaration Ctrl-B gd
|
||||
Super Method Ctrl-U Ctrl-Shift-U
|
||||
|
||||
Code
|
||||
Override Methods... Ctrl-O Ctrl-Shift-O
|
||||
Implement Methods... Ctrl-I Ctrl-Shift-I
|
||||
Complete Code (Only in Insert mode)
|
||||
Basic Ctrl-Space Ctrl-Space or Ctrl-N or Ctrl-P
|
||||
Smart Type Ctrl-Shift-Space Ctrl-Shift-Space
|
||||
Class Name Ctrl-Alt-Space Ctrl-Alt-Space
|
||||
Insert Live Template Ctrl-J Ctrl-]
|
||||
|
||||
Tools
|
||||
Version Control
|
||||
Check In Project Ctrl-K <None>
|
||||
|
||||
|
||||
Summary of Supported/Unsupported VIM Features
|
||||
|
||||
Supported
|
||||
|
||||
Motion keys
|
||||
Deletion/Changing
|
||||
Insert mode commands
|
||||
Marks
|
||||
Registers
|
||||
VIM undo/redo
|
||||
Visual mode commands
|
||||
Some Ex commands
|
||||
Some :set options
|
||||
Full VIM regexps for search and search/replace macros
|
||||
Diagraphs
|
||||
|
||||
Not Supported (yet)
|
||||
Keymaps
|
||||
Various, less used (by me anyway), commands
|
||||
Jumplists
|
||||
Window commands
|
||||
Command line history
|
||||
Search history
|
||||
|
||||
Please see the file 'index.txt' for a complete list of supported, soon-to-be
|
||||
supported, and never-to-be supported commands.
|
||||
129
build.gradle
Normal file
129
build.gradle
Normal file
@@ -0,0 +1,129 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'org.jetbrains.intellij' version '0.4.16'
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'kotlin'
|
||||
|
||||
sourceCompatibility = javaVersion
|
||||
targetCompatibility = javaVersion
|
||||
|
||||
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
|
||||
|
||||
sourceSets {
|
||||
main {
|
||||
java.srcDir 'src'
|
||||
resources.srcDir 'resources'
|
||||
}
|
||||
test {
|
||||
java.srcDir 'test'
|
||||
}
|
||||
}
|
||||
|
||||
intellij {
|
||||
version ideaVersion
|
||||
pluginName 'IdeaVim'
|
||||
updateSinceUntilBuild false
|
||||
downloadSources Boolean.valueOf(downloadIdeaSources)
|
||||
instrumentCode Boolean.valueOf(instrumentPluginCode)
|
||||
intellijRepo = "https://www.jetbrains.com/intellij-repository"
|
||||
if (!Boolean.valueOf(legacyNoJavaPlugin)) {
|
||||
// Since 192 version of IJ java plugin should be defined separately
|
||||
// Set `legacyNoJavaPlugin` to true if you are going to run tests under idea version < 192
|
||||
plugins = ['java']
|
||||
}
|
||||
|
||||
publishPlugin {
|
||||
channels publishChannels.split(',')
|
||||
username publishUsername
|
||||
token publishToken
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
||||
compileOnly "org.jetbrains:annotations:19.0.0"
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
}
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("slackEapNotification") {
|
||||
doLast {
|
||||
if (!slackUrl) return
|
||||
def post = new URL(slackUrl).openConnection()
|
||||
def changeLog = extractChangelog()
|
||||
changeLog = changeLog.replace("* ", "• ") // Replace stars with bullets
|
||||
changeLog = changeLog.replace("**", "*") // Enable bold text
|
||||
changeLog = changeLog.replaceAll("\\[(.+)]\\(([^)]+)\\)", '<$2|$1>') // Enable links
|
||||
def message ="""
|
||||
{
|
||||
"text": "Danny Torrence left a 1 star review for your property.",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "section",
|
||||
"text": {
|
||||
"type": "mrkdwn",
|
||||
"text": "New EAP released: $version\\n$changeLog"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
"""
|
||||
post.setRequestMethod("POST")
|
||||
post.setDoOutput(true)
|
||||
post.setRequestProperty("Content-Type", "application/json")
|
||||
post.getOutputStream().write(message.getBytes("UTF-8"))
|
||||
def postRC = post.getResponseCode()
|
||||
println(postRC)
|
||||
if(postRC == 200) {
|
||||
println(post.getInputStream().getText())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Very primitive changelog extraction code
|
||||
def extractChangelog() {
|
||||
def startLine = "_Available since $version EAP:_"
|
||||
def endLine = "_To Be Released..._"
|
||||
def startSaving = false
|
||||
def res = new StringBuilder()
|
||||
new File("./CHANGES.md").eachLine { line ->
|
||||
if (startSaving) {
|
||||
if (line == endLine) {
|
||||
startSaving = false
|
||||
}
|
||||
else {
|
||||
res.append(line).append('\n')
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (line == startLine) {
|
||||
startSaving = true
|
||||
}
|
||||
}
|
||||
}
|
||||
return res.toString()
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
version-id:0.23
|
||||
platform-version:110.0
|
||||
idea.download.url=http://download.jetbrains.com/idea/ideaIU-11.zip
|
||||
build.number=x
|
||||
274
build.xml
274
build.xml
@@ -1,274 +0,0 @@
|
||||
<project name="IdeaVim">
|
||||
<!--
|
||||
* IdeaVim - A Vim emulator plugin for IntelliJ Idea
|
||||
* Copyright (C) 2003-2009 Rick Maddy, Oleg Shpynov
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
-->
|
||||
<property file="build.properties"/>
|
||||
|
||||
<property name="idea" value="${basedir}/idea"/>
|
||||
<property name="src" value="${basedir}/src"/>
|
||||
<property name="resources" value="${basedir}/resources"/>
|
||||
<property name="test" value="${basedir}/test"/>
|
||||
<property name="keymap" value="${basedir}/keymap"/>
|
||||
<property name="idea.home" value="${idea}/unzip"/>
|
||||
<property environment="env"/>
|
||||
<property name="tools.jar" value="${env.JAVA_HOME}/lib/tools.jar"/>
|
||||
<property name="version" value="${version-id}.${build.number}"/>
|
||||
<property name="filename" value="ideavim-${version}"/>
|
||||
|
||||
<!--Output-->
|
||||
<property name="out" value="${basedir}/out"/>
|
||||
<property name="classes" value="${out}/classes"/>
|
||||
<property name="build" value="${out}/build"/>
|
||||
<property name="dist" value="${out}/dist"/>
|
||||
<property name="test-reports" value="${out}/test-reports"/>
|
||||
|
||||
<!-- Define task -->
|
||||
<path id="ant-contrib">
|
||||
<pathelement path="lib/ant-contrib-1.0b3.jar"/>
|
||||
</path>
|
||||
<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpathref="ant-contrib"/>
|
||||
|
||||
<path id="build.classpath">
|
||||
<fileset dir="${idea.home}/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<fileset dir="${java.home}/lib">
|
||||
<include name="*.jar"/>
|
||||
</fileset>
|
||||
<pathelement path="${classes}"/>
|
||||
</path>
|
||||
|
||||
<path id="test.classpath">
|
||||
<path refid="build.classpath"/>
|
||||
<pathelement path="${tools.jar}"/>
|
||||
</path>
|
||||
|
||||
<!-- Clean all the generated stuff -->
|
||||
<target name="clean" description="Removes all generated files">
|
||||
<delete dir="${out}"/>
|
||||
</target>
|
||||
|
||||
<!-- Compile all the sources to the ${classes} folder -->
|
||||
<target name="compile">
|
||||
<mkdir dir="${classes}"/>
|
||||
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
|
||||
<classpath refid="build.classpath"/>
|
||||
</taskdef>
|
||||
<!-- The task requires the following libraries from IntelliJ IDEA distribution: -->
|
||||
<!-- javac2.jar; jdom.jar; asm.jar; asm-commons.jar -->
|
||||
<javac2 destdir="${classes}" debug="on" fork="true" includeantruntime="false">
|
||||
<classpath refid="build.classpath"/>
|
||||
<src path="${src}"/>
|
||||
<include name="com/maddyhome/idea/**"/>
|
||||
</javac2>
|
||||
</target>
|
||||
|
||||
<!-- Create ideavim.jar for packing inside zip plugin package -->
|
||||
<target name="jar">
|
||||
<mkdir dir="${classes}"/>
|
||||
<mkdir dir="${classes}/META-INF"/>
|
||||
<copy file="resources/META-INF/plugin.xml" todir="${classes}/META-INF">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="SINCE-VERSION" value="${platform-version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${src}" excludes="**/*.java"/>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${resources}"/>
|
||||
</copy>
|
||||
<mkdir dir="${build}"/>
|
||||
<jar basedir="${classes}" jarfile="${build}/IdeaVim.jar" compress="yes"/>
|
||||
</target>
|
||||
|
||||
<!-- Create help files -->
|
||||
<target name="help" depends="clean, compile">
|
||||
<mkdir dir="${build}/help/txt"/>
|
||||
<mkdir dir="${build}/help/vim"/>
|
||||
|
||||
<copy todir="${build}/help/txt">
|
||||
<fileset dir="help/txt">
|
||||
<include name="*.txt"/>
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
|
||||
<!-- Generate tags by shortcuts or actions -->
|
||||
<fileset dir="${build}/help/txt" id="txt.files">
|
||||
<include name="*.txt"/>
|
||||
</fileset>
|
||||
<pathconvert property="helpfiles" refid="txt.files" pathsep=" "/>
|
||||
<java failonerror="true" classname="com.maddyhome.idea.vim.help.MakeTags" classpath="${classes}"
|
||||
output="${build}/help/vim/tags" error="error">
|
||||
<arg line="${helpfiles}"/>
|
||||
</java>
|
||||
|
||||
<exec executable="sort" output="${build}/help/vim/tags.sort">
|
||||
<arg value="-u"/>
|
||||
<arg file="${build}/help/vim/tags"/>
|
||||
</exec>
|
||||
<move file="${build}/help/vim/tags.sort" tofile="${build}/help/vim/tags"/>
|
||||
|
||||
<exec executable="perl">
|
||||
<arg file="help/vim2jh.pl"/>
|
||||
<arg path="${build}/help"/>
|
||||
<arg path="${build}/help/vim/tags"/>
|
||||
<arg line="${helpfiles}"/>
|
||||
</exec>
|
||||
|
||||
<copy todir="${build}/help">
|
||||
<fileset dir="help">
|
||||
<include name="images/"/>
|
||||
</fileset>
|
||||
</copy>
|
||||
|
||||
<copy todir="${build}/help">
|
||||
<fileset dir="help/jh">
|
||||
<include name="*"/>
|
||||
</fileset>
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
|
||||
<delete dir="${build}/help/txt"/>
|
||||
|
||||
<fileset dir="${build}/help/vim" id="html.files">
|
||||
<include name="*.html"/>
|
||||
</fileset>
|
||||
<pathconvert property="htmlfiles" refid="html.files" pathsep=" "/>
|
||||
<propertyregex property="srchfiles" input="${htmlfiles}" regexp="${build}/help/" replace="" global="true"/>
|
||||
|
||||
<java classname="com.sun.java.help.search.Indexer" classpath="lib/jhall.jar" fork="true" dir="${build}/help">
|
||||
<arg value="-db"/>
|
||||
<arg value="MasterSearchIndex"/>
|
||||
<arg line="${srchfiles}"/>
|
||||
</java>
|
||||
|
||||
<jar basedir="${build}/help" jarfile="${build}/help.jar"/>
|
||||
</target>
|
||||
|
||||
<target name="build" depends="unzip, clean, compile, jar, help" description="Compiles all source code and created plugin jar file"/>
|
||||
|
||||
<!-- Download IntelliJ IDEA distribution -->
|
||||
<target name="download" description="Downloads IntelliJ IDEA artifacts">
|
||||
<mkdir dir="${idea}"/>
|
||||
<get src="${idea.download.url}" dest="${idea}" skipexisting="true"/>
|
||||
</target>
|
||||
|
||||
<!-- Unpack idea-*.zip file for ideavim compilation -->
|
||||
<target name="unzip" depends="download" description="Unzip downloaded artifacts and set up idea.home">
|
||||
<delete dir="${idea}/unzip"/>
|
||||
<mkdir dir="${idea}/unzip"/>
|
||||
<basename property="idea.filename" file="${idea.download.url}"/>
|
||||
<unzip dest="${idea}/unzip">
|
||||
<fileset dir="${idea}" includes="${idea.filename}"/>
|
||||
</unzip>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="dist-src, dist-bin" description="Creates the src and bin distribution files"/>
|
||||
|
||||
<!-- Prepare layout for plugin distribution and creates zip file which can be published -->
|
||||
<target name="dist-bin" depends="clean, build" description="Creates a zip file containing the plugin sources">
|
||||
<delete dir="${build}/IdeaVim"/>
|
||||
<mkdir dir="${build}/IdeaVim"/>
|
||||
<copy todir="${build}/IdeaVim">
|
||||
<fileset dir="${basedir}" includes="license/**"/>
|
||||
<fileset dir="${keymap}" includes="**"/>
|
||||
</copy>
|
||||
<copy todir="${build}/IdeaVim/lib">
|
||||
<fileset dir="${build}" includes="*.jar" excludes="help.jar"/>
|
||||
</copy>
|
||||
<copy todir="${build}/IdeaVim/help">
|
||||
<fileset dir="${build}" includes="help.jar"/>
|
||||
</copy>
|
||||
<copy file="${basedir}/README.txt" tofile="${build}/IdeaVim/README">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="PLATFORM_VERSION" value="${platform-version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy file="${basedir}/CHANGES.txt" tofile="${build}/IdeaVim/CHANGES">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="PLATFORM_VERSION" value="${platform-version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<zip basedir="${build}" zipfile="${dist}/${filename}.zip" compress="true" includes="IdeaVim/**"/>
|
||||
</target>
|
||||
|
||||
<!-- Packs all the sources -->
|
||||
<target name="dist-src" depends="clean" description="Creates the source tar file">
|
||||
<mkdir dir="${dist}"/>
|
||||
<tar basedir="." destfile="${dist}/${filename}-src.tar.gz" excludes=".git/**,.idea/**,idea/**,*.iws,*.iml" compression="gzip"/>
|
||||
</target>
|
||||
|
||||
<target name="compile-tests" depends="compile">
|
||||
<mkdir dir="${classes}"/>
|
||||
<taskdef name="javac2" classname="com.intellij.ant.Javac2">
|
||||
<classpath refid="build.classpath"/>
|
||||
</taskdef>
|
||||
<javac2 destdir="${classes}" debug="on" fork="true" includeantruntime="false">
|
||||
<classpath refid="build.classpath"/>
|
||||
<src path="${test}"/>
|
||||
<include name="org/jetbrains/plugins/ideavim/**"/>
|
||||
</javac2>
|
||||
</target>
|
||||
|
||||
<target name="prepare-tests" depends="compile-tests">
|
||||
<mkdir dir="${classes}/META-INF"/>
|
||||
<copy file="resources/META-INF/plugin.xml" todir="${classes}/META-INF">
|
||||
<filterset>
|
||||
<filter token="VERSION" value="${version}"/>
|
||||
<filter token="SINCE-VERSION" value="${platform-version}"/>
|
||||
</filterset>
|
||||
</copy>
|
||||
<copy todir="${classes}">
|
||||
<fileset dir="${resources}"/>
|
||||
</copy>
|
||||
<mkdir dir="${out}/IdeaVim"/>
|
||||
<copy todir="${out}/IdeaVim">
|
||||
<fileset dir="${keymap}" includes="**"/>
|
||||
</copy>
|
||||
</target>
|
||||
|
||||
<target name="test" depends="unzip, clean, prepare-tests">
|
||||
<mkdir dir="${test-reports}"/>
|
||||
<junit fork="true" logfailedtests="false" printsummary="true">
|
||||
<classpath refid="test.classpath"/>
|
||||
|
||||
<jvmarg value="-Xmx256M"/>
|
||||
<jvmarg value="-ea"/>
|
||||
<jvmarg value="-Djava.awt.headless=true"/>
|
||||
<jvmarg value="-Didea.plugins.path=${out}"/>
|
||||
<jvmarg value="-Didea.load.plugins.id=IdeaVIM"/>
|
||||
|
||||
<formatter type="plain"/>
|
||||
|
||||
<batchtest todir="${test-reports}">
|
||||
<fileset dir="${test}">
|
||||
<include name="**/*Test.java"/>
|
||||
</fileset>
|
||||
</batchtest>
|
||||
</junit>
|
||||
</target>
|
||||
</project>
|
||||
51
doc/ideajoin-examples.md
Normal file
51
doc/ideajoin-examples.md
Normal file
@@ -0,0 +1,51 @@
|
||||
Some examples of join command with `ideajoin` option enabled.
|
||||
Put `set ideajoin` to your `~/.ideavimrc` to enable this functionality.
|
||||
|
||||
1) Automatic join concatenated lines:
|
||||
|
||||
```
|
||||
"Hello" + -> "Hello world"
|
||||
" world!"
|
||||
```
|
||||
|
||||
2) Nested if's:
|
||||
|
||||
```
|
||||
if (a) { -> if (a && b) {
|
||||
if (b) { ...
|
||||
... }
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
3) Remove braces from one line for / if / while:
|
||||
|
||||
```
|
||||
if (fail) { -> if (fail) return;
|
||||
return;
|
||||
}
|
||||
```
|
||||
|
||||
4) Kotlin one line method:
|
||||
|
||||
```
|
||||
fun myNumber(): Int { -> fun myNumber(): Int = 42
|
||||
return 42
|
||||
}
|
||||
```
|
||||
|
||||
5) Join declaration and initialization:
|
||||
|
||||
```
|
||||
int a; -> int a = 5;
|
||||
a = 5;
|
||||
```
|
||||
|
||||
6) Chain call:
|
||||
|
||||
```
|
||||
sb.append("a"); -> sb.append("a").append("b");
|
||||
sb.append("b");
|
||||
```
|
||||
|
||||
And other functions provided by the plugins.
|
||||
135
doc/set-commands.md
Normal file
135
doc/set-commands.md
Normal file
@@ -0,0 +1,135 @@
|
||||
List of Supported Set Commands
|
||||
==============================
|
||||
|
||||
The following `:set` commands can appear in `~/.ideavimrc` or be set manually in the command mode:
|
||||
|
||||
'clipboard' 'cb' clipboard options
|
||||
Standard clipboard options plus
|
||||
|
||||
`ideaput` (default on) - IdeaVim ONLY
|
||||
enable native idea paste action for put operations
|
||||
|
||||
'digraph' 'dg' enable the entering of digraphs in Insert mode
|
||||
'gdefault' 'gd' the ":substitute" flag 'g' is by default
|
||||
'history' 'hi' number of command-lines that are remembered
|
||||
'hlsearch' 'hls' highlight matches with the last search pattern
|
||||
'ignorecase' 'ic' ignore case in search patterns
|
||||
'iskeyword' 'isk' defines keywords for commands like 'w', '*', etc.
|
||||
'incsearch' 'is' show where search pattern typed so far matches
|
||||
|
||||
`keymodel` `km` String (default "continueselect,stopselect")
|
||||
|
||||
List of comma separated words, which enable special things that keys
|
||||
can do. These values can be used:
|
||||
startsel Using a shifted special[1] key starts selection (either
|
||||
Select mode or Visual mode, depending on "key" being
|
||||
present in 'selectmode').
|
||||
stopsel Using a NOT-shifted special[1] key stops selection.
|
||||
Automatically enables `stopselect` and `stopvisual`
|
||||
stopselect Using a NOT-shifted special[1] key stops - IdeaVim ONLY
|
||||
select mode and removes selection.
|
||||
stopvisual Using a NOT-shifted special[1] key stops - IdeaVim ONLY
|
||||
visual mode and removes selection.
|
||||
continueselect Using a shifted arrow key doesn't - IdeaVim ONLY
|
||||
start selection, but in select mode
|
||||
acts like startsel is enabled
|
||||
continuevisual Using a shifted arrow key doesn't - IdeaVim ONLY
|
||||
start selection, but in visual mode
|
||||
acts like startsel is enabled
|
||||
|
||||
'matchpairs' 'mps' pairs of characters that "%" can match
|
||||
'nrformats' 'nf' number formats recognized for CTRL-A command
|
||||
'number' 'nu' print the line number in front of each line
|
||||
'relativenumber' 'rnu' show the line number relative to the line with
|
||||
the cursor
|
||||
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
|
||||
'scrolljump' 'sj' minimum number of lines to scroll
|
||||
'scrolloff' 'so' minimum number of lines above and below the cursor
|
||||
'selection' 'sel' what type of selection to use
|
||||
|
||||
`selectmode` `slm` String (default "")
|
||||
|
||||
This is a comma-separated list of words, which specify when to start
|
||||
Select mode instead of Visual mode, when a selection is started.
|
||||
Possible values:
|
||||
mouse when using the mouse
|
||||
key when using shifted special[1] keys
|
||||
cmd when using "v", "V", or <C-V>
|
||||
ideaselection when IDE sets a selection - IdeaVim ONLY
|
||||
(examples: extend selection, wrap with while, etc.)
|
||||
|
||||
Deprecated values:
|
||||
template ~~please use `idearefactormode` option~~
|
||||
when starting a template - IdeaVim ONLY
|
||||
refactoring ~~please use ideaselection~~
|
||||
same as ideaselection - IdeaVim ONLY
|
||||
|
||||
'showmode' 'smd' message on the status line to show current mode
|
||||
'showcmd' 'sc' show (partial) command in the status bar
|
||||
'sidescroll' 'ss' minimum number of columns to scroll horizontally
|
||||
'sidescrolloff' 'siso' min. number of columns to left and right of cursor
|
||||
'smartcase' 'scs' no ignore case when pattern is uppercase
|
||||
'timeout' 'to' use timeout for mapped key sequences
|
||||
'timeoutlen' 'tm' timeout duration for a mapped key sequence
|
||||
'undolevels' 'ul' maximum number of changes that can be undone
|
||||
'viminfo' 'vi' information to remember after restart
|
||||
'visualbell' 'vb' use visual bell instead of beeping
|
||||
'wrapscan' 'ws' searches wrap around the end of file
|
||||
|
||||
|
||||
|
||||
IdeaVim only commands:
|
||||
|
||||
`ideamarks` `ideamarks` Boolean (default true)
|
||||
|
||||
If true, creation of global mark will trigger creation of IDE's bookmark
|
||||
and vice versa.
|
||||
|
||||
`idearefactormode` `idearefactormode` String(default "select")
|
||||
|
||||
Define the mode that would be enabled during
|
||||
the refactoring (renaming, live template, introduce variable, etc)
|
||||
|
||||
Use one of the following values:
|
||||
- keep - keep the mode that was enabled before starting a refactoring
|
||||
- select - start refactoring in select mode
|
||||
- visual - start refactoring in visual mode
|
||||
|
||||
This option has effect if you are in normal, insert or replace mode before refactoring start.
|
||||
Visual or select mode are not changed.
|
||||
|
||||
|
||||
`ideajoin` `ideajoin` Boolean (default false)
|
||||
|
||||
If true, join command will be performed via IDE
|
||||
See wiki/`ideajoin` examples
|
||||
|
||||
`ideastatusbar` `ideastatusbar` Boolean (default true)
|
||||
DEPRECATED. Please use `ideastatusicon`
|
||||
|
||||
If false, IdeaVim icon won't be shown in the status bar.
|
||||
Works only from `~/.ideavimrc` after the IDE restart.
|
||||
|
||||
`ideastatusicon` `ideastatusicon` String(default "enabled")
|
||||
|
||||
Define the behavior of IdeaVim icon in the status bar.
|
||||
|
||||
Use one of the following values:
|
||||
- enabled - icon is shown in the status bar
|
||||
- gray - use the gray version of the icon
|
||||
- disabled - hide the icon
|
||||
|
||||
Works only from `~/.ideavimrc` after the IDE restart.
|
||||
|
||||
`lookupkeys` `lookupkeys` List of strings
|
||||
|
||||
List of keys that should be processed by the IDE during the active lookup (autocompletion).
|
||||
For example, <Tab> and <Enter> are used by the IDE to finish the lookup,
|
||||
but <C-W> should be passed to IdeaVim.
|
||||
Default value:
|
||||
"<Tab>", "<Down>", "<Up>", "<Enter>", "<Left>", "<Right>",
|
||||
"<C-Down>", "<C-Up>", "<PageUp>", "<PageDown>",
|
||||
"<C-J>", "<C-Q>"
|
||||
|
||||
----------
|
||||
[1] - cursor keys, <End>, <Home>, <PageUp> and <PageDown>
|
||||
16
gradle.properties
Normal file
16
gradle.properties
Normal file
@@ -0,0 +1,16 @@
|
||||
# suppress inspection "UnusedProperty" for whole file
|
||||
|
||||
ideaVersion=201-EAP-SNAPSHOT
|
||||
downloadIdeaSources=true
|
||||
instrumentPluginCode=true
|
||||
version=SNAPSHOT
|
||||
javaVersion=1.8
|
||||
kotlinVersion=1.3.70
|
||||
publishUsername=username
|
||||
publishToken=token
|
||||
publishChannels=eap
|
||||
# Since 192 version of IJ java plugin should be defined separately
|
||||
# Set this value to true if you are going to run tests under idea version < 192
|
||||
legacyNoJavaPlugin=false
|
||||
|
||||
slackUrl=
|
||||
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Normal file
Binary file not shown.
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
6
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
#Fri Mar 20 11:41:45 MSK 2020
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.2.1-all.zip
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStorePath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
188
gradlew
vendored
Executable file
188
gradlew
vendored
Executable file
@@ -0,0 +1,188 @@
|
||||
#!/usr/bin/env sh
|
||||
|
||||
#
|
||||
# Copyright 2015 the original author or authors.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# https://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
|
||||
##############################################################################
|
||||
##
|
||||
## Gradle start up script for UN*X
|
||||
##
|
||||
##############################################################################
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
# Need this for relative symlinks.
|
||||
while [ -h "$PRG" ] ; do
|
||||
ls=`ls -ld "$PRG"`
|
||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
||||
if expr "$link" : '/.*' > /dev/null; then
|
||||
PRG="$link"
|
||||
else
|
||||
PRG=`dirname "$PRG"`"/$link"
|
||||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
APP_NAME="Gradle"
|
||||
APP_BASE_NAME=`basename "$0"`
|
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||
MAX_FD="maximum"
|
||||
|
||||
warn () {
|
||||
echo "$*"
|
||||
}
|
||||
|
||||
die () {
|
||||
echo
|
||||
echo "$*"
|
||||
echo
|
||||
exit 1
|
||||
}
|
||||
|
||||
# OS specific support (must be 'true' or 'false').
|
||||
cygwin=false
|
||||
msys=false
|
||||
darwin=false
|
||||
nonstop=false
|
||||
case "`uname`" in
|
||||
CYGWIN* )
|
||||
cygwin=true
|
||||
;;
|
||||
Darwin* )
|
||||
darwin=true
|
||||
;;
|
||||
MINGW* )
|
||||
msys=true
|
||||
;;
|
||||
NONSTOP* )
|
||||
nonstop=true
|
||||
;;
|
||||
esac
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
# Determine the Java command to use to start the JVM.
|
||||
if [ -n "$JAVA_HOME" ] ; then
|
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||
# IBM's JDK on AIX uses strange locations for the executables
|
||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
||||
else
|
||||
JAVACMD="$JAVA_HOME/bin/java"
|
||||
fi
|
||||
if [ ! -x "$JAVACMD" ] ; then
|
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
else
|
||||
JAVACMD="java"
|
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the
|
||||
location of your Java installation."
|
||||
fi
|
||||
|
||||
# Increase the maximum file descriptors if we can.
|
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
||||
MAX_FD_LIMIT=`ulimit -H -n`
|
||||
if [ $? -eq 0 ] ; then
|
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
||||
MAX_FD="$MAX_FD_LIMIT"
|
||||
fi
|
||||
ulimit -n $MAX_FD
|
||||
if [ $? -ne 0 ] ; then
|
||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
||||
fi
|
||||
else
|
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
||||
fi
|
||||
fi
|
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock
|
||||
if $darwin; then
|
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
||||
fi
|
||||
|
||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
SEP=""
|
||||
for dir in $ROOTDIRSRAW ; do
|
||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
||||
SEP="|"
|
||||
done
|
||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
||||
# Add a user-defined pattern to the cygpath arguments
|
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
||||
fi
|
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||
i=0
|
||||
for arg in "$@" ; do
|
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
||||
else
|
||||
eval `echo args$i`="\"$arg\""
|
||||
fi
|
||||
i=$((i+1))
|
||||
done
|
||||
case $i in
|
||||
(0) set -- ;;
|
||||
(1) set -- "$args0" ;;
|
||||
(2) set -- "$args0" "$args1" ;;
|
||||
(3) set -- "$args0" "$args1" "$args2" ;;
|
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
# Escape application args
|
||||
save () {
|
||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
||||
echo " "
|
||||
}
|
||||
APP_ARGS=$(save "$@")
|
||||
|
||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
||||
|
||||
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
|
||||
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
|
||||
cd "$(dirname "$0")"
|
||||
fi
|
||||
|
||||
exec "$JAVACMD" "$@"
|
||||
100
gradlew.bat
vendored
Normal file
100
gradlew.bat
vendored
Normal file
@@ -0,0 +1,100 @@
|
||||
@rem
|
||||
@rem Copyright 2015 the original author or authors.
|
||||
@rem
|
||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||
@rem you may not use this file except in compliance with the License.
|
||||
@rem You may obtain a copy of the License at
|
||||
@rem
|
||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||
@rem
|
||||
@rem Unless required by applicable law or agreed to in writing, software
|
||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
@rem See the License for the specific language governing permissions and
|
||||
@rem limitations under the License.
|
||||
@rem
|
||||
|
||||
@if "%DEBUG%" == "" @echo off
|
||||
@rem ##########################################################################
|
||||
@rem
|
||||
@rem Gradle startup script for Windows
|
||||
@rem
|
||||
@rem ##########################################################################
|
||||
|
||||
@rem Set local scope for the variables with windows NT shell
|
||||
if "%OS%"=="Windows_NT" setlocal
|
||||
|
||||
set DIRNAME=%~dp0
|
||||
if "%DIRNAME%" == "" set DIRNAME=.
|
||||
set APP_BASE_NAME=%~n0
|
||||
set APP_HOME=%DIRNAME%
|
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||
|
||||
@rem Find java.exe
|
||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||
|
||||
set JAVA_EXE=java.exe
|
||||
%JAVA_EXE% -version >NUL 2>&1
|
||||
if "%ERRORLEVEL%" == "0" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:findJavaFromJavaHome
|
||||
set JAVA_HOME=%JAVA_HOME:"=%
|
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||
|
||||
if exist "%JAVA_EXE%" goto init
|
||||
|
||||
echo.
|
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||
echo.
|
||||
echo Please set the JAVA_HOME variable in your environment to match the
|
||||
echo location of your Java installation.
|
||||
|
||||
goto fail
|
||||
|
||||
:init
|
||||
@rem Get command-line arguments, handling Windows variants
|
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
||||
|
||||
:win9xME_args
|
||||
@rem Slurp the command line arguments.
|
||||
set CMD_LINE_ARGS=
|
||||
set _SKIP=2
|
||||
|
||||
:win9xME_args_slurp
|
||||
if "x%~1" == "x" goto execute
|
||||
|
||||
set CMD_LINE_ARGS=%*
|
||||
|
||||
:execute
|
||||
@rem Setup the command line
|
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||
|
||||
@rem Execute Gradle
|
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
||||
|
||||
:end
|
||||
@rem End local scope for the variables with windows NT shell
|
||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
||||
|
||||
:fail
|
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||
rem the _cmd.exe /c_ return code!
|
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
||||
exit /b 1
|
||||
|
||||
:mainEnd
|
||||
if "%OS%"=="Windows_NT" endlocal
|
||||
|
||||
:omega
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 166 B |
@@ -1,42 +0,0 @@
|
||||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<!DOCTYPE helpset
|
||||
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp HelpSet Version 2.0//EN"
|
||||
"http://java.sun.com/products/javahelp/helpset_2_0.dtd">
|
||||
|
||||
<helpset version="1.0">
|
||||
|
||||
<!-- title -->
|
||||
<title>IdeaVim Help</title>
|
||||
|
||||
<!-- maps -->
|
||||
<maps>
|
||||
<homeID>vim.help.txt</homeID>
|
||||
<mapref location="Map.jhm"/>
|
||||
</maps>
|
||||
|
||||
<!-- views -->
|
||||
<view>
|
||||
<name>TOC</name>
|
||||
<label>Table Of Contents</label>
|
||||
<type>javax.help.TOCView</type>
|
||||
<data>VimTOC.xml</data>
|
||||
</view>
|
||||
|
||||
<!--
|
||||
<view>
|
||||
<name>Index</name>
|
||||
<label>Index</label>
|
||||
<type>javax.help.IndexView</type>
|
||||
<data>VimIndex.xml</data>
|
||||
</view>
|
||||
-->
|
||||
|
||||
<view>
|
||||
<name>Search</name>
|
||||
<label>Search</label>
|
||||
<type>javax.help.SearchView</type>
|
||||
<data>MasterSearchIndex</data>
|
||||
</view>
|
||||
|
||||
</helpset>
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<!DOCTYPE index
|
||||
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp Index Version 1.0//EN"
|
||||
"http://java.sun.com/products/javahelp/index_1_0.dtd">
|
||||
|
||||
<index version="1.0">
|
||||
<indexitem text="merge" target="intro"/>
|
||||
<indexitem text="view" target="view"/>
|
||||
<indexitem text="add" target="add" />
|
||||
<indexitem text="helpset" target="add"/>
|
||||
</index>
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
<?xml version='1.0' encoding='ISO-8859-1' ?>
|
||||
<!DOCTYPE toc
|
||||
PUBLIC "-//Sun Microsystems Inc.//DTD JavaHelp TOC Version 1.0//EN"
|
||||
"http://java.sun.com/products/javahelp/toc_2_0.dtd">
|
||||
<toc version="1.0">
|
||||
<tocitem text="IdeaVim" target="vim.help%2Etxt" image="vim.logo">
|
||||
<tocitem text="Overview of the most common commands you will use" target="vim.quickref" image="doc"/>
|
||||
<tocitem text="30 minutes training course for beginners" target="vim.tutor" image="doc"/>
|
||||
<tocitem text="Vim on the World Wide Web" target="vim.www" image="doc"/>
|
||||
<tocitem text="Where to send bug reports" target="vim.bugs" image="doc"/>
|
||||
<tocitem text="Getting Started" target="" image="folder">
|
||||
<tocitem text="About the manuals" target="vim.usr_01%2Etxt" image="doc"/>
|
||||
<tocitem text="The first steps in Vim" target="vim.usr_02%2Etxt" image="doc"/>
|
||||
<tocitem text="Moving around" target="vim.usr_03%2Etxt" image="doc"/>
|
||||
<tocitem text="Making small changes" target="vim.usr_04%2Etxt" image="doc"/>
|
||||
<tocitem text="Set your settings" target="vim.usr_05%2Etxt" image="doc"/>
|
||||
<tocitem text="Using syntax highlighting" target="vim.usr_06%2Etxt" image="doc"/>
|
||||
<tocitem text="Editing more than one file" target="vim.usr_07%2Etxt" image="doc"/>
|
||||
<tocitem text="Splitting windows" target="vim.usr_08%2Etxt" image="doc"/>
|
||||
<tocitem text="Using the GUI" target="vim.usr_09%2Etxt" image="doc"/>
|
||||
<tocitem text="Making big changes" target="vim.usr_10%2Etxt" image="doc"/>
|
||||
<tocitem text="Recovering from a crash" target="vim.usr_11%2Etxt" image="doc"/>
|
||||
<tocitem text="Clever tricks" target="vim.usr_12%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
<tocitem text="Editing Effectively" target="" image="folder">
|
||||
<tocitem text="Typing command-line commands quickly" target="vim.usr_20%2Etxt" image="doc"/>
|
||||
<tocitem text="Go away and come back" target="vim.usr_21%2Etxt" image="doc"/>
|
||||
<tocitem text="Finding the file to edit" target="vim.usr_22%2Etxt" image="doc"/>
|
||||
<tocitem text="Editing other files" target="vim.usr_23%2Etxt" image="doc"/>
|
||||
<tocitem text="Inserting quickly" target="vim.usr_24%2Etxt" image="doc"/>
|
||||
<tocitem text="Editing formatted text" target="vim.usr_25%2Etxt" image="doc"/>
|
||||
<tocitem text="Repeating" target="vim.usr_26%2Etxt" image="doc"/>
|
||||
<tocitem text="Search commands and patterns" target="vim.usr_27%2Etxt" image="doc"/>
|
||||
<tocitem text="Folding" target="vim.usr_28%2Etxt" image="doc"/>
|
||||
<tocitem text="Moving through programs" target="vim.usr_29%2Etxt" image="doc"/>
|
||||
<tocitem text="Editing programs" target="vim.usr_30%2Etxt" image="doc"/>
|
||||
<tocitem text="Exploiting the GUI" target="vim.usr_31%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
<tocitem text="General subjects" target="" image="folder">
|
||||
<tocitem text="General introduction to Vim; notation used in help files" target="vim.intro%2Etxt" image="doc"/>
|
||||
<tocitem text="Overview and quick reference (this file)" target="vim.help%2Etxt" image="doc"/>
|
||||
<tocitem text="Alphabetical index of all commands" target="vim.index%2Etxt" image="doc"/>
|
||||
<tocitem text="How to do the most common editing tasks" target="vim.howto%2Etxt" image="doc"/>
|
||||
<tocitem text="Various tips on using Vim" target="vim.tips%2Etxt" image="doc"/>
|
||||
<tocitem text="(error) messages and explanations" target="vim.message%2Etxt" image="doc"/>
|
||||
<tocitem text="Known problems and desired extensions" target="vim.todo%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
|
||||
<tocitem text="Basic Editing" target="" image="folder">
|
||||
<tocitem text="Starting Vim, Vim command arguments, initialisation" target="vim.starting%2Etxt" image="doc"/>
|
||||
<tocitem text="Editing and writing files" target="vim.editing%2Etxt" image="doc"/>
|
||||
<tocitem text="Commands for moving around" target="vim.motion%2Etxt" image="doc"/>
|
||||
<tocitem text="Scrolling the text in the window" target="vim.scroll%2Etxt" image="doc"/>
|
||||
<tocitem text="Insert and Replace mode" target="vim.insert%2Etxt" image="doc"/>
|
||||
<tocitem text="Deleting and replacing text" target="vim.change%2Etxt" image="doc"/>
|
||||
<tocitem text="Automatic indenting for C and other languages" target="vim.indent%2Etxt" image="doc"/>
|
||||
<tocitem text="Undo and Redo" target="vim.undo%2Etxt" image="doc"/>
|
||||
<tocitem text="Repeating commands, Vim scripts and debugging" target="vim.repeat%2Etxt" image="doc"/>
|
||||
<tocitem text="Using the Visual mode (selecting a text area)" target="vim.visual%2Etxt" image="doc"/>
|
||||
<tocitem text="Various remaining commands" target="vim.various%2Etxt" image="doc"/>
|
||||
<tocitem text="Recovering from a crash" target="vim.recover%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
|
||||
<tocitem text="Advanced Editing" target="" image="folder">
|
||||
<tocitem text="Command-line editing" target="vim.cmdline%2Etxt" image="doc"/>
|
||||
<tocitem text="Description of all options" target="vim.options%2Etxt" image="doc"/>
|
||||
<tocitem text="Regexp patterns and search commands" target="vim.pattern%2Etxt" image="doc"/>
|
||||
<tocitem text="Key mapping and abbreviations" target="vim.map%2Etxt" image="doc"/>
|
||||
<tocitem text="Tags and special searches" target="vim.tagsrch%2Etxt" image="doc"/>
|
||||
<tocitem text="Commands for a quick edit-compile-fix cycle" target="vim.quickfix%2Etxt" image="doc"/>
|
||||
<tocitem text="Commands for using multiple windows and buffers" target="vim.windows%2Etxt" image="doc"/>
|
||||
<tocitem text="Syntax highlighting" target="vim.syntax%2Etxt" image="doc"/>
|
||||
<tocitem text="Working with two or three versions of the same file" target="vim.diff%2Etxt" image="doc"/>
|
||||
<tocitem text="Automatically executing commands on an event" target="vim.autocmd%2Etxt" image="doc"/>
|
||||
<tocitem text="Settings done specifically for a type of file" target="vim.filetype%2Etxt" image="doc"/>
|
||||
<tocitem text="Expression evaluation, conditional commands" target="vim.eval%2Etxt" image="doc"/>
|
||||
<tocitem text="Hide (fold) ranges of lines" target="vim.fold%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
|
||||
<tocitem text="Special Issues" target="" image="folder">
|
||||
<tocitem text="List of available digraphs" target="vim.digraph%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
|
||||
<tocitem text="Versions" target="" image="folder">
|
||||
<tocitem text="Main differences between IdeaVim and Vim" target="vim.vi_diff%2Etxt" image="doc"/>
|
||||
</tocitem>
|
||||
</tocitem>
|
||||
</toc>
|
||||
@@ -1,325 +0,0 @@
|
||||
*arabic.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Arabic Language support (options & mappings) for Vim *Arabic*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
*E800*
|
||||
In order to use right-to-left and Arabic mapping support, it is
|
||||
necessary to compile VIM with the |+arabic| feature.
|
||||
|
||||
These functions have been created by Nadim Shaikli <nadim-at-arabeyes.org>
|
||||
|
||||
It is best to view this file with these settings within VIM's GUI: >
|
||||
|
||||
:set encoding=utf-8
|
||||
:set arabicshape
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
Arabic is a rather demanding language in which a number of special
|
||||
features are required. Characters are right-to-left oriented and
|
||||
ought to appear as such on the screen (ie. from right to left).
|
||||
Arabic also requires shaping of its characters, meaning the same
|
||||
character has a different visual form based on its relative location
|
||||
within a word (initial, medial, final or stand-alone). Arabic also
|
||||
requires two different forms of combining and the ability, in
|
||||
certain instances, to either superimpose upto two characters on top
|
||||
of another (composing) or the actual substitution of two characters
|
||||
into one (combining). Lastly, to display Arabic properly one will
|
||||
require not only ISO-8859-6 (U+0600-U+06FF) fonts, but will also
|
||||
require Presentation Form-B (U+FE70-U+FEFF) fonts both of which are
|
||||
subsets within a so-called ISO-10646-1 font.
|
||||
|
||||
The commands, prompts and help files are not in Arabic, therefore
|
||||
the user interface remains the standard Vi interface.
|
||||
|
||||
|
||||
Highlights
|
||||
----------
|
||||
o Editing left-to-right files as in the original VIM hasn't changed.
|
||||
|
||||
o Viewing and editing files in right-to-left windows. File
|
||||
orientation is per window, so it is possible to view the same
|
||||
file in right-to-left and left-to-right modes, simultaneously.
|
||||
|
||||
o No special terminal with right-to-left capabilities is required.
|
||||
The right-to-left changes are completely hardware independent.
|
||||
Only Arabic fonts are necessary.
|
||||
|
||||
o Compatible with the original VIM. Almost all features work in
|
||||
right-to-left mode (there are liable to be bugs).
|
||||
|
||||
o Changing keyboard mapping and reverse insert modes using a single
|
||||
command.
|
||||
|
||||
o Toggling complete Arabic support via a single command.
|
||||
|
||||
o While in Arabic mode, numbers are entered from left to right. Upon
|
||||
entering a none number character, that character will be inserted
|
||||
just into the left of the last number.
|
||||
|
||||
o Arabic keymapping on the command line in reverse insert mode.
|
||||
|
||||
o Proper Bidirectional functionality is possible given VIM is
|
||||
started within a Bidi capable terminal emulator.
|
||||
|
||||
|
||||
Arabic Fonts *arabicfonts*
|
||||
------------
|
||||
|
||||
VIM requires monospaced fonts of which there are many out there.
|
||||
Arabic requires ISO-8859-6 as well as Presentation Form-B fonts
|
||||
(without Form-B, Arabic will _NOT_ be usable). It is highly
|
||||
recommended that users search for so-called 'ISO-10646-1' fonts.
|
||||
Do an Internet search or check www.arabeyes.org for further
|
||||
info on where to attain the necessary Arabic fonts.
|
||||
|
||||
|
||||
Font Installation
|
||||
-----------------
|
||||
|
||||
o Installation of fonts for X Window systems (Unix/Linux)
|
||||
|
||||
Depending on your system, copy your_ARABIC_FONT file into a
|
||||
directory of your choice. Change to the directory containing
|
||||
the Arabic fonts and execute the following commands:
|
||||
|
||||
% mkfontdir
|
||||
% xset +fp path_name_of_arabic_fonts_directory
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
Prior to the actual usage of Arabic within VIM, a number of settings
|
||||
need to be accounted for and invoked.
|
||||
|
||||
o Setting the Arabic fonts
|
||||
|
||||
+ For VIM GUI set the 'guifont' to your_ARABIC_FONT. This is done
|
||||
by entering the following command in the VIM window.
|
||||
>
|
||||
:set guifont=your_ARABIC_FONT
|
||||
<
|
||||
NOTE: the string 'your_ARABIC_FONT' is used to denote a complete
|
||||
font name akin to that used in linux/unix system.
|
||||
(eg. -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1)
|
||||
|
||||
You can append the 'guifont' set command to your .vimrc file
|
||||
in order to get the same above noted results. In other words,
|
||||
you can include ':set guifont=your_ARABIC_FONT' to your .vimrc
|
||||
file.
|
||||
|
||||
+ Under the X Window environment, you can also start VIM with
|
||||
'-fn your_ARABIC_FONT' option.
|
||||
|
||||
o Setting the appropriate character Encoding
|
||||
To enable the correct Arabic encoding the following command needs
|
||||
to be appended,
|
||||
>
|
||||
:set encoding=utf-8
|
||||
<
|
||||
to your .vimrc file (entering the command manually into you VIM
|
||||
window is highly discouraged). In short, include ':set
|
||||
encoding=utf-8' to your .vimrc file.
|
||||
|
||||
Attempts to use Arabic without UTF-8 will result the following
|
||||
warning message,
|
||||
|
||||
*W17* >
|
||||
Arabic requires UTF-8, do ':set encoding=utf-8'
|
||||
|
||||
o Enable Arabic settings [short-cut]
|
||||
|
||||
In order to simplify and streamline things, you can either invoke
|
||||
VIM with the command-line option,
|
||||
|
||||
% vim -A my_utf8_arabic_file ...
|
||||
|
||||
or enable 'arabic' via the following command within VIM
|
||||
>
|
||||
:set arabic
|
||||
<
|
||||
The two above noted possible invocations are the preferred manner
|
||||
in which users are instructed to proceed. Baring an enabled 'termbidi'
|
||||
setting, both command options:
|
||||
|
||||
1. set the appropriate keymap
|
||||
2. enable the deletion of a single combined pair character
|
||||
3. enable rightleft mode
|
||||
4. enable rightleftcmd mode (affecting the command-line)
|
||||
5. enable arabicshape mode (do visual character alterations)
|
||||
|
||||
You may also append the command to your .vimrc file and simply
|
||||
include ':set arabic' to it.
|
||||
|
||||
You are also capable of disabling Arabic support via
|
||||
>
|
||||
:set noarabic
|
||||
<
|
||||
which resets everything that the command had enabled without touching
|
||||
the global settings as they could affect other possible open buffers.
|
||||
In short the 'noarabic' command,
|
||||
|
||||
1. resets to the alternate keymap
|
||||
2. disables the deletion of a single combined pair character
|
||||
3. disables rightleft mode
|
||||
|
||||
NOTE: the 'arabic' command takes into consideration 'termbidi' for
|
||||
possible external bi-directional (bidi) support from the
|
||||
terminal ("mlterm" for instance offers such support).
|
||||
'termbidi', if available, is superior to rightleft support
|
||||
and its support is preferred due to its level of offerings.
|
||||
'arabic' when 'termbidi' is enabled only sets the keymap.
|
||||
|
||||
If, on the other hand, you'd like to be verbose and explicit and
|
||||
are opting not to use the 'arabic' short-cut command, here's what
|
||||
is needed (ie. if you use ':set arabic' you can skip this section) -
|
||||
|
||||
+ Arabic Keymapping Activation
|
||||
|
||||
To activate the Arabic keymap (ie. to remap your english/latin
|
||||
keyboard to look-n-feel like a standard Arabic one), set the
|
||||
'keymap' command to "arabic". This is done by entering
|
||||
>
|
||||
:set keymap=arabic
|
||||
<
|
||||
in your VIM window. You can also append the 'keymap' set command to
|
||||
your .vimrc file. In other words, you can include ':set keymap=arabic'
|
||||
to your .vimrc file.
|
||||
|
||||
To turn toggle (or switch) your keymapping between Arabic and the
|
||||
default mapping (english), its advised that users use the 'CTRL-^'
|
||||
key press while in insert (or add/replace) mode. The command-line
|
||||
will display your current mapping by displaying an "Arabic" string
|
||||
next to your insertion mode (eg. -- INSERT Arabic --) indicating
|
||||
your current keymap.
|
||||
|
||||
+ Arabic deletion of a combined pair character
|
||||
|
||||
By default VIM has the 'delcombine' option disabled. This option
|
||||
allows the deletion of ALEF in a LAM_ALEF (LAA) combined character
|
||||
and still retain the LAM (ie. it reverts to treating the combined
|
||||
character as its natural two characters form -- this also pertains
|
||||
to harakat and their combined forms). You can enable this option
|
||||
by entering
|
||||
>
|
||||
:set delcombine
|
||||
<
|
||||
in our VIM window. You can also append the 'delcombine' set command
|
||||
to your .vimrc file. In other words, you can include ':set delcombine'
|
||||
to your .vimrc file.
|
||||
|
||||
+ Arabic right-to-left Mode
|
||||
|
||||
By default VIM starts in Left-to-right mode. 'rightleft' is the
|
||||
command that allows one to alter a window's orientation - that can
|
||||
be accomplished via,
|
||||
|
||||
- Toggling between left-to-right and right-to-left modes is
|
||||
accomplished through ':set rightleft' and ':set norightleft'.
|
||||
|
||||
- While in Left-to-right mode, enter ':set rl' in the command line
|
||||
('rl' is the abbreviation for rightleft).
|
||||
|
||||
- Put the ':set rl' line in your '.vimrc' file to start the VIM in
|
||||
right-to-left mode permanently.
|
||||
|
||||
+ Arabic right-to-left command-line Mode
|
||||
|
||||
For certain commands the editing can be done in right-to-left mode.
|
||||
Currently this is only applicable to search commands.
|
||||
|
||||
This is controlled with the 'rightleftcmd' option. The default is
|
||||
"search", which means that windows in which 'rightleft' is set will
|
||||
edit search commands in right-left mode. To disable this behavior,
|
||||
>
|
||||
:set rightleftcmd=
|
||||
<
|
||||
To enable right-left editing of search commands again,
|
||||
>
|
||||
:set rightleftcmd&
|
||||
<
|
||||
+ Arabic Shaping Mode
|
||||
|
||||
To activate the required visual characters alterations (shaping,
|
||||
composing, combining) which the Arabic language requires, enable
|
||||
the 'arabicshape' command. This is done by entering
|
||||
>
|
||||
:set arabicshape
|
||||
<
|
||||
in our VIM window. You can also append the 'arabicshape' set
|
||||
command to your .vimrc file. In other words, you can include
|
||||
':set arabicshape' to your .vimrc file.
|
||||
|
||||
|
||||
Keymap/Keyboard *arabickeymap*
|
||||
---------------
|
||||
|
||||
The character/letter encoding used in VIM is the standard UTF-8.
|
||||
It is widely discouraged that any other encoding be used or even
|
||||
attempted.
|
||||
|
||||
Note: UTF-8 is an all encompassing encoding and as such is
|
||||
the only supported (and encouraged) encoding with
|
||||
regard to Arabic (all other proprietary encodings
|
||||
should be discouraged and frowned upon).
|
||||
|
||||
o Keyboard
|
||||
|
||||
+ CTRL-^ in insert/replace mode toggles between Arabic/Latin mode
|
||||
|
||||
+ Keyboard mapping is based on the Microsoft's Arabic keymap (the
|
||||
defacto standard in the Arab world):
|
||||
|
||||
+---------------------------------------------------------------------+
|
||||
|! |@ |# |$ |% |^ |& |* |( |) |_ |+ || |~ ّ |
|
||||
|1 ١ |2 ٢ |3 ٣ |4 ٤ |5 ٥ |6 ٦ |7 ٧ |8 ٨ |9 ٩ |0 ٠ |- |= |\ |` ذ |
|
||||
+---------------------------------------------------------------------+
|
||||
|Q َ |W ً |E ُ |R ٌ |T لإ |Y إ |U ` |I ÷ |O x |P ؛ |{ < |} > |
|
||||
|q ض |w ص |e ث |r ق |t ف |y غ |u ع |i ه |o خ |p ح |[ ج |] د |
|
||||
+-----------------------------------------------------------+
|
||||
|A ِ |S ٍ |D [ |F ] |G لأ |H أ |J ـ |K ، |L / |: |" |
|
||||
|a ش |s س |d ي |f ب |g ل |h ا |j ت |k ن |l م |; ك |' ط |
|
||||
+------------------------------------------------------+
|
||||
|Z ~ |X ْ |C { |V } |B لآ |N آ |M ' |< , |> . |? ؟ |
|
||||
|z ئ |x ء |c ؤ |v ر |b لا |n ى |m ة |, و |. ز |/ ظ |
|
||||
+-------------------------------------------------+
|
||||
|
||||
Restrictions
|
||||
------------
|
||||
|
||||
o VIM in its GUI form does not currently support Bi-directionality
|
||||
(ie. the ability to see both Arabic and Latin intermixed within
|
||||
the same line).
|
||||
|
||||
|
||||
Known Bugs
|
||||
----------
|
||||
|
||||
There is one known minor bug,
|
||||
|
||||
1. If you insert a haraka (eg. Fatha (U+064E)) after a LAM (U+0644)
|
||||
and then insert an ALEF (U+0627), the appropriate combining will
|
||||
not happen due to the sandwiched haraka resulting in something
|
||||
that will NOT be displayed correctly.
|
||||
|
||||
WORK-AROUND: Don't include harakats between LAM and ALEF combos.
|
||||
In general, don't anticipate to see correct visual
|
||||
representation with regard to harakats and LAM+ALEF
|
||||
combined characters (even those entered after both
|
||||
characters). The problem noted is strictly a visual
|
||||
one, meaning saving such a file will contain all the
|
||||
appropriate info/encodings - nothing is lost.
|
||||
|
||||
No other bugs are known to exist.
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,897 +0,0 @@
|
||||
*autocmd.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Automatic commands *autocommand*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
For a basic explanation, see section |40.3| in the user manual.
|
||||
|
||||
1. Introduction |autocmd-intro|
|
||||
2. Defining autocommands |autocmd-define|
|
||||
3. Removing autocommands |autocmd-remove|
|
||||
4. Listing autocommands |autocmd-list|
|
||||
5. Events |autocmd-events|
|
||||
6. Patterns |autocmd-patterns|
|
||||
7. Groups |autocmd-groups|
|
||||
8. Executing autocommands |autocmd-execute|
|
||||
9. Using autocommands |autocmd-use|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *autocmd-intro*
|
||||
|
||||
You can specify commands to be executed automatically for when reading or
|
||||
writing a file, when entering or leaving a buffer or window, and when exiting
|
||||
Vim. For example, you can create an autocommand to set the 'cindent' option
|
||||
for files matching *.c. You can also use autocommands to implement advanced
|
||||
features, such as editing compressed files (see |gzip-example|). The usual
|
||||
place to put autocommands is in your .vimrc or .exrc file.
|
||||
|
||||
*E203* *E204* *E143*
|
||||
WARNING: Using autocommands is very powerful, and may lead to unexpected side
|
||||
effects. Be careful not to destroy your text.
|
||||
- It's a good idea to do some testing on an expendable copy of a file first.
|
||||
For example: If you use autocommands to decompress a file when starting to
|
||||
edit it, make sure that the autocommands for compressing when writing work
|
||||
correctly.
|
||||
- Be prepared for an error halfway through (e.g., disk full). Vim will mostly
|
||||
be able to undo the changes to the buffer, but you may have to clean up the
|
||||
changes to other files by hand (e.g., compress a file that has been
|
||||
decompressed).
|
||||
- If the BufRead* events allow you to edit a compressed file, the FileRead*
|
||||
events should do the same (this makes recovery possible in some rare cases).
|
||||
It's a good idea to use the same autocommands for the File* and Buf* events
|
||||
when possible.
|
||||
|
||||
The |+autocmd| feature is only included if it has not been disabled at compile
|
||||
time.
|
||||
|
||||
==============================================================================
|
||||
2. Defining autocommands *autocmd-define*
|
||||
|
||||
Note: The ":autocmd" command cannot be followed by another command, since any
|
||||
'|' is considered part of the command.
|
||||
|
||||
*:au* *:autocmd*
|
||||
:au[tocmd] [group] {event} {pat} [nested] {cmd}
|
||||
Add {cmd} to the list of commands that Vim will
|
||||
execute automatically on {event} for a file matching
|
||||
{pat}. Vim always adds the {cmd} after existing
|
||||
autocommands, so that the autocommands execute in the
|
||||
order in which they were given. See |autocmd-nested|
|
||||
for [nested].
|
||||
|
||||
Note that special characters (e.g., "%", "<cword>") in the ":autocmd"
|
||||
arguments are not expanded when the autocommand is defined. These will be
|
||||
expanded when the Event is recognized, and the {cmd} is executed. The only
|
||||
exception is that "<sfile>" is expanded when the autocmd is defined. Example:
|
||||
>
|
||||
:au BufNewFile,BufRead *.html so <sfile>:h/html.vim
|
||||
|
||||
Here Vim expands <sfile> to the name of the file containing this line.
|
||||
|
||||
When your .vimrc file is sourced twice, the autocommands will appear twice.
|
||||
To avoid this, put this command in your .vimrc file, before defining
|
||||
autocommands: >
|
||||
|
||||
:autocmd! " Remove ALL autocommands for the current group.
|
||||
|
||||
If you don't want to remove all autocommands, you can instead use a variable
|
||||
to ensure that Vim includes the autocommands only once: >
|
||||
|
||||
:if !exists("autocommands_loaded")
|
||||
: let autocommands_loaded = 1
|
||||
: au ...
|
||||
:endif
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group]. Note
|
||||
that [group] must have been defined before. You cannot define a new group
|
||||
with ":au group ..."; use ":augroup" for that.
|
||||
|
||||
While testing autocommands, you might find the 'verbose' option to be useful: >
|
||||
:set verbose=9
|
||||
This setting makes Vim echo the autocommands as it executes them.
|
||||
|
||||
When defining an autocommand in a script, it will be able to call functions
|
||||
local to the script and use mappings local to the script. When the event is
|
||||
triggered and the command executed, it will run in the context of the script
|
||||
it was defined in. This matters if |<SID>| is used in a command.
|
||||
|
||||
When executing the commands, the messages from one command overwrites a
|
||||
previous message. This is different from when executing the commands
|
||||
manually. Mostly the screen will not scroll up, thus there is no hit-enter
|
||||
prompt. When one command outputs two messages this can happen anyway.
|
||||
|
||||
==============================================================================
|
||||
3. Removing autocommands *autocmd-remove*
|
||||
|
||||
:au[tocmd]! [group] {event} {pat} [nested] {cmd}
|
||||
Remove all autocommands associated with {event} and
|
||||
{pat}, and add the command {cmd}. See
|
||||
|autocmd-nested| for [nested].
|
||||
|
||||
:au[tocmd]! [group] {event} {pat}
|
||||
Remove all autocommands associated with {event} and
|
||||
{pat}.
|
||||
|
||||
:au[tocmd]! [group] * {pat}
|
||||
Remove all autocommands associated with {pat} for all
|
||||
events.
|
||||
|
||||
:au[tocmd]! [group] {event}
|
||||
Remove ALL autocommands for {event}.
|
||||
|
||||
:au[tocmd]! [group] Remove ALL autocommands.
|
||||
|
||||
When the [group] argument is not given, Vim uses the current group (as defined
|
||||
with ":augroup"); otherwise, Vim uses the group defined with [group].
|
||||
|
||||
==============================================================================
|
||||
4. Listing autocommands *autocmd-list*
|
||||
|
||||
:au[tocmd] [group] {event} {pat}
|
||||
Show the autocommands associated with {event} and
|
||||
{pat}.
|
||||
|
||||
:au[tocmd] [group] * {pat}
|
||||
Show the autocommands associated with {pat} for all
|
||||
events.
|
||||
|
||||
:au[tocmd] [group] {event}
|
||||
Show all autocommands for {event}.
|
||||
|
||||
:au[tocmd] [group] Show all autocommands.
|
||||
|
||||
If you provide the [group] argument, Vim lists only the autocommands for
|
||||
[group]; otherwise, Vim lists the autocommands for ALL groups. Note that this
|
||||
argument behavior differs from that for defining and removing autocommands.
|
||||
|
||||
==============================================================================
|
||||
5. Events *autocmd-events* *E215* *E216*
|
||||
|
||||
*autocommand-events* *{event}*
|
||||
Vim recognizes the following events. Vim ignores the case of event names
|
||||
(e.g., you can use "BUFread" or "bufread" instead of "BufRead").
|
||||
|
||||
*BufNewFile*
|
||||
BufNewFile When starting to edit a file that doesn't
|
||||
exist. Can be used to read in a skeleton
|
||||
file.
|
||||
*BufReadPre* *E200* *E201*
|
||||
BufReadPre When starting to edit a new buffer, before
|
||||
reading the file into the buffer. Not used
|
||||
if the file doesn't exist.
|
||||
*BufRead* *BufReadPost*
|
||||
BufRead or BufReadPost When starting to edit a new buffer, after
|
||||
reading the file into the buffer, before
|
||||
executing the modelines. See |BufWinEnter|
|
||||
for when you need to do something after
|
||||
processing the modelines.
|
||||
This does NOT work for ":r file". Not used
|
||||
when the file doesn't exist. Also used after
|
||||
successfully recovering a file.
|
||||
*BufReadCmd*
|
||||
BufReadCmd Before starting to edit a new buffer. Should
|
||||
read the file into the buffer. |Cmd-event|
|
||||
*BufFilePre*
|
||||
BufFilePre Before changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*BufFilePost*
|
||||
BufFilePost After changing the name of the current buffer
|
||||
with the ":file" or ":saveas" command.
|
||||
*FileReadPre*
|
||||
FileReadPre Before reading a file with a ":read" command.
|
||||
*FileReadPost*
|
||||
FileReadPost After reading a file with a ":read" command.
|
||||
Note that Vim sets the '[ and '] marks to the
|
||||
first and last line of the read. This can be
|
||||
used to operate on the lines just read.
|
||||
*FileReadCmd*
|
||||
FileReadCmd Before reading a file with a ":read" command.
|
||||
Should do the reading of the file. |Cmd-event|
|
||||
*FilterReadPre* *E135*
|
||||
FilterReadPre Before reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
*FilterReadPost*
|
||||
FilterReadPost After reading a file from a filter command.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterReadPre.
|
||||
*FileType*
|
||||
FileType When the 'filetype' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'filetype'.
|
||||
See |filetypes|.
|
||||
*Syntax*
|
||||
Syntax When the 'syntax' option has been set.
|
||||
<afile> can be used for the name of the file
|
||||
where this option was set, and <amatch> for
|
||||
the new value of 'syntax'.
|
||||
See |:syn-on|.
|
||||
*StdinReadPre*
|
||||
StdinReadPre Before reading from stdin into the buffer.
|
||||
Only used when the "-" argument was used when
|
||||
Vim was started |--|.
|
||||
*StdinReadPost*
|
||||
StdinReadPost After reading from the stdin into the buffer,
|
||||
before executing the modelines. Only used
|
||||
when the "-" argument was used when Vim was
|
||||
started |--|.
|
||||
*BufWrite* *BufWritePre*
|
||||
BufWrite or BufWritePre Before writing the whole buffer to a file.
|
||||
*BufWritePost*
|
||||
BufWritePost After writing the whole buffer to a file
|
||||
(should undo the commands for BufWritePre).
|
||||
*BufWriteCmd*
|
||||
BufWriteCmd Before writing the whole buffer to a file.
|
||||
Should do the writing of the file and reset
|
||||
'modified' if successful. The buffer contents
|
||||
should not be changed. |Cmd-event|
|
||||
*FileWritePre*
|
||||
FileWritePre Before writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWritePost*
|
||||
FileWritePost After writing to a file, when not writing the
|
||||
whole buffer.
|
||||
*FileWriteCmd*
|
||||
FileWriteCmd Before writing to a file, when not writing the
|
||||
whole buffer. Should do the writing to the
|
||||
file. Should not change the buffer.
|
||||
|Cmd-event|
|
||||
*FileAppendPre*
|
||||
FileAppendPre Before appending to a file.
|
||||
*FileAppendPost*
|
||||
FileAppendPost After appending to a file.
|
||||
*FileAppendCmd*
|
||||
FileAppendCmd Before appending to a file. Should do the
|
||||
appending to the file. |Cmd-event|
|
||||
*FilterWritePre*
|
||||
FilterWritePre Before writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer, not the name of the
|
||||
temporary file that is the output of the
|
||||
filter command.
|
||||
*FilterWritePost*
|
||||
FilterWritePost After writing a file for a filter command or
|
||||
making a diff.
|
||||
Vim checks the pattern against the name of
|
||||
the current buffer as with FilterWritePre.
|
||||
*FileChangedShell*
|
||||
FileChangedShell When Vim notices that the modification time of
|
||||
a file has changed since editing started.
|
||||
|timestamp|
|
||||
Mostly triggered after executing a shell
|
||||
command, but also with a |:checktime| command
|
||||
or when Vim regains input focus.
|
||||
This autocommand is triggered for each changed
|
||||
file. It is not used when 'autoread' is set
|
||||
and the buffer was not changed. If a
|
||||
FileChangedShell autocommand is present the
|
||||
warning message and prompt is not given.
|
||||
This is useful for reloading related buffers
|
||||
which are affected by a single command.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer that was changed "<afile>".
|
||||
NOTE: The commands must not change the current
|
||||
buffer, jump to another buffer or delete a
|
||||
buffer. *E246*
|
||||
NOTE: This event never nests, to avoid an
|
||||
endless loop. This means that while executing
|
||||
commands for the FileChangedShell event no
|
||||
other FileChangedShell event will be
|
||||
triggered.
|
||||
*FileChangedRO*
|
||||
FileChangedRO Before making the first change to a read-only
|
||||
file. Can be used to check-out the file from
|
||||
a source control system. Not triggered when
|
||||
the change was caused by an autocommand.
|
||||
WARNING: This event is triggered when making a
|
||||
change, just before the change is applied to
|
||||
the text. If the autocommand moves the cursor
|
||||
the effect of the change is undefined.
|
||||
*FocusGained*
|
||||
FocusGained When Vim got input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
can be detected.
|
||||
*FocusLost*
|
||||
FocusLost When Vim lost input focus. Only for the GUI
|
||||
version and a few console versions where this
|
||||
can be detected.
|
||||
*FuncUndefined*
|
||||
FuncUndefined When a user function is used but it isn't
|
||||
defined. Useful for defining a function only
|
||||
when it's used. Both <amatch> and <afile> are
|
||||
set to the name of the function.
|
||||
*CursorHold*
|
||||
CursorHold When the user doesn't press a key for the time
|
||||
specified with 'updatetime'. Not re-triggered
|
||||
until the user has pressed a key (i.e. doesn't
|
||||
fire every 'updatetime' ms if you leave Vim to
|
||||
make some coffee. :) See |CursorHold-example|
|
||||
for previewing tags.
|
||||
This event is only triggered in Normal mode.
|
||||
Note: Interactive commands cannot be used for
|
||||
this event. There is no hit-enter prompt,
|
||||
the screen is updated directly (when needed).
|
||||
Note: In the future there will probably be
|
||||
another option to set the time.
|
||||
Hint: to force an update of the status lines
|
||||
use: >
|
||||
:let &ro = &ro
|
||||
< {only on Amiga, Unix, Win32, MSDOS and all GUI
|
||||
versions}
|
||||
*BufEnter*
|
||||
BufEnter After entering a buffer. Useful for setting
|
||||
options for a file type. Also executed when
|
||||
starting to edit a buffer, after the
|
||||
BufReadPost autocommands.
|
||||
*BufLeave*
|
||||
BufLeave Before leaving to another buffer. Also when
|
||||
leaving or closing the current window and the
|
||||
new current window is not for the same buffer.
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*BufWinEnter*
|
||||
BufWinEnter After a buffer is displayed in a window. This
|
||||
can be when the buffer is loaded (after
|
||||
processing the modelines), when a hidden
|
||||
buffer is displayed in a window (and is no
|
||||
longer hidden) or a buffer already visible in
|
||||
a window is also displayed in another window.
|
||||
*BufWinLeave*
|
||||
BufWinLeave Before a buffer is removed from a window.
|
||||
Not when it's still visible in another window.
|
||||
Also triggered when exiting. It's triggered
|
||||
before BufUnload or BufHidden.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufUnload*
|
||||
BufUnload Before unloading a buffer. This is when the
|
||||
text in the buffer is going to be freed. This
|
||||
may be after a BufWritePost and before a
|
||||
BufDelete. Also used for all buffers that are
|
||||
loaded when Vim is going to exit.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufHidden*
|
||||
BufHidden Just after a buffer has become hidden. That
|
||||
is, when there are no longer windows that show
|
||||
the buffer, but the buffer is not unloaded or
|
||||
deleted. Not used for ":qa" or ":q" when
|
||||
exiting Vim.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being unloaded "<afile>".
|
||||
*BufNew*
|
||||
BufNew Just after creating a new buffer. Also used
|
||||
just after a buffer has been renamed. When
|
||||
the buffer is added to the buffer list BufAdd
|
||||
will be triggered too.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufCreate* *BufAdd*
|
||||
BufAdd or BufCreate Just after creating a new buffer which is
|
||||
added to the buffer list, or adding a buffer
|
||||
to the buffer list.
|
||||
Also used just after a buffer in the buffer
|
||||
list has been renamed.
|
||||
The BufCreate event is for historic reasons.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being created "<afile>".
|
||||
*BufDelete*
|
||||
BufDelete Before deleting a buffer from the buffer list.
|
||||
The BufUnload may be called first (if the
|
||||
buffer was loaded).
|
||||
Also used just before a buffer in the buffer
|
||||
list is renamed.
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*BufWipeout*
|
||||
BufWipeout Before completely deleting a buffer. The
|
||||
BufUnload and BufDelete events may be called
|
||||
first (if the buffer was loaded and was in the
|
||||
buffer list). Also used just before a buffer
|
||||
is renamed (also when it's not in the buffer
|
||||
list).
|
||||
NOTE: When this autocommand is executed, the
|
||||
current buffer "%" may be different from the
|
||||
buffer being deleted "<afile>".
|
||||
*WinEnter*
|
||||
WinEnter After entering another window. Not done for
|
||||
the first window, when Vim has just started.
|
||||
Useful for setting the window height.
|
||||
If the window is for another buffer, Vim
|
||||
executes the BufEnter autocommands after the
|
||||
WinEnter autocommands.
|
||||
Note: When using ":split fname" the WinEnter
|
||||
event is triggered after the split but before
|
||||
the file "fname" is loaded.
|
||||
*WinLeave*
|
||||
WinLeave Before leaving a window. If the window to be
|
||||
entered next is for a different buffer, Vim
|
||||
executes the BufLeave autocommands before the
|
||||
WinLeave autocommands (but not for ":new").
|
||||
Not used for ":qa" or ":q" when exiting Vim.
|
||||
*CmdwinEnter*
|
||||
CmdwinEnter After entering the command-line window.
|
||||
Useful for setting options specifically for
|
||||
this special type of window. This is
|
||||
triggered _instead_ of BufEnter and WinEnter.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*CmdwinLeave*
|
||||
CmdwinLeave Before leaving the command-line window.
|
||||
Useful to clean up any global setting done
|
||||
with CmdwinEnter. This is triggered _instead_
|
||||
of BufLeave and WinLeave.
|
||||
<afile> is set to a single character,
|
||||
indicating the type of command-line.
|
||||
|cmdwin-char|
|
||||
*GUIEnter*
|
||||
GUIEnter After starting the GUI successfully, and after
|
||||
opening the window. It is triggered before
|
||||
VimEnter when using gvim. Can be used to
|
||||
position the window from a .gvimrc file: >
|
||||
:autocmd GUIEnter * winpos 100 50
|
||||
< *VimEnter*
|
||||
VimEnter After doing all the startup stuff, including
|
||||
loading .vimrc files, executing the "-c cmd"
|
||||
arguments, creating all windows and loading
|
||||
the buffers in them.
|
||||
*VimLeavePre*
|
||||
VimLeavePre Before exiting Vim, just before writing the
|
||||
.viminfo file. This is executed only once,
|
||||
if there is a match with the name of what
|
||||
happens to be the current buffer when exiting.
|
||||
Mostly useful with a "*" pattern. >
|
||||
:autocmd VimLeavePre * call CleanupStuff()
|
||||
< To detect an abnormal exit use |v:dying|.
|
||||
*VimLeave*
|
||||
VimLeave Before exiting Vim, just after writing the
|
||||
.viminfo file. Executed only once, like
|
||||
VimLeavePre.
|
||||
To detect an abnormal exit use |v:dying|.
|
||||
*EncodingChanged*
|
||||
EncodingChanged Fires off when the 'encoding' option is
|
||||
changed. Useful to set up fonts, for example.
|
||||
*FileEncoding*
|
||||
FileEncoding Obsolete. It still works and is equivalent
|
||||
to |EncodingChanged|.
|
||||
*RemoteReply*
|
||||
RemoteReply When a reply from a Vim that functions as
|
||||
server was received |server2client()|.
|
||||
<amatch> is equal to the {serverid} from which
|
||||
the reply was sent, and <afile> is the actual
|
||||
reply string.
|
||||
Note that even if an autocommand is defined,
|
||||
the reply should be read with |remote_read()|
|
||||
to consume it.
|
||||
*TermChanged*
|
||||
TermChanged After the value of 'term' has changed. Useful
|
||||
for re-loading the syntax file to update the
|
||||
colors, fonts and other terminal-dependent
|
||||
settings. Executed for all loaded buffers.
|
||||
*TermResponse*
|
||||
TermResponse After the response to |t_RV| is received from
|
||||
the terminal. The value of |v:termresponse|
|
||||
can be used to do things depending on the
|
||||
terminal version.
|
||||
*UserGettingBored*
|
||||
UserGettingBored When the user hits CTRL-C. Just kidding! :-)
|
||||
*User*
|
||||
User Never executed automatically. To be used for
|
||||
autocommands that are only executed with
|
||||
":doautocmd".
|
||||
|
||||
|
||||
For READING FILES there are three possible pairs of events. Vim uses only one
|
||||
pair at a time:
|
||||
BufNewFile starting to edit a non-existent file
|
||||
BufReadPre BufReadPost starting to edit an existing file
|
||||
FilterReadPre FilterReadPost read the temp file with filter output
|
||||
FileReadPre FileReadPost any other file read
|
||||
|
||||
Note that the autocommands for the *ReadPre events and all the Filter events
|
||||
are not allowed to change the current buffer (you will get an error message if
|
||||
this happens). This is to prevent the file to be read into the wrong buffer.
|
||||
|
||||
Note that the 'modified' flag is reset AFTER executing the BufReadPost
|
||||
and BufNewFile autocommands. But when the 'modified' option was set by the
|
||||
autocommands, this doesn't happen.
|
||||
|
||||
You can use the 'eventignore' option to ignore a number of events or all
|
||||
events.
|
||||
|
||||
==============================================================================
|
||||
6. Patterns *autocmd-patterns*
|
||||
|
||||
The file pattern {pat} is tested for a match against the file name in one of
|
||||
two ways:
|
||||
1. When there is no '/' in the pattern, Vim checks for a match against only
|
||||
the tail part of the file name (without its leading directory path).
|
||||
2. When there is a '/' in the pattern, Vim checks for a match against the
|
||||
both short file name (as you typed it) and the full file name (after
|
||||
expanding it to a full path and resolving symbolic links).
|
||||
|
||||
Examples: >
|
||||
:autocmd BufRead *.txt set et
|
||||
Set the 'et' option for all text files. >
|
||||
|
||||
:autocmd BufRead /vim/src/*.c set cindent
|
||||
Set the 'cindent' option for C files in the /vim/src directory. >
|
||||
|
||||
:autocmd BufRead /tmp/*.c set ts=5
|
||||
If you have a link from "/tmp/test.c" to "/home/nobody/vim/src/test.c", and
|
||||
you start editing "/tmp/test.c", this autocommand will match.
|
||||
|
||||
Note: To match part of a path, but not from the root directory, use a '*' as
|
||||
the first character. Example: >
|
||||
:autocmd BufRead */doc/*.txt set tw=78
|
||||
This autocommand will for example be executed for "/tmp/doc/xx.txt" and
|
||||
"/usr/home/piet/doc/yy.txt". The number of directories does not matter here.
|
||||
|
||||
|
||||
The file name that the pattern is matched against is after expanding
|
||||
wildcards. Thus is you issue this command: >
|
||||
:e $ROOTDIR/main.$EXT
|
||||
The argument is first expanded to: >
|
||||
/usr/root/main.py
|
||||
Before it's matched with the pattern of the autocommand. Careful with this
|
||||
when using events like FileReadCmd, the value of <amatch> may not be what you
|
||||
expect.
|
||||
|
||||
|
||||
Environment variables can be used in a pattern: >
|
||||
:autocmd BufRead $VIMRUNTIME/doc/*.txt set expandtab
|
||||
And ~ can be used for the home directory (if $HOME is defined): >
|
||||
:autocmd BufWritePost ~/.vimrc so ~/.vimrc
|
||||
:autocmd BufRead ~archive/* set readonly
|
||||
The environment variable is expanded when the autocommand is defined, not when
|
||||
the autocommand is executed. This is different from the command!
|
||||
|
||||
*file-pattern*
|
||||
The pattern is interpreted like mostly used in file names:
|
||||
* matches any sequence of characters
|
||||
? matches any single character
|
||||
\? matches a '?'
|
||||
. matches a '.'
|
||||
~ matches a '~'
|
||||
, separates patterns
|
||||
\, matches a ','
|
||||
{ } like \( \) in a |pattern|
|
||||
, inside { }: like \| in a |pattern|
|
||||
\ special meaning like in a |pattern|
|
||||
[ch] matches 'c' or 'h'
|
||||
|
||||
Note that for all systems the '/' character is used for path separator (even
|
||||
MS-DOS and OS/2). This was done because the backslash is difficult to use
|
||||
in a pattern and to make the autocommands portable across different systems.
|
||||
|
||||
|
||||
Matching with the pattern is done when an event is triggered. Changing the
|
||||
buffer name in one of the autocommands, or even deleting the buffer, does not
|
||||
change which autocommands will be executed. Example: >
|
||||
|
||||
au BufEnter *.foo bdel
|
||||
au BufEnter *.foo set modified
|
||||
|
||||
This will delete the current buffer and then set 'modified' in what has become
|
||||
the current buffer instead. Vim doesn't take into account that "*.foo"
|
||||
doesn't match with that buffer name. It matches "*.foo" with the name of the
|
||||
buffer at the moment the event was triggered.
|
||||
|
||||
==============================================================================
|
||||
7. Groups *autocmd-groups*
|
||||
|
||||
Autocommands can be put together in a group. This is useful for removing or
|
||||
executing a group of autocommands. For example, all the autocommands for
|
||||
syntax highlighting are put in the "highlight" group, to be able to execute
|
||||
":doautoall highlight BufRead" when the GUI starts.
|
||||
|
||||
When no specific group is selected, Vim uses the default group. The default
|
||||
group does not have a name. You cannot execute the autocommands from the
|
||||
default group separately; you can execute them only by executing autocommands
|
||||
for all groups.
|
||||
|
||||
Normally, when executing autocommands automatically, Vim uses the autocommands
|
||||
for all groups. The group only matters when executing autocommands with
|
||||
":doautocmd" or ":doautoall", or when defining or deleting autocommands.
|
||||
|
||||
The group name can contain any characters except white space. The group name
|
||||
"end" is reserved (also in uppercase). The group name is case sensitive.
|
||||
|
||||
*:aug* *:augroup*
|
||||
:aug[roup] {name} Define the autocmd group name for the
|
||||
following ":autocmd" commands. The name "end"
|
||||
or "END" selects the default group.
|
||||
|
||||
*:augroup-delete* *E367*
|
||||
:aug[roup]! {name} Delete the autocmd group {name}. Don't use
|
||||
this if there is still an autocommand using
|
||||
this group! This is not checked.
|
||||
|
||||
To enter autocommands for a specific group, use this method:
|
||||
1. Select the group with ":augroup {name}".
|
||||
2. Delete any old autocommands with ":au!".
|
||||
3. Define the autocommands.
|
||||
4. Go back to the default group with "augroup END".
|
||||
|
||||
Example: >
|
||||
:augroup uncompress
|
||||
: au!
|
||||
: au BufEnter *.gz %!gunzip
|
||||
:augroup END
|
||||
|
||||
This prevents having the autocommands defined twice (e.g., after sourcing the
|
||||
.vimrc file again).
|
||||
|
||||
==============================================================================
|
||||
8. Executing autocommands *autocmd-execute*
|
||||
|
||||
Vim can also execute Autocommands non-automatically. This is useful if you
|
||||
have changed autocommands, or when Vim has executed the wrong autocommands
|
||||
(e.g., the file pattern match was wrong).
|
||||
|
||||
Note that the 'eventignore' option applies here too. Events listed in this
|
||||
option will not cause any commands to be executed.
|
||||
|
||||
*:do* *:doautocmd* *E217*
|
||||
:do[autocmd] [group] {event} [fname]
|
||||
Apply the autocommands matching [fname] (default:
|
||||
current file name) for {event} to the current buffer.
|
||||
You can use this when the current file name does not
|
||||
match the right pattern, after changing settings, or
|
||||
to execute autocommands for a certain event.
|
||||
It's possible to use this inside an autocommand too,
|
||||
so you can base the autocommands for one extension on
|
||||
another extension. Example: >
|
||||
:au Bufenter *.cpp so ~/.vimrc_cpp
|
||||
:au Bufenter *.cpp doau BufEnter x.c
|
||||
< Be careful to avoid endless loops. See
|
||||
|autocmd-nested|.
|
||||
|
||||
When the [group] argument is not given, Vim executes
|
||||
the autocommands for all groups. When the [group]
|
||||
argument is included, Vim executes only the matching
|
||||
autocommands for that group. Note: if you use an
|
||||
undefined group name, Vim gives you an error message.
|
||||
|
||||
*:doautoa* *:doautoall*
|
||||
:doautoa[ll] [group] {event} [fname]
|
||||
Like ":doautocmd", but apply the autocommands to each
|
||||
loaded buffer. Careful: Don't use this for
|
||||
autocommands that delete a buffer, change to another
|
||||
buffer or change the contents of a buffer; the result
|
||||
is unpredictable. This command is intended for
|
||||
autocommands that set options, change highlighting,
|
||||
and things like that.
|
||||
|
||||
==============================================================================
|
||||
9. Using autocommands *autocmd-use*
|
||||
|
||||
For WRITING FILES there are four possible sets of events. Vim uses only one
|
||||
of these sets for a write command:
|
||||
|
||||
BufWriteCmd BufWritePre BufWritePost writing the whole buffer
|
||||
FilterWritePre FilterWritePost writing to filter temp file
|
||||
FileAppendCmd FileAppendPre FileAppendPost appending to a file
|
||||
FileWriteCmd FileWritePre FileWritePost any other file write
|
||||
|
||||
When there is a matching "*Cmd" autocommand, it is assumed it will do the
|
||||
writing. No further writing is done and the other events are not triggered.
|
||||
|Cmd-event|
|
||||
|
||||
Note that the *WritePost commands should undo any changes to the buffer that
|
||||
were caused by the *WritePre commands; otherwise, writing the file will have
|
||||
the side effect of changing the buffer.
|
||||
|
||||
Before executing the autocommands, the buffer from which the lines are to be
|
||||
written temporarily becomes the current buffer. Unless the autocommands
|
||||
change the current buffer or delete the previously current buffer, the
|
||||
previously current buffer is made the current buffer again.
|
||||
|
||||
The *WritePre and *AppendPre autocommands must not delete the buffer from
|
||||
which the lines are to be written.
|
||||
|
||||
The '[ and '] marks have a special position:
|
||||
- Before the *ReadPre event the '[ mark is set to the line just above where
|
||||
the new lines will be inserted.
|
||||
- Before the *ReadPost event the '[ mark is set to the first line that was
|
||||
just read, the '] mark to the last line.
|
||||
- Before executing the *WritePre and *AppendPre autocommands the '[ mark is
|
||||
set to the first line that will be written, the '] mark to the last line.
|
||||
Careful: '[ and '] change when using commands that change the buffer.
|
||||
|
||||
In commands which expect a file name, you can use "<afile>" for the file name
|
||||
that is being read |:<afile>| (you can also use "%" for the current file
|
||||
name). "<abuf>" can be used for the buffer number of the currently effective
|
||||
buffer. This also works for buffers that doesn't have a name. But it doesn't
|
||||
work for files without a buffer (e.g., with ":r file").
|
||||
|
||||
*gzip-example*
|
||||
Examples for reading and writing compressed files: >
|
||||
:augroup gzip
|
||||
: autocmd!
|
||||
: autocmd BufReadPre,FileReadPre *.gz set bin
|
||||
: autocmd BufReadPost,FileReadPost *.gz '[,']!gunzip
|
||||
: autocmd BufReadPost,FileReadPost *.gz set nobin
|
||||
: autocmd BufReadPost,FileReadPost *.gz execute ":doautocmd BufReadPost " . expand("%:r")
|
||||
: autocmd BufWritePost,FileWritePost *.gz !mv <afile> <afile>:r
|
||||
: autocmd BufWritePost,FileWritePost *.gz !gzip <afile>:r
|
||||
|
||||
: autocmd FileAppendPre *.gz !gunzip <afile>
|
||||
: autocmd FileAppendPre *.gz !mv <afile>:r <afile>
|
||||
: autocmd FileAppendPost *.gz !mv <afile> <afile>:r
|
||||
: autocmd FileAppendPost *.gz !gzip <afile>:r
|
||||
:augroup END
|
||||
|
||||
The "gzip" group is used to be able to delete any existing autocommands with
|
||||
":autocmd!", for when the file is sourced twice.
|
||||
|
||||
("<afile>:r" is the file name without the extension, see |:_%:|)
|
||||
|
||||
The commands executed for the BufNewFile, BufRead/BufReadPost, BufWritePost,
|
||||
FileAppendPost and VimLeave events do not set or reset the changed flag of the
|
||||
buffer. When you decompress the buffer with the BufReadPost autocommands, you
|
||||
can still exit with ":q". When you use ":undo" in BufWritePost to undo the
|
||||
changes made by BufWritePre commands, you can still do ":q" (this also makes
|
||||
"ZZ" work). If you do want the buffer to be marked as modified, set the
|
||||
'modified' option.
|
||||
|
||||
To execute Normal mode commands from an autocommand, use the ":normal"
|
||||
command. Use with care! If the Normal mode command is not finished, the user
|
||||
needs to type characters (e.g., after ":normal m" you need to type a mark
|
||||
name).
|
||||
|
||||
If you want the buffer to be unmodified after changing it, reset the
|
||||
'modified' option. This makes it possible to exit the buffer with ":q"
|
||||
instead of ":q!".
|
||||
|
||||
*autocmd-nested* *E218*
|
||||
By default, autocommands do not nest. If you use ":e" or ":w" in an
|
||||
autocommand, Vim does not execute the BufRead and BufWrite autocommands for
|
||||
those commands. If you do want this, use the "nested" flag for those commands
|
||||
in which you want nesting. For example: >
|
||||
:autocmd FileChangedShell *.c nested e!
|
||||
The nesting is limited to 10 levels to get out of recursive loops.
|
||||
|
||||
It's possible to use the ":au" command in an autocommand. This can be a
|
||||
self-modifying command! This can be useful for an autocommand that should
|
||||
execute only once.
|
||||
|
||||
There is currently no way to disable the autocommands. If you want to write a
|
||||
file without executing the autocommands for that type of file, write it under
|
||||
another name and rename it with a shell command. In some situations you can
|
||||
use the 'eventignore' option.
|
||||
|
||||
Note: When reading a file (with ":read file" or with a filter command) and the
|
||||
last line in the file does not have an <EOL>, Vim remembers this. At the next
|
||||
write (with ":write file" or with a filter command), if the same line is
|
||||
written again as the last line in a file AND 'binary' is set, Vim does not
|
||||
supply an <EOL>. This makes a filter command on the just read lines write the
|
||||
same file as was read, and makes a write command on just filtered lines write
|
||||
the same file as was read from the filter. For example, another way to write
|
||||
a compressed file: >
|
||||
|
||||
:autocmd FileWritePre *.gz set bin|'[,']!gzip
|
||||
:autocmd FileWritePost *.gz undo|set nobin
|
||||
<
|
||||
*autocommand-pattern*
|
||||
You can specify multiple patterns, separated by commas. Here are some
|
||||
examples: >
|
||||
|
||||
:autocmd BufRead * set tw=79 nocin ic infercase fo=2croq
|
||||
:autocmd BufRead .letter set tw=72 fo=2tcrq
|
||||
:autocmd BufEnter .letter set dict=/usr/lib/dict/words
|
||||
:autocmd BufLeave .letter set dict=
|
||||
:autocmd BufRead,BufNewFile *.c,*.h set tw=0 cin noic
|
||||
:autocmd BufEnter *.c,*.h abbr FOR for (i = 0; i < 3; ++i)<CR>{<CR>}<Esc>O
|
||||
:autocmd BufLeave *.c,*.h unabbr FOR
|
||||
|
||||
For makefiles (makefile, Makefile, imakefile, makefile.unix, etc.): >
|
||||
|
||||
:autocmd BufEnter ?akefile* set include=^s\=include
|
||||
:autocmd BufLeave ?akefile* set include&
|
||||
|
||||
To always start editing C files at the first function: >
|
||||
|
||||
:autocmd BufRead *.c,*.h 1;/^{
|
||||
|
||||
Without the "1;" above, the search would start from wherever the file was
|
||||
entered, rather than from the start of the file.
|
||||
|
||||
*skeleton* *template*
|
||||
To read a skeleton (template) file when opening a new file: >
|
||||
|
||||
:autocmd BufNewFile *.c 0r ~/vim/skeleton.c
|
||||
:autocmd BufNewFile *.h 0r ~/vim/skeleton.h
|
||||
:autocmd BufNewFile *.java 0r ~/vim/skeleton.java
|
||||
|
||||
To insert the current date and time in a *.html file when writing it: >
|
||||
|
||||
:autocmd BufWritePre,FileWritePre *.html ks|call LastMod()|'s
|
||||
:fun LastMod()
|
||||
: if line("$") > 20
|
||||
: let l = 20
|
||||
: else
|
||||
: let l = line("$")
|
||||
: endif
|
||||
: exe "1," . l . "g/Last modified: /s/Last modified: .*/Last modified: " .
|
||||
: \ strftime("%Y %b %d")
|
||||
:endfun
|
||||
|
||||
You need to have a line "Last modified: <date time>" in the first 20 lines
|
||||
of the file for this to work. Vim replaces <date time> (and anything in the
|
||||
same line after it) with the current date and time. Explanation:
|
||||
ks mark current position with mark 's'
|
||||
call LastMod() call the LastMod() function to do the work
|
||||
's return the cursor to the old position
|
||||
The LastMod() function checks if the file is shorter than 20 lines, and then
|
||||
uses the ":g" command to find lines that contain "Last modified: ". For those
|
||||
lines the ":s" command is executed to replace the existing date with the
|
||||
current one. The ":execute" command is used to be able to use an expression
|
||||
for the ":g" and ":s" commands. The date is obtained with the strftime()
|
||||
function. You can change its argument to get another date string.
|
||||
|
||||
When entering :autocmd on the command-line, completion of events and command
|
||||
names may be done (with <Tab>, CTRL-D, etc.) where appropriate.
|
||||
|
||||
Vim executes all matching autocommands in the order that you specify them.
|
||||
It is recommended that your first autocommand be used for all files by using
|
||||
"*" as the file pattern. This means that you can define defaults you like
|
||||
here for any settings, and if there is another matching autocommand it will
|
||||
override these. But if there is no other matching autocommand, then at least
|
||||
your default settings are recovered (if entering this file from another for
|
||||
which autocommands did match). Note that "*" will also match files starting
|
||||
with ".", unlike Unix shells.
|
||||
|
||||
*autocmd-searchpat*
|
||||
Autocommands do not change the current search patterns. Vim saves the current
|
||||
search patterns before executing autocommands then restores them after the
|
||||
autocommands finish. This means that autocommands do not affect the strings
|
||||
highlighted with the 'hlsearch' option. Within autocommands, you can still
|
||||
use search patterns normally, e.g., with the "n" command.
|
||||
If you want an autocommand to set the search pattern, such that it is used
|
||||
after the autocommand finishes, use the ":let @/ =" command.
|
||||
The search-highlighting cannot be switched off with ":nohlsearch" in an
|
||||
autocommand. Use the 'h' flag in the 'viminfo' option to disable search-
|
||||
highlighting when starting Vim.
|
||||
|
||||
*Cmd-event*
|
||||
When using one of the "*Cmd" events, the matching autocommands are expected to
|
||||
do the file reading or writing. This can be used when working with a special
|
||||
kind of file, for example on a remote system.
|
||||
CAREFUL: If you use these events in a wrong way, it may have the effect of
|
||||
making it impossible to read or write the matching files! Make sure you test
|
||||
your autocommands properly. Best is to use a pattern that will never match a
|
||||
normal file name, for example "ftp://*".
|
||||
|
||||
When defining a BufReadCmd it will be difficult for Vim to recover a crashed
|
||||
editing session. When recovering from the original file, Vim reads only those
|
||||
parts of a file that are not found in the swap file. Since that is not
|
||||
possible with a BufReadCmd, use the |:preserve| command to make sure the
|
||||
original file isn't needed for recovery. You might want to do this only when
|
||||
you expect the file to be modified.
|
||||
|
||||
The |v:cmdarg| variable holds the "++enc=" and "++ff=" argument that are
|
||||
effective. These should be used for the command that reads/writes the file.
|
||||
|
||||
See the $VIMRUNTIME/plugin/netrw.vim for examples.
|
||||
-->
|
||||
|
||||
1417
help/txt/change.txt
1417
help/txt/change.txt
File diff suppressed because it is too large
Load Diff
@@ -1,969 +0,0 @@
|
||||
*cmdline.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 01
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
*Cmdline-mode* *Command-line-mode*
|
||||
Command-line mode *Cmdline* *Command-line* *mode-cmdline* *:*
|
||||
|
||||
Command-line mode is used to enter Ex commands (":"), search patterns
|
||||
("/" and "?"), and filter commands ("!").
|
||||
|
||||
Basic command line editing is explained in chapter 20 of the user manual
|
||||
|usr_20.txt|.
|
||||
|
||||
1. Command-line editing |cmdline-editing|
|
||||
2. Command-line completion |cmdline-completion|
|
||||
3. Ex command-lines |cmdline-lines|
|
||||
4. Ex command-line ranges |cmdline-ranges|
|
||||
5. Ex special characters |cmdline-special|
|
||||
6. Command-line window |cmdline-window|
|
||||
|
||||
==============================================================================
|
||||
1. Command-line editing *cmdline-editing*
|
||||
|
||||
Normally characters are inserted in front of the cursor position. You can
|
||||
move around in the command-line with the left and right cursor keys. With the
|
||||
<Insert> key, you can toggle between inserting and overstriking characters.
|
||||
|
||||
<!--
|
||||
Note that if your keyboard does not have working cursor keys or any of the
|
||||
other special keys, you can use ":cnoremap" to define another key for them.
|
||||
For example, to define tcsh style editing keys: *tcsh-style* >
|
||||
:cnoremap <C-A> <Home>
|
||||
:cnoremap <C-F> <Right>
|
||||
:cnoremap <C-B> <Left>
|
||||
:cnoremap <Esc>b <S-Left>
|
||||
:cnoremap <Esc>f <S-Right>
|
||||
(<> notation |<>|; type all this literally)
|
||||
-->
|
||||
|
||||
*cmdline-too-long*
|
||||
When the command line is getting longer than what fits on the screen, only the
|
||||
part that fits will be shown. The cursor can only move in this visible part,
|
||||
thus you cannot edit beyond that.
|
||||
|
||||
*cmdline-history* *history*
|
||||
The command-lines that you enter are remembered in a history table. You can
|
||||
recall them with the up and down cursor keys. There are actually four
|
||||
history tables:
|
||||
- one for ':' commands
|
||||
- one for search strings
|
||||
- one for expressions
|
||||
- one for input lines, typed for the |input()| function.
|
||||
These are completely separate. Each history can only be accessed when
|
||||
entering the same type of line.
|
||||
Use the 'history' option to set the number of lines that are remembered
|
||||
(default: 20).
|
||||
Notes:
|
||||
- When you enter a command-line that is exactly the same as an older one, the
|
||||
old one is removed (to avoid repeated commands moving older commands out of
|
||||
the history).
|
||||
- Only commands that are typed are remembered. Ones that completely come from
|
||||
mappings are not put in the history
|
||||
- All searches are put in the search history, including the ones that come
|
||||
from commands like "*" and "#". But for a mapping, only the last search is
|
||||
remembered (to avoid that long mappings trash the history).
|
||||
|
||||
There is an automatic completion of names on the command-line; see
|
||||
|cmdline-completion|.
|
||||
|
||||
*c_CTRL-V*
|
||||
CTRL-V Insert next non-digit literally. Up to three digits form the
|
||||
decimal value of a single byte. The non-digit and the three
|
||||
digits are not considered for mapping. This works the same
|
||||
way as in Insert mode (see above, |i_CTRL-V|).
|
||||
Note: Under Windows CTRL-V is often mapped to paste text.
|
||||
Use CTRL-Q instead then.
|
||||
*c_CTRL-Q*
|
||||
CTRL-Q Same as CTRL-V. But with some terminals it is used for
|
||||
control flow, it doesn't work then.
|
||||
|
||||
*c_<Left>*
|
||||
<Left> cursor left
|
||||
*c_<Right>*
|
||||
<Right> cursor right
|
||||
*c_<S-Left>*
|
||||
<S-Left> or <C-Left> *c_<C-Left>*
|
||||
cursor one WORD left
|
||||
*c_<S-Right>*
|
||||
<S-Right> or <C-Right> *c_<C-Right>*
|
||||
cursor one WORD right
|
||||
CTRL-B or <Home> *c_CTRL-B* *c_<Home>*
|
||||
cursor to beginning of command-line
|
||||
CTRL-E or <End> *c_CTRL-E* *c_<End>*
|
||||
cursor to end of command-line
|
||||
|
||||
*c_<LeftMouse>*
|
||||
<LeftMouse> cursor to position of mouse click.
|
||||
|
||||
CTRL-H *c_<BS>* *c_CTRL-H*
|
||||
<BS> delete the character in front of the cursor (see |:fixdel| if
|
||||
your <BS> key does not do what you want).
|
||||
*c_<Del>*
|
||||
<Del> delete the character under the cursor (at end of line:
|
||||
character before the cursor) (see |:fixdel| if your <Del>
|
||||
key does not do what you want).
|
||||
*c_CTRL-W*
|
||||
CTRL-W delete the word before the cursor
|
||||
*c_CTRL-U*
|
||||
CTRL-U remove all characters between the cursor position and
|
||||
the beginning of the line.
|
||||
Note: if the command-line becomes empty with one of the
|
||||
delete commands, Command-line mode is quit.
|
||||
*c_<Insert>*
|
||||
<Insert> Toggle between insert and overstrike.
|
||||
|
||||
*c_digraph*
|
||||
CTRL-K {char1} {char2} *c_CTRL-K*
|
||||
enter digraph (see |digraphs|).
|
||||
<!--
|
||||
When {char1} is a special
|
||||
key, the code for that key is inserted in <> form.
|
||||
-->
|
||||
|
||||
<!--
|
||||
CTRL-R {0-9a-z"%#:-=.} *c_CTRL-R* *c_<C-R>*
|
||||
Insert the contents of a numbered or named register. Between
|
||||
typing CTRL-R and the second character '"' will be displayed
|
||||
to indicate that you are expected to enter the name of a
|
||||
register.
|
||||
The text is inserted as if you typed it, but mappings and
|
||||
abbreviations are not used. Command-line completion through
|
||||
'wildchar' is not triggered though. And characters that end
|
||||
the command line are inserted literally (<Esc>, <CR>, <NL>,
|
||||
<C-C>). A <BS> or CTRL-W could still end the command line
|
||||
though, and remaining characters will then be interpreted in
|
||||
another mode, which might not be what you intended.
|
||||
Special registers:
|
||||
'"' the unnamed register, containing the text of
|
||||
the last delete or yank
|
||||
'%' the current file name
|
||||
'#' the alternate file name
|
||||
'*' the clipboard contents
|
||||
'/' the last search pattern
|
||||
':' the last command-line
|
||||
'-' the last small (less than a line) delete
|
||||
'.' the last inserted text
|
||||
'=' the expression register: you are prompted to
|
||||
enter an expression (see |expression|)
|
||||
See |registers| about registers.
|
||||
|
||||
CTRL-R CTRL-F *c_CTRL-R_CTRL-F* *c_<C-R>_<C-F>*
|
||||
CTRL-R CTRL-P *c_CTRL-R_CTRL-P* *c_<C-R>_<C-P>*
|
||||
CTRL-R CTRL-W *c_CTRL-R_CTRL-W* *c_<C-R>_<C-W>*
|
||||
CTRL-R CTRL-A *c_CTRL-R_CTRL-A* *c_<C-R>_<C-A>*
|
||||
Insert the object under the cursor:
|
||||
CTRL-F the Filename under the cursor
|
||||
CTRL-P the Filename under the cursor, expanded with
|
||||
'path' as in |gf|
|
||||
CTRL-W the Word under the cursor
|
||||
CTRL-A the WORD under the cursor; see |WORD|
|
||||
CTRL-F and CTRL-P: {only when +file_in_path feature is
|
||||
included}
|
||||
|
||||
*c_CTRL-R_CTRL-R* *c_<C-R>_<C-R>*
|
||||
*c_CTRL-R_CTRL-O* *c_<C-R>_<C-O>*
|
||||
CTRL-R CTRL-R {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
|
||||
CTRL-R CTRL-O {0-9a-z"%#:-=. CTRL-F CTRL-P CTRL-W CTRL-A}
|
||||
Insert register or object under the cursor. Works like
|
||||
|c_CTRL-R| but inserts the text literally. For example, if
|
||||
register a contains "xy^Hz" (where ^H is a backspace),
|
||||
"CTRL-R a" will insert "xz" while "CTRL-R CTRL-R a" will
|
||||
insert "xy^Hz".
|
||||
|
||||
*c_CTRL-Y*
|
||||
CTRL-Y When there is a modeless selection, copy the selection into
|
||||
the clipboard. |modeless-selection|
|
||||
If there is no selection CTRL-Y is inserted as a character.
|
||||
-->
|
||||
|
||||
CTRL-J *c_CTRL-J* *c_<NL>* *c_<CR>*
|
||||
<CR> or <NL> start entered command
|
||||
*c_<Esc>*
|
||||
<Esc> When typed and 'x' not present in 'cpoptions', quit
|
||||
Command-line mode without executing. In macros or when 'x'
|
||||
present in 'cpoptions', start entered command.
|
||||
*c_CTRL-C*
|
||||
CTRL-C quit command-line without executing
|
||||
|
||||
*c_<Up>*
|
||||
<Up> recall older command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
*c_<Down>*
|
||||
<Down> recall more recent command-line from history, whose beginning
|
||||
matches the current command-line (see below).
|
||||
|
||||
*c_<S-Up>* *c_<PageUp>*
|
||||
<S-Up> or <PageUp>
|
||||
recall older command-line from history
|
||||
*c_<S-Down>* *c_<PageDown>*
|
||||
<S-Down> or <PageDown>
|
||||
recall more recent command-line from history
|
||||
|
||||
<!--
|
||||
CTRL-D command-line completion (see |cmdline-completion|)
|
||||
'wildchar' option
|
||||
command-line completion (see |cmdline-completion|)
|
||||
CTRL-N command-line completion (see |cmdline-completion|)
|
||||
CTRL-P command-line completion (see |cmdline-completion|)
|
||||
CTRL-A command-line completion (see |cmdline-completion|)
|
||||
CTRL-L command-line completion (see |cmdline-completion|)
|
||||
|
||||
*c_CTRL-_*
|
||||
CTRL-_ a - switch between Hebrew and English keyboard mode, which is
|
||||
private to the command-line and not related to hkmap.
|
||||
This is useful when Hebrew text entry is required in the
|
||||
command-line, searches, abbreviations, etc. Applies only if
|
||||
Vim is compiled with the |+rightleft| feature and the
|
||||
'allowrevins' option is set.
|
||||
See |rileft.txt|.
|
||||
|
||||
b - switch between Farsi and English keyboard mode, which is
|
||||
private to the command-line and not related to fkmap. In
|
||||
Farsi keyboard mode the characters are inserted in reverse
|
||||
insert manner. This is useful when Farsi text entry is
|
||||
required in the command-line, searches, abbreviations, etc.
|
||||
Applies only if Vim is compiled with the |+farsi| feature.
|
||||
See |farsi.txt|.
|
||||
|
||||
*c_CTRL-^*
|
||||
CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
|
||||
Method.
|
||||
When typing a pattern for a search command and 'imsearch' is
|
||||
not -1, VAL is the value of 'imsearch', otherwise VAL is the
|
||||
value of 'iminsert'.
|
||||
When language mappings are defined:
|
||||
- If VAL is 1 (langmap mappings used) it becomes 0 (no langmap
|
||||
mappings used).
|
||||
- If VAL was not 1 it becomes 1, thus langmap mappings are
|
||||
enabled.
|
||||
When no language mappings are defined:
|
||||
- If VAL is 2 (Input Method is used) it becomes 0 (no input
|
||||
method used)
|
||||
- If VAL has another value it becomes 2, thus the Input Method
|
||||
is enabled.
|
||||
These language mappings are normally used to type characters
|
||||
that are different from what the keyboard produces. The
|
||||
'keymap' option can be used to install a whole number of them.
|
||||
When entering a command line, langmap mappings are switched
|
||||
off, since you are expected to type a command. After
|
||||
switching it on with CTRL-^, the new state is not used again
|
||||
for the next command or Search pattern.
|
||||
|
||||
For Emacs-style editing on the command-line see |emacs-keys|.
|
||||
-->
|
||||
|
||||
The <Up> and <Down> keys take the current command-line as a search string.
|
||||
The beginning of the next/previous command-lines are compared with this
|
||||
string. The first line that matches is the new command-line. When typing
|
||||
these two keys repeatedly, the same string is used again. For example, this
|
||||
can be used to find the previous substitute command: Type ":s" and then <Up>.
|
||||
The same could be done by typing <S-Up> a number of times until the desired
|
||||
command-line is shown. (Note: the shifted arrow keys do not work on all
|
||||
terminals)
|
||||
|
||||
*his* *:history*
|
||||
:his[tory] Print the history of last entered commands.
|
||||
|
||||
:his[tory] [{name}] [{first}][, [{last}]]
|
||||
List the contents of history {name} which can be:
|
||||
c[md] or : command-line history
|
||||
s[earch] or / search string history
|
||||
e[xpr] or = expression register history
|
||||
i[nput] or @ input line history
|
||||
a[ll] all of the above
|
||||
|
||||
If the numbers {first} and/or {last} are given, the respective
|
||||
range of entries from a history is listed. These numbers can
|
||||
be specified in the following form:
|
||||
*:history-indexing*
|
||||
A positive number represents the absolute index of an entry
|
||||
as it is given in the first column of a :history listing.
|
||||
This number remains fixed even if other entries are deleted.
|
||||
|
||||
A negative number means the relative position of an entry,
|
||||
counted from the newest entry (which has index -1) backwards.
|
||||
|
||||
Examples:
|
||||
List entries 6 to 12 from the search history: >
|
||||
:history / 6,12
|
||||
<
|
||||
List the recent five entries from all histories: >
|
||||
:history all -5,
|
||||
|
||||
==============================================================================
|
||||
2. Command-line completion *cmdline-completion*
|
||||
|
||||
Not currently supported by IdeaVim
|
||||
<!--
|
||||
When editing the command-line, a few commands can be used to complete the
|
||||
word before the cursor. This is available for:
|
||||
|
||||
- Command names: At the start of the command-line.
|
||||
- Tags: Only after the ":tag" command.
|
||||
- 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.
|
||||
- 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.
|
||||
|
||||
When Vim was compiled with the |+cmdline_compl| feature disabled, only file
|
||||
names, directories and help items can be completed.
|
||||
|
||||
These are the commands that can be used:
|
||||
|
||||
*c_CTRL-D*
|
||||
CTRL-D List names that match the pattern in front of the cursor.
|
||||
When showing file names, directories are highlighted (see
|
||||
'highlight' option). Names where 'suffixes' matches are moved
|
||||
to the end.
|
||||
*c_CTRL-I* *c_wildchar* *c_<Tab>*
|
||||
'wildchar' option
|
||||
A match is done on the pattern in front of the cursor. The
|
||||
match (if there are several, the first match) is inserted
|
||||
in place of the pattern. (Note: does not work inside a
|
||||
macro, because <Tab> or <Esc> are mostly used as 'wildchar',
|
||||
and these have a special meaning in some macros.) When typed
|
||||
again and there were multiple matches, the next
|
||||
match is inserted. After the last match, the first is used
|
||||
again (wrap around).
|
||||
The behavior can be changed with the 'wildmode' option.
|
||||
*c_CTRL-N*
|
||||
CTRL-N After using 'wildchar' which got multiple matches, go to next
|
||||
match. Otherwise recall more recent command-line from history.
|
||||
<S-Tab> *c_CTRL-P* *c_<S-Tab>*
|
||||
CTRL-P After using 'wildchar' which got multiple matches, go to
|
||||
previous match. Otherwise recall older command-line from
|
||||
history. <S-Tab> only works with the GUI, on the Amiga and
|
||||
with MS-DOS.
|
||||
*c_CTRL-A*
|
||||
CTRL-A All names that match the pattern in front of the cursor are
|
||||
inserted.
|
||||
*c_CTRL-L*
|
||||
CTRL-L A match is done on the pattern in front of the cursor. If
|
||||
there is one match, it is inserted in place of the pattern.
|
||||
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.
|
||||
|
||||
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
|
||||
'?' are accepted. '*' matches any string, '?' matches exactly one character.
|
||||
|
||||
If you like tcsh's autolist completion, you can use this mapping:
|
||||
:cnoremap X <C-L><C-D>
|
||||
(Where X is the command key to use, <C-L> is CTRL-L and <C-D> is CTRL-D)
|
||||
This will find the longest match and then list all matching files.
|
||||
|
||||
If you like tcsh's autolist completion, you can use the 'wildmode' option to
|
||||
emulate it. For example, this mimics autolist=ambiguous:
|
||||
:set wildmode=longest,list
|
||||
This will find the longest match with the first 'wildchar', then list all
|
||||
matching files with the next.
|
||||
|
||||
*suffixes*
|
||||
For file name completion you can use the 'suffixes' option to set a priority
|
||||
between files with almost the same name. If there are multiple matches,
|
||||
those files with an extension that is in the 'suffixes' option are ignored.
|
||||
The default is ".bak,~,.o,.h,.info,.swp,.obj", which means that files ending
|
||||
in ".bak", "~", ".o", ".h", ".info", ".swp" and ".obj" are sometimes ignored.
|
||||
It is impossible to ignore suffixes with two dots. Examples:
|
||||
|
||||
pattern: files: match: ~
|
||||
test* test.c test.h test.o test.c
|
||||
test* test.h test.o test.h and test.o
|
||||
test* test.i test.h test.c test.i and test.c
|
||||
|
||||
If there is more than one matching file (after ignoring the ones matching
|
||||
the 'suffixes' option) the first file name is inserted. You can see that
|
||||
there is only one match when you type 'wildchar' twice and the completed
|
||||
match stays the same. You can get to the other matches by entering
|
||||
'wildchar', CTRL-N or CTRL-P. All files are included, also the ones with
|
||||
extensions matching the 'suffixes' option.
|
||||
|
||||
To completely ignore files with some extension use 'wildignore'.
|
||||
|
||||
The old value of an option can be obtained by hitting 'wildchar' just after
|
||||
the '='. For example, typing 'wildchar' after ":set dir=" will insert the
|
||||
current value of 'dir'. This overrules file name completion for the options
|
||||
that take a file name.
|
||||
|
||||
If you would like using <S-Tab> for CTRL-P in an xterm, put this command in
|
||||
your .cshrc: >
|
||||
xmodmap -e "keysym Tab = Tab Find"
|
||||
And this in your .vimrc: >
|
||||
:cmap <Esc>[1~ <C-P>
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
3. Ex command-lines *cmdline-lines*
|
||||
|
||||
<!--
|
||||
The Ex commands have a few specialties:
|
||||
|
||||
*:quote*
|
||||
'"' at the start of a line causes the whole line to be ignored. '"'
|
||||
after a command causes the rest of the line to be ignored. This can be used
|
||||
to add comments. Example: >
|
||||
:set ai "set 'autoindent' option
|
||||
It is not possible to add a comment to a shell command ":!cmd" or to the
|
||||
":map" command and friends, because they see the '"' as part of their
|
||||
argument.
|
||||
|
||||
*:bar* *:\bar*
|
||||
'|' can be used to separate commands, so you can give multiple commands in one
|
||||
line. If you want to use '|' in an argument, precede it with '\'.
|
||||
|
||||
These commands see the '|' as their argument, and can therefore not be
|
||||
followed by another command:
|
||||
:argdo
|
||||
:autocmd
|
||||
:bufdo
|
||||
:command
|
||||
:cscope
|
||||
:debug
|
||||
:folddoopen
|
||||
:folddoclosed
|
||||
:global
|
||||
:help
|
||||
:helpfind
|
||||
:make
|
||||
:normal
|
||||
:perl
|
||||
:perldo
|
||||
:promptfind
|
||||
:promptrepl
|
||||
:pyfile
|
||||
:python
|
||||
:registers
|
||||
:read !
|
||||
:scscope
|
||||
:tcl
|
||||
:tcldo
|
||||
:tclfile
|
||||
:vglobal
|
||||
:windo
|
||||
:write !
|
||||
:[range]!
|
||||
a user defined command without the "-bar" argument |:command|
|
||||
|
||||
Note that this is confusing (inherited from Vi): With ":g" the '|' is included
|
||||
in the command, with ":s" it is not.
|
||||
|
||||
To be able to use another command anyway, use the ":execute" command.
|
||||
Example (append the output of "ls" and jump to the first line): >
|
||||
:execute 'r !ls' | '[
|
||||
|
||||
There is one exception: When the 'b' flag is present in 'cpoptions', with the
|
||||
":map" and ":abbr" commands and friends CTRL-V needs to be used instead of
|
||||
'\'. You can also use "<Bar>" instead. See also |map_bar|.
|
||||
|
||||
Examples: >
|
||||
:!ls | wc view the output of two commands
|
||||
:r !ls | wc insert the same output in the text
|
||||
:%g/foo/p|> moves all matching lines one shiftwidth
|
||||
:%s/foo/bar/|> moves one line one shiftwidth
|
||||
:map q 10^V| map "q" to "10|"
|
||||
:map q 10\| map \ l map "q" to "10\" and map "\" to "l"
|
||||
(when 'b' is present in 'cpoptions')
|
||||
|
||||
You can also use <NL> to separate commands in the same way as with '|'. To
|
||||
insert a <NL> use CTRL-V CTRL-J. "^@" will be shown. Using '|' is the
|
||||
preferred method. But for external commands a <NL> must be used, because a
|
||||
'|' is included in the external command. To avoid the special meaning of <NL>
|
||||
it must be preceded with a backslash. Example: >
|
||||
:r !date<NL>-join
|
||||
This reads the current date into the file and joins it with the previous line.
|
||||
|
||||
Note that when the command before the '|' generates an error, the following
|
||||
commands will not be executed.
|
||||
|
||||
|
||||
Because of Vi compatibility the following strange commands are supported: >
|
||||
:| print current line (like ":p")
|
||||
:3| print line 3 (like ":3p")
|
||||
:3 goto line 3
|
||||
|
||||
A colon is allowed between the range and the command name. It is ignored
|
||||
(this is Vi compatible). For example: >
|
||||
:1,$:s/pat/string
|
||||
|
||||
When the character '%' or '#' is used where a file name is expected, they are
|
||||
expanded to the current and alternate file name (see the chapter "editing
|
||||
files" |:_%| |:_#|).
|
||||
|
||||
Embedded spaces in file names are allowed on the Amiga if one file name is
|
||||
expected as argument. Trailing spaces will be ignored, unless escaped with a
|
||||
backslash or CTRL-V. Note that the ":next" command uses spaces to separate
|
||||
file names. Escape the spaces to include them in a file name. Example: >
|
||||
:next foo\ bar goes\ to school\
|
||||
starts editing the three files "foo bar", "goes to" and "school ".
|
||||
|
||||
When you want to use the special characters '"' or '|' in a command, or want
|
||||
to use '%' or '#' in a file name, precede them with a backslash. The
|
||||
backslash is not required in a range and in the ":substitute" command.
|
||||
-->
|
||||
|
||||
*:_!*
|
||||
The '!' (bang) character after an Ex command makes the command behave in a
|
||||
different way. The '!' should be placed immediately after the command, without
|
||||
any blanks in between. If you insert blanks the '!' will be seen as an
|
||||
argument for the command, which has a different meaning. For example:
|
||||
:w! name write the current buffer to file "name", overwriting
|
||||
any existing file
|
||||
:w !name send the current buffer as standard input to command
|
||||
"name"
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
4. Ex command-line ranges *cmdline-ranges* *[range]* *E16* *E493*
|
||||
|
||||
Some Ex commands accept a line range in front of them. This is noted as
|
||||
[range]. It consists of one or more line specifiers, separated with ',' or
|
||||
';'.
|
||||
|
||||
The basics are explained in section |10.3| of the user manual.
|
||||
|
||||
*:,* *:;*
|
||||
When separated with ';' the cursor position will be set to that line
|
||||
before interpreting the next line specifier. This doesn't happen for ','.
|
||||
Examples: >
|
||||
4,/this line/
|
||||
< from line 4 till match with "this line" after the cursor line. >
|
||||
5;/that line/
|
||||
< from line 5 till match with "that line" after line 5.
|
||||
|
||||
The default line specifier for most commands is the cursor position, but the
|
||||
commands ":write" and ":global" have the whole file (1,$) as default.
|
||||
|
||||
If more line specifiers are given than required for the command, the first
|
||||
one(s) will be ignored.
|
||||
|
||||
Line numbers may be specified with: *:range* *E14* *{address}*
|
||||
{number} an absolute line number
|
||||
. the current line *:.*
|
||||
$ the last line in the file *:$*
|
||||
% equal to 1,$ (the entire file) *:%*
|
||||
't position of mark t (lowercase) *:'*
|
||||
'T position of mark T (uppercase); when the mark is in
|
||||
another file it cannot be used in a range
|
||||
/{pattern}[/] the next line where {pattern} matches *:/*
|
||||
?{pattern}[?] the previous line where {pattern} matches *:?*
|
||||
\/ the next line where the previously used search
|
||||
pattern matches
|
||||
\? the previous line where the previously used search
|
||||
pattern matches
|
||||
\& the next line where the previously used substitute
|
||||
pattern matches
|
||||
|
||||
Each may be followed (several times) by '+' or '-' and an optional number.
|
||||
This number is added or subtracted from the preceding line number. If the
|
||||
number is omitted, 1 is used.
|
||||
|
||||
The "/" and "?" after {pattern} are required to separate the pattern from
|
||||
anything that follows.
|
||||
|
||||
The "/" and "?" may be preceded with another address. The search starts from
|
||||
there. The difference from using ';' is that the cursor isn't moved.
|
||||
Examples: >
|
||||
/pat1//pat2/ Find line containing "pat2" after line containing
|
||||
"pat1", without moving the cursor.
|
||||
7;/pat2/ Find line containing "pat2", after line 7, leaving
|
||||
the cursor in line 7.
|
||||
|
||||
The {number} must be between 0 and the number of lines in the file. When
|
||||
using a 0 (zero) this is interpreted as a 1 by most commands. Commands that
|
||||
use it as a count do use it as a zero. Some commands
|
||||
interpret the zero as "before the first line" (search pattern, etc).
|
||||
|
||||
Examples: >
|
||||
.+3 three lines below the cursor
|
||||
/that/+1 the line below the next line containing "that"
|
||||
.,$ from current line until end of file
|
||||
0;/that the first line containing "that", also matches in the
|
||||
first line.
|
||||
1;/that the first line after line 1 containing "that"
|
||||
|
||||
Some commands allow for a count after the command. This count is used as the
|
||||
number of lines to be used, starting with the line given in the last line
|
||||
specifier (the default is the cursor line). The commands that accept a count
|
||||
are the ones that use a range but do not have a file name argument (because
|
||||
a file name can also be a number).
|
||||
|
||||
Examples: >
|
||||
:s/x/X/g 5 substitute 'x' by 'X' in the current line and four
|
||||
following lines
|
||||
:23d 4 delete lines 23, 24, 25 and 26
|
||||
|
||||
|
||||
<!--
|
||||
Folds and Range
|
||||
|
||||
When folds are active the line numbers are rounded off to include the whole
|
||||
closed fold. See |fold-behavior|.
|
||||
|
||||
|
||||
Reverse Range
|
||||
|
||||
A range should have the lower line number first. If this is not the case, Vim
|
||||
will ask you if it should swap the line numbers. This is not done within the
|
||||
global command ":g".
|
||||
-->
|
||||
|
||||
|
||||
Count and Range *N:*
|
||||
|
||||
When giving a count before entering ":", this is translated into:
|
||||
:.,.+(count - 1)
|
||||
In words: The 'count' lines at and after the cursor. Example: To delete
|
||||
three lines: >
|
||||
3:d<CR> is translated into: .,.+2d<CR>
|
||||
<
|
||||
|
||||
Visual Mode and Range *v_:*
|
||||
|
||||
{Visual}: Starts a command-line with the Visual selected lines as a
|
||||
range. The code ":'<,'>" is used for this range, which makes
|
||||
it possible to select a similar line from the command-line
|
||||
history for repeating a command on different Visually selected
|
||||
lines.
|
||||
|
||||
==============================================================================
|
||||
5. Ex special characters *cmdline-special*
|
||||
|
||||
<!--
|
||||
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()|.
|
||||
% is replaced with the current file name *:_%*
|
||||
# is replaced with the alternate file name *:_#*
|
||||
#n (where n is a number) is replaced with the file name of
|
||||
buffer n. "#0" is the same as "#"
|
||||
## is replaced with all names in the argument list *:_##*
|
||||
concatenated, separated by spaces. Each space in a name
|
||||
is preceded with a backslash.
|
||||
Note that these give the file name as it was typed. If an absolute path is
|
||||
needed (when using the file name from a different directory), you need to add
|
||||
":p". See |filename-modifiers|.
|
||||
Note that backslashes are inserted before spaces, so that the command will
|
||||
correctly interpret the file name. But this doesn't happen for shell
|
||||
commands. For those you probably have to use quotes: >
|
||||
:!ls "%"
|
||||
:r !spell "%"
|
||||
|
||||
To avoid the special meaning of '%' and '#' insert a backslash before it.
|
||||
Detail: The special meaning is always escaped when there is a backslash before
|
||||
it, no matter how many backslashes.
|
||||
you type: result ~
|
||||
# alternate.file
|
||||
\# #
|
||||
\\# \#
|
||||
|
||||
*:<cword>* *:<cWORD>* *:<cfile>* *<cfile>*
|
||||
*:<sfile>* *<sfile>* *:<afile>* *<afile>*
|
||||
*:<abuf>* *<abuf>* *:<amatch>* *<amatch>*
|
||||
*E495* *E496* *E497* *E498* *E499* *E500*
|
||||
Note: these are typed literally, they are not special keys!
|
||||
<cword> is replaced with the word under the cursor (like |star|)
|
||||
<cWORD> is replaced with the WORD under the cursor (see |WORD|)
|
||||
<cfile> is replaced with the path name under the cursor (like what
|
||||
|gf| uses)
|
||||
<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).
|
||||
<amatch> when executing autocommands, is replaced with the match for
|
||||
which this autocommand was executed. It differs form
|
||||
<afile> only when the file name isn't used to match with
|
||||
(for FileType and Syntax events).
|
||||
<sfile> when executing a ":source" command, is replaced with the
|
||||
file name of the sourced file;
|
||||
when executing a function, is replaced with
|
||||
"function {function-name}"; function call nesting is
|
||||
indicated like this:
|
||||
"function {function-name1}..{function-name2}". Note that
|
||||
filename-modifiers are useless when <sfile> is used inside
|
||||
a function.
|
||||
|
||||
*filename-modifiers*
|
||||
*:_%:* *::p* *::.* *::~* *::h* *::t* *::r* *::e* *::s* *::gs*
|
||||
The file name modifiers can be used after "%", "#", "#n", "<cfile>", "<sfile>",
|
||||
"<afile>" or "<abuf>". They are also used with the |fnamemodify()| function.
|
||||
These are not available when Vim has been compiled without the |+modify_fname|
|
||||
feature.
|
||||
These modifiers can be given, in this order:
|
||||
:p Make file name a full path. Must be the first modifier. Also
|
||||
changes "~/" (and "~user/" for Unix and VMS) to the path for
|
||||
the home directory. If the name is a directory a path
|
||||
separator is added at the end. For a file name that does not
|
||||
exist and does not have an absolute path the result is
|
||||
unpredictable.
|
||||
:8 Converts the path to 8.3 short format (currently only on
|
||||
win32). Will act on as much of a path that is an existing
|
||||
path.
|
||||
:~ Reduce file name to be relative to the home directory, if
|
||||
possible. File name is unmodified if it is not below the home
|
||||
directory.
|
||||
:. Reduce file name to be relative to current directory, if
|
||||
possible. File name is unmodified if it is not below the
|
||||
current directory.
|
||||
For maximum shortness, use ":~:.".
|
||||
:h Head of the file name (the last component and any separators
|
||||
removed). Cannot be used with :e, :r or :t.
|
||||
Can be repeated to remove several components at the end.
|
||||
When the file name ends in a path separator, only the path
|
||||
separator is removed. Thus ":p:h" on a directory name results
|
||||
on the directory name itself (without trailing slash).
|
||||
When the file name is an absolute path (starts with "/" for
|
||||
Unix; "x:\" for MS-DOS, WIN32, OS/2; "drive:" for Amiga), that
|
||||
part is not removed. When there is no head (path is relative
|
||||
to current directory) the result is empty.
|
||||
:t Tail of the file name (last component of the name). Must
|
||||
precede any :r or :e.
|
||||
:r Root of the file name (the last extension removed). When
|
||||
there is only an extension (file name that starts with '.',
|
||||
e.g., ".vimrc"), it is not removed. Can be repeated to remove
|
||||
several extensions (last one first).
|
||||
:e Extension of the file name. Only makes sense when used alone.
|
||||
When there is no extension the result is empty.
|
||||
When there is only an extension (file name that starts with
|
||||
'.'), the result is empty. Can be repeated to include more
|
||||
extensions. If there are not enough extensions (but at least
|
||||
one) as much as possible are included.
|
||||
:s?pat?sub?
|
||||
Substitute the first occurrence of "pat" with "sub". This
|
||||
works like the |:s| command. "pat" is a regular expression.
|
||||
Any character can be used for '?', but it must not occur in
|
||||
"pat" or "sub".
|
||||
After this, the previous modifiers can be used again. For
|
||||
example ":p", to make a full path after the substitution.
|
||||
:gs?pat?sub?
|
||||
Substitute all occurrences of "path" with "sub". Otherwise
|
||||
this works like ":s".
|
||||
|
||||
Examples, when the file name is "src/version.c", current dir
|
||||
"/home/mool/vim": >
|
||||
:p /home/mool/vim/src/version.c
|
||||
:p:. src/version.c
|
||||
:p:~ ~/vim/src/version.c
|
||||
:h src
|
||||
:p:h /home/mool/vim/src
|
||||
:p:h:h /home/mool/vim
|
||||
:t version.c
|
||||
:p:t version.c
|
||||
:r src/version
|
||||
:p:r /home/mool/vim/src/version
|
||||
:t:r version
|
||||
:e c
|
||||
:s?version?main? src/main.c
|
||||
:s?version?main?:p /home/mool/vim/src/main.c
|
||||
:p:gs?/?\\? \home\mool\vim\src\version.c
|
||||
|
||||
Examples, when the file name is "src/version.c.gz": >
|
||||
:p /home/mool/vim/src/version.c.gz
|
||||
:e gz
|
||||
:e:e c.gz
|
||||
:e:e:e c.gz
|
||||
:e:e:r c
|
||||
:r src/version.c
|
||||
:r:e c
|
||||
:r:r src/version
|
||||
:r:r:r src/version
|
||||
<
|
||||
*extension-removal* *:_%<*
|
||||
If a "<" is appended to "%", "#", "#n" or "CTRL-V p" the extension of the file
|
||||
name is removed (everything after and including the last '.' in the file
|
||||
name). This is included for backwards compatibility with version 3.0, the
|
||||
":r" form is preferred. Examples: >
|
||||
|
||||
% current file name
|
||||
%< current file name without extension
|
||||
# alternate file name for current window
|
||||
#< idem, without extension
|
||||
#31 alternate file number 31
|
||||
#31< idem, without extension
|
||||
<cword> word under the cursor
|
||||
<cWORD> WORD under the cursor (see |WORD|)
|
||||
<cfile> path name under the cursor
|
||||
<cfile>< idem, without extension
|
||||
|
||||
Note: Where a file name is expected wildcards expansion is done. On Unix the
|
||||
shell is used for this, unless it can be done internally (for speed).
|
||||
Backticks also work, like in >
|
||||
:n `echo *.c`
|
||||
(backtick expansion is not possible in |restricted-mode|)
|
||||
But expansion is only done if there are any wildcards before expanding the
|
||||
'%', '#', etc.. This avoids expanding wildcards inside a file name. If you
|
||||
want to expand the result of <cfile>, add a wildcard character to it.
|
||||
Examples: (alternate file name is "?readme?")
|
||||
command expands to ~
|
||||
:e # :e ?readme?
|
||||
:e `ls #` :e {files matching "?readme?"}
|
||||
:e #.* :e {files matching "?readme?.*"}
|
||||
:cd <cfile> :cd {file name under cursor}
|
||||
:cd <cfile>* :cd {file name under cursor plus "*" and then expanded}
|
||||
|
||||
When the expanded argument contains a "!" and it is used for a shell command
|
||||
(":!cmd", ":r !cmd" or ":w !cmd"), it is escaped with a backslash to avoid it
|
||||
being expanded into a previously used command. When the 'shell' option
|
||||
contains "sh", this is done twice, to avoid the shell trying to expand the
|
||||
"!".
|
||||
|
||||
*filename-backslash*
|
||||
For filesystems that use a backslash as directory separator (MS-DOS, Windows,
|
||||
OS/2), it's a bit difficult to recognize a backslash that is used to escape
|
||||
the special meaning of the next character. The general rule is: If the
|
||||
backslash is followed by a normal file name character, it does not have a
|
||||
special meaning. Therefore "\file\foo" is a valid file name, you don't have
|
||||
to type the backslash twice.
|
||||
|
||||
An exception is the '$' sign. It is a valid character in a file name. But
|
||||
to avoid a file name like "$home" to be interpreted as an environment variable,
|
||||
it needs to be preceded by a backslash. Therefore you need to use "/\$home"
|
||||
for the file "$home" in the root directory. A few examples:
|
||||
|
||||
FILE NAME INTERPRETED AS ~
|
||||
$home expanded to value of environment var $home
|
||||
\$home file "$home" in current directory
|
||||
/\$home file "$home" in root directory
|
||||
\\$home file "\\", followed by expanded $home
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
6. Command-line window *cmdline-window* *cmdwin*
|
||||
|
||||
<!--
|
||||
In the command-line window the command line can be edited just like editing
|
||||
text in any window. It is a special kind of window, because you cannot leave
|
||||
it in a normal way.
|
||||
{not available when compiled without the |+cmdline_hist| or |+vertsplit|
|
||||
feature}
|
||||
|
||||
|
||||
OPEN
|
||||
|
||||
There are two ways to open the command-line window:
|
||||
1. From Command-line mode, use the key specified with the 'cedit' option.
|
||||
The default is CTRL-F when 'compatible' is not set.
|
||||
2. From Normal mode, use the "q:", "q/" or "q?" command. *q:* *q/* *q?*
|
||||
This starts editing an Ex command-line ("q:") or search string ("q/" or
|
||||
"q?"). Note that this is not possible while recording is in progress (the
|
||||
"q" stops recording then).
|
||||
|
||||
When the window opens it is filled with the command-line history. The last
|
||||
line contains the command as typed so far. The left column will show a
|
||||
character that indicates the type of command-line being edited, see
|
||||
|cmdwin-char|.
|
||||
|
||||
Vim will be in Normal mode when the editor is opened, except when 'insertmode'
|
||||
is set.
|
||||
|
||||
The height of the window is specified with 'cmdwinheight' (or smaller if there
|
||||
is no room). The window is always full width and is positioned just above the
|
||||
command-line.
|
||||
|
||||
|
||||
EDIT
|
||||
|
||||
You can now use commands to move around and edit the text in the window. Both
|
||||
in Normal mode and Insert mode.
|
||||
|
||||
It is possible to use ":", "/" and other commands that use the command-line,
|
||||
but it's not possible to open another command-line window then. There is no
|
||||
nesting.
|
||||
*E11*
|
||||
The command-line window is not a normal window. It is not possible to move to
|
||||
another window or edit another buffer. All commands that would do this are
|
||||
disabled in the command-line window. Of course it _is_ possible to execute
|
||||
any command that you entered in the command-line window.
|
||||
|
||||
|
||||
CLOSE *E199*
|
||||
|
||||
There are several ways to leave the command-line window:
|
||||
|
||||
<CR> Execute the command-line under the cursor. Works both in
|
||||
Insert and in Normal mode.
|
||||
CTRL-C Continue in Command-line mode. The command-line under the
|
||||
cursor is used as the command-line. Works both in Insert and
|
||||
in Normal mode. ":close" also works. There is no redraw,
|
||||
thus the window will remain visible.
|
||||
:quit Discard the command line and go back to Normal mode.
|
||||
":exit", ":xit" and CTRL-\ CTRL-N also work.
|
||||
:qall Quit Vim, unless there are changes in some buffer.
|
||||
:qall! Quit Vim, discarding changes to any buffer.
|
||||
|
||||
Once the command-line window is closed the old window sizes are restored. The
|
||||
executed command applies to the window and buffer where the command-line was
|
||||
started from. This works as if the command-line window was not there, except
|
||||
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.
|
||||
|
||||
|
||||
VARIOUS
|
||||
|
||||
The command-line window cannot be used:
|
||||
- when there already is a command-line window (no nesting)
|
||||
- for entering a encryption key or when using inputsecret()
|
||||
- when Vim was not compiled with the +vertsplit feature
|
||||
|
||||
Some options are set when the command-line window is opened:
|
||||
'filetype' "vim", when editing an Ex command-line; this starts Vim syntax
|
||||
highlighting if it was enabled
|
||||
'rightleft' off
|
||||
'modifiable' on
|
||||
'buftype' "nofile"
|
||||
'swapfile' off
|
||||
|
||||
It is allowed to write the buffer contents to a file. This is an easy way to
|
||||
save the command-line history and read it back later.
|
||||
|
||||
If the 'wildchar' option is set to <Tab>, and the command-line window is used
|
||||
for an Ex command, then two mappings will be added to use <Tab> for completion
|
||||
in the command-line window, like this: >
|
||||
:imap <buffer> <Tab> <C-X><C-V>
|
||||
:nmap <buffer> <Tab> a<C-X><C-V>
|
||||
Note that hitting <Tab> in Normal mode will do completion on the next
|
||||
character. That way it works at the end of the line.
|
||||
If you don't want these mappings, disable them with: >
|
||||
au CmdwinEnter [:>] iunmap <Tab>
|
||||
au CmdwinEnter [:>] nunmap <Tab>
|
||||
You could put these lines in your vimrc file.
|
||||
|
||||
While in the command-line window you cannot use the mouse to put the cursor in
|
||||
another window, or drag statuslines of other windows. You can drag the
|
||||
statusline of the command-line window itself and the statusline above it.
|
||||
Thus you can resize the command-line window, but not others.
|
||||
|
||||
|
||||
AUTOCOMMANDS
|
||||
|
||||
Two autocommand events are used: |CmdwinEnter| and |CmdwinLeave|. Since this
|
||||
window is of a special type, the WinEnter, WinLeave, BufEnter and BufLeave
|
||||
events are not triggered. You can use the Cmdwin events to do settings
|
||||
specifically for the command-line window. Be careful not to cause side
|
||||
effects!
|
||||
Example: >
|
||||
:au CmdwinEnter : let b:cpt_save = &cpt | set cpt=v
|
||||
:au CmdwinLeave : let &cpt = b:cpt_save
|
||||
This sets 'complete' to use command-line completion in Insert mode for CTRL-N.
|
||||
Another example: >
|
||||
:au CmdwinEnter [/?] startinsert
|
||||
This will make Vim start in Insert mode in the command-line window.
|
||||
|
||||
*cmdwin-char*
|
||||
The character used for the pattern indicates the type of command-line:
|
||||
: normal Ex command
|
||||
> debug mode command |debug-mode|
|
||||
/ forward search string
|
||||
? backward search string
|
||||
= expression for "= |expr-register|
|
||||
@ string for |input()|
|
||||
- text for |:insert| or |:append|
|
||||
-->
|
||||
|
||||
@@ -1,137 +0,0 @@
|
||||
*debugger.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Debugger Support Features *debugger-support*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Debugger Features |debugger-features|
|
||||
2. Vim Compile Options |debugger-compilation|
|
||||
3. Integrated Debuggers |debugger-integration|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
|
||||
==============================================================================
|
||||
1. Debugger Features *debugger-features*
|
||||
|
||||
The following features are available for an integration with a debugger or
|
||||
an Integrated Programming Environment (IPE) or Integrated Development
|
||||
Environment (IDE):
|
||||
|
||||
Alternate Command Input |alt-input|
|
||||
Debug Signs |debug-signs|
|
||||
Debug Source Highlight |debug-highlight|
|
||||
Message Footer |gui-footer|
|
||||
Balloon Evaluation |balloon-eval|
|
||||
|
||||
These features were added specifically for use in the Motif version of gvim.
|
||||
However, the |alt-input| and |debug-highlight| were written to be usable in
|
||||
both vim and gvim. Some of the other features could be used in the non-GUI
|
||||
vim with slight modifications. However, I did not do this nor did I test the
|
||||
reliability of building for vim or non Motif GUI versions.
|
||||
|
||||
|
||||
1.1 Alternate Command Input *alt-input*
|
||||
|
||||
For Vim to work with a debugger there must be at least an input connection
|
||||
with a debugger or external tool. In many cases there will also be an output
|
||||
connection but this isn't absolutely necessary.
|
||||
|
||||
The purpose of the input connection is to let the external debugger send
|
||||
commands to Vim. The commands sent by the debugger should give the debugger
|
||||
enough control to display the current debug environment and state.
|
||||
|
||||
The current implementation is based on the X Toolkit dispatch loop and the
|
||||
XtAddInput() function call.
|
||||
|
||||
|
||||
1.2 Debug Signs *debug-signs*
|
||||
|
||||
Many debuggers mark specific lines by placing a small sign or color highlight
|
||||
on the line. The |:sign| command lets the debugger set this graphic mark. Some
|
||||
examples where this feature would be used would be a debugger showing an arrow
|
||||
representing the Program Counter (PC) of the program being debugged. Another
|
||||
example would be a small stop sign for a line with a breakpoint. These visible
|
||||
highlights let the user keep track of certain parts of the state of the
|
||||
debugger.
|
||||
|
||||
This feature can be used with more than debuggers, too. An IPE can use a sign
|
||||
to highlight build errors, searched text, or other things. The sign feature
|
||||
can also work together with the |debug-highlight| to ensure the mark is
|
||||
highly visible.
|
||||
|
||||
Debug signs are defined and placed using the |:sign| command.
|
||||
|
||||
|
||||
1.3 Debug Source Highlight *debug-highlight*
|
||||
|
||||
This feature allows a line to have a predominant highlight. The highlight is
|
||||
intended to make a specific line stand out. The highlight could be made to
|
||||
work for both vim and gvim, whereas the debug sign is, in most cases, limited
|
||||
to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm
|
||||
from Sun has a "sign gutter" for showing signs.
|
||||
|
||||
|
||||
1.4 Message Footer *gui-footer*
|
||||
|
||||
The message footer can be used to display messages from a debugger or IPE. It
|
||||
can also be used to display menu and toolbar tips. The footer area is at the
|
||||
bottom of the GUI window, below the line used to display colon commands.
|
||||
|
||||
The display of the footer is controlled by the 'guioptions' letter 'F'.
|
||||
|
||||
|
||||
1.5 Balloon Evaluation *balloon-eval*
|
||||
|
||||
This feature allows a debugger, or other external tool, to display dynamic
|
||||
information based on where the mouse is pointing. The purpose of this feature
|
||||
was to allow Sun's Visual WorkShop debugger to display expression evaluations.
|
||||
However, the feature was implemented in as general a manner as possible and
|
||||
could be used for displaying other information as well.
|
||||
|
||||
The Balloon Evaluation has some settable parameters too. The font list and
|
||||
colors can be set via X resources (XmNballoonEvalFontList,
|
||||
XmNballoonEvalBackground, and XmNballoonEvalForeground).
|
||||
The 'balloondelay' option sets the delay before an attempt is made to show a
|
||||
balloon.
|
||||
The 'ballooneval' option needs to be set to switch it on.
|
||||
|
||||
Balloon evaluation is only available when compiled with the |+balloon_eval|
|
||||
and |+sun_workshop| features.
|
||||
|
||||
The Balloon evaluation functions are also used to show a tooltip for the
|
||||
toolbar. The 'ballooneval' option does not need to be set for this. But the
|
||||
other settings apply.
|
||||
|
||||
==============================================================================
|
||||
2. Vim Compile Options *debugger-compilation*
|
||||
|
||||
The debugger features were added explicitly for use with Sun's Visual
|
||||
WorkShop Integrated Programming Environment (ipe). However, they were done
|
||||
in as generic a manner as possible so that integration with other debuggers
|
||||
could also use some or all of the tools used with Sun's ipe.
|
||||
|
||||
The following compile time preprocessor variables control the features:
|
||||
|
||||
Alternate Command Input ALT_X_INPUT
|
||||
Debug Glyphs FEAT_SIGNS
|
||||
Debug Highlights FEAT_SIGNS
|
||||
Message Footer FEAT_FOOTER
|
||||
Balloon Evaluation FEAT_BEVAL
|
||||
|
||||
The first integration with a full IPE/IDE was with Sun Visual WorkShop. To
|
||||
compile a gvim which interfaces with VWS set the following flag, which sets
|
||||
all the above flags:
|
||||
|
||||
Sun Visual WorkShop FEAT_SUN_WORKSHOP
|
||||
|
||||
==============================================================================
|
||||
3. Integrated Debuggers *debugger-integration*
|
||||
|
||||
Currently the only fully integrated debugger/IPE/IDE is Sun's Visual WorkShop
|
||||
Integrated Programming Environment.
|
||||
-->
|
||||
|
||||
@@ -1,362 +0,0 @@
|
||||
*diff.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
*diff* *vimdiff* *gvimdiff* *diff-mode*
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
This file describes the +diff feature: Showing differences between two or
|
||||
three versions of the same file.
|
||||
|
||||
The basics are explained in section |08.7| of the user manual.
|
||||
|
||||
1. Starting diff mode |vimdiff|
|
||||
2. Viewing diffs |view-diffs|
|
||||
3. Jumping to diffs |jumpto-diffs|
|
||||
4. Copying diffs |copy-diffs|
|
||||
5. Diff options |diff-options|
|
||||
|
||||
==============================================================================
|
||||
1. Starting diff mode
|
||||
|
||||
The easiest way to start editing in diff mode is with the "vimdiff" command.
|
||||
This starts Vim as usual, and additionally sets up for viewing the differences
|
||||
between the arguments. >
|
||||
|
||||
vimdiff file1 file2 [file3 [file4]]
|
||||
|
||||
This is equivalent to: >
|
||||
|
||||
vim -d file1 file2 [file3 [file4]]
|
||||
|
||||
You may also use "gvimdiff" or "vim -g". The GUI is started then.
|
||||
You may also use "viewdiff" or "gviewdiff". Vim starts in readonly mode then.
|
||||
"r" may be prepended for restricted mode (see |-Z|).
|
||||
|
||||
The second and following arguments may also be a directory name. Vim will
|
||||
then append the file name of the first argument to the directory name to find
|
||||
the file.
|
||||
|
||||
This only works when a standard "diff" command is available. See 'diffexpr'.
|
||||
|
||||
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]
|
||||
|
||||
In each of the edited files these options are set:
|
||||
|
||||
'diff' on
|
||||
'scrollbind' on
|
||||
'scrollopt' includes "hor"
|
||||
'wrap' off
|
||||
'foldmethod' "diff"
|
||||
'foldcolumn' 2
|
||||
|
||||
These options are set local to the window. Thus when splitting the window or
|
||||
editing another file they are reset to the global value.
|
||||
|
||||
The differences shown are actually the differences in the buffer. Thus if you
|
||||
make changes after loading a file, these will be included in the displayed
|
||||
diffs. You might have to do ":diffupdate" now and then, not all changes are
|
||||
immediately taken into account.
|
||||
|
||||
In your .vimrc file you could do something special when Vim was started in
|
||||
diff mode. You could use a construct like this: >
|
||||
|
||||
if &diff
|
||||
setup for diff mode
|
||||
else
|
||||
setup for non-diff mode
|
||||
endif
|
||||
|
||||
While already in Vim you can start diff mode in three ways.
|
||||
|
||||
*E98*
|
||||
:diffsplit {filename} *:diffs* *:diffsplit*
|
||||
Open a new window on the file {filename}. The options are set
|
||||
as for "vimdiff" for the current and the newly opened window.
|
||||
Also see 'diffexpr'.
|
||||
|
||||
*:difft* *:diffthis*
|
||||
:diffthis Make the current window part of the diff windows. This sets
|
||||
the option like for "vimdiff".
|
||||
|
||||
:diffpatch {patchfile} *:diffp* *:diffpatch*
|
||||
Use the current buffer, patch it with the diff found in
|
||||
{patchfile} and open a buffer on the result. The options are
|
||||
set as for "vimdiff".
|
||||
{patchfile} can be in any format that the "patch" program
|
||||
understands or 'patchexpr' can handle.
|
||||
Note that {patchfile} should only contain a diff for one file,
|
||||
the current file. If {patchfile} contains diffs for other
|
||||
files as well, the results are unpredictable. Vim changes
|
||||
directory to /tmp to avoid files in the current directory
|
||||
accidentally being patched. But it may still result in
|
||||
various ".rej" files to be created. And when absolute path
|
||||
names are present these files may get patched anyway.
|
||||
|
||||
To make these commands use a vertical split, prepend |:vertical|. Examples: >
|
||||
|
||||
:vert diffsplit main.c~
|
||||
:vert diffpatch /tmp/diff
|
||||
<
|
||||
*E96*
|
||||
There can be up to four buffers with 'diff' set.
|
||||
|
||||
Since the option values are remembered with the buffer, you can edit another
|
||||
file for a moment and come back to the same file and be in diff mode again.
|
||||
If you don't want diff mode, reset the 'diff' option. And you probably want
|
||||
to get rid of the fold column: >
|
||||
|
||||
:set nodiff
|
||||
:set foldcolumn=0
|
||||
|
||||
==============================================================================
|
||||
2. Viewing diffs *view-diffs*
|
||||
|
||||
The effect is that the diff windows show the same text, with the differences
|
||||
highlighted. When scrolling the text, the 'scrollbind' option will make the
|
||||
text in other windows to be scrolled as well. With vertical splits the text
|
||||
should be aligned properly.
|
||||
|
||||
The alignment of text will go wrong when:
|
||||
- 'wrap' is on, some lines will be wrapped and occupy two or more screen
|
||||
lines
|
||||
- folds are open in one window but not another
|
||||
- 'scrollbind' is off
|
||||
- changes have been made to the text
|
||||
- "filler" is not present in 'diffopt', deleted/inserted lines makes the
|
||||
alignment go wrong
|
||||
|
||||
All the buffers edited in a window where the 'diff' option is set will join in
|
||||
the diff. This is also possible for hidden buffers. They must have been
|
||||
edited in a window first for this to be possible.
|
||||
|
||||
Since 'diff' is a window-local option, it's possible to view the same buffer
|
||||
in diff mode in one window and "normal" in another window. It is also
|
||||
possible to view the changes you have made to a buffer, but since Vim doesn't
|
||||
allow having two buffers for the same file, you need to make a copy the
|
||||
original file and diff with that. For example: >
|
||||
:!cp % tempfile
|
||||
:diffsplit tempfile
|
||||
|
||||
A buffer that is unloaded cannot be used for the diff. But it does work for
|
||||
hidden buffers. You can use ":hide" to close a window without unloading the
|
||||
buffer.
|
||||
|
||||
|
||||
*:diffu* *:diffupdate*
|
||||
Vim attempts to keep the differences updated when you make changes to the
|
||||
text. This mostly takes care of inserted and deleted lines. Changes within a
|
||||
line and more complicated changes do not cause the differences to be updated.
|
||||
To force the differences to be updated use: >
|
||||
|
||||
:diffupdate
|
||||
|
||||
|
||||
Vim will show filler lines for lines that are missing in one window but are
|
||||
present in another. These lines were inserted in another file or deleted in
|
||||
this file. Removing "filler" from the 'diffopt' option will make Vim not
|
||||
display these filler lines.
|
||||
|
||||
|
||||
Folds are used to hide the text that wasn't changed. See |folding| for all
|
||||
the commands that can be used with folds.
|
||||
|
||||
The context of lines above a difference that are not included in the fold can
|
||||
be set with the 'diffopt' option. For example, to set the context to three
|
||||
lines: >
|
||||
|
||||
:set diffopt=filler,context:3
|
||||
|
||||
|
||||
The diffs are highlighted with these groups:
|
||||
|
||||
|hl-DiffAdd| DiffAdd Added (inserted) lines. These lines exist in
|
||||
this buffer but not in another.
|
||||
|hl-DiffChange| DiffChange Changed lines.
|
||||
|hl-DiffText| DiffText Changed text inside a Changed line. Vim
|
||||
finds the first character that is different,
|
||||
and the last character that is different
|
||||
(searching from the end of the line). The
|
||||
text in between is highlighted. This means
|
||||
that parts in the middle that are still the
|
||||
same are highlighted anyway.
|
||||
|hl-DiffDelete| DiffDelete Deleted lines. Also called filler lines,
|
||||
because they don't really exist in this
|
||||
buffer.
|
||||
|
||||
==============================================================================
|
||||
3. Jumping to diffs *jumpto-diffs*
|
||||
|
||||
Two commands can be used to jump to diffs:
|
||||
*[c*
|
||||
[c Jump backwards to the previous start of a change.
|
||||
When a count is used, do it that many times.
|
||||
*]c*
|
||||
]c Jump forwards to the next start of a change.
|
||||
When a count is used, do it that many times.
|
||||
|
||||
It is an error if there is no change for the cursor to move to.
|
||||
|
||||
==============================================================================
|
||||
4. Diff copying *copy-diffs* *E99* *E100* *E101* *E102* *E103*
|
||||
|
||||
There are two commands to copy text from one buffer to another. The result is
|
||||
that the buffers will be equal within the specified range.
|
||||
|
||||
*:diffg* *:diffget*
|
||||
:[range]diffg[et] [bufspec]
|
||||
Modify the current buffer to undo difference with another
|
||||
buffer. If [bufspec] is given, that buffer is used.
|
||||
Otherwise this only works if there is one other buffer in diff
|
||||
mode.
|
||||
See below for [range].
|
||||
|
||||
*:diffpu* *:diffput*
|
||||
:[range]diffpu[t] [bufspec]
|
||||
Modify another buffer to undo difference with the current
|
||||
buffer. Just like ":diffget" but the other buffer is modified
|
||||
instead of the current one.
|
||||
See below for [range].
|
||||
|
||||
*do*
|
||||
do Same as ":diffget" without argument or range. The "o" stands
|
||||
for "obtain" ("dg" can't be used for this!).
|
||||
|
||||
*dp*
|
||||
dp Same as ":diffput" without argument or range.
|
||||
|
||||
When no [range] is given, the diff at the cursor position or just above it is
|
||||
affected. When [range] is used, Vim tries to only put or get the specified
|
||||
lines. When there are deleted lines, this may not always be possible.
|
||||
|
||||
The [bufspec] argument above can be a buffer number, a pattern for a buffer
|
||||
name or a part of a buffer name. Examples:
|
||||
|
||||
:diffget Use the other buffer which is in diff mode
|
||||
:diffget 3 Use buffer 3
|
||||
:diffget v2 Use the buffer which matches "v2" and is in
|
||||
diff mode (e.g., "file.c.v2")
|
||||
|
||||
Note that deleted lines are displayed, but not counted as text lines. You
|
||||
can't move the cursor into them. To fill the deleted lines with the lines
|
||||
from another buffer use ":diffget" on the line below them.
|
||||
|
||||
There can be deleted lines below the last line of the buffer. To be able to
|
||||
get those lines from another buffer it's allowed to use the last line number
|
||||
plus one. This command gets all diffs from the other buffer: >
|
||||
|
||||
:1,$+1diffget
|
||||
|
||||
==============================================================================
|
||||
5. Diff options *diff-options*
|
||||
|
||||
Also see |'diffopt'| and the "diff" item of |'fillchars'|.
|
||||
|
||||
|
||||
FINDING THE DIFFERENCES *diff-diffexpr*
|
||||
|
||||
The 'diffexpr' option can be set to use something else than the standard
|
||||
"diff" program to compare two files and find the differences.
|
||||
|
||||
When 'diffexpr' is empty, Vim uses this command to find the differences
|
||||
between file1 and file2: >
|
||||
|
||||
diff file1 file2 > outfile
|
||||
|
||||
The ">" is replaced with the value of 'shellredir'.
|
||||
|
||||
The output of "diff" must be a normal "ed" style diff. Do NOT use a context
|
||||
diff. This example explains the format that Vim expects: >
|
||||
|
||||
1a2
|
||||
> bbb
|
||||
4d4
|
||||
< 111
|
||||
7c7
|
||||
< GGG
|
||||
---
|
||||
> ggg
|
||||
|
||||
The "1a2" item appends the line "bbb".
|
||||
The "4d4" item deletes the line "111".
|
||||
The '7c7" item replaces the line "GGG" with "ggg".
|
||||
|
||||
When 'diffexpr' is not empty, Vim evaluates to obtain a diff file in the
|
||||
format mentioned. These variables are set to the file names used:
|
||||
|
||||
v:fname_in original file
|
||||
v:fname_new new version of the same file
|
||||
v:fname_out resulting diff file
|
||||
|
||||
Additionally, 'diffexpr' should take care of "icase" and "iwhite" in the
|
||||
'diffopt' option. 'diffexpr' cannot change the value of 'lines' and
|
||||
'columns'.
|
||||
|
||||
Example (this does the same as 'diffexpr' being empty, but adds the "-a"
|
||||
flag to force comparing them as text): >
|
||||
|
||||
set diffexpr=MyDiff()
|
||||
function MyDiff()
|
||||
let opt = ""
|
||||
if &diffopt =~ "icase"
|
||||
let opt = opt . "-i "
|
||||
endif
|
||||
if &diffopt =~ "iwhite"
|
||||
let opt = opt . "-b "
|
||||
endif
|
||||
silent execute "!diff -a " . opt . v:fname_in . " " . v:fname_new .
|
||||
\ " > " . v:fname_out
|
||||
endfunction
|
||||
<
|
||||
*E97*
|
||||
Vim will do a test if the diff output looks alright. If it doesn't, you will
|
||||
get an error message. Possible causes:
|
||||
- The "diff" program cannot be executed.
|
||||
- The "diff" program doesn't produce normal "ed" style diffs (see above).
|
||||
- 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.
|
||||
|
||||
|
||||
USING PATCHES *diff-patchexpr*
|
||||
|
||||
The 'patchexpr' option can be set to use something else than the standard
|
||||
"patch" program.
|
||||
|
||||
When 'patchexpr' is empty, Vim will call the "patch" program like this: >
|
||||
|
||||
patch -o outfile origfile < patchfile
|
||||
|
||||
This should work fine with most versions of the "patch" program. Note that a
|
||||
CR in the middle of a line may cause problems, it is seen as a line break.
|
||||
|
||||
If the default doesn't work for you, set the 'patchexpr' to an expression that
|
||||
will have the same effect. These variables are set to the file names used:
|
||||
|
||||
v:fname_in original file
|
||||
v:fname_diff patch file
|
||||
v:fname_out resulting patched file
|
||||
|
||||
Example (this does the same as 'patchexpr' being empty): >
|
||||
|
||||
let patchexpr=MyPatch
|
||||
function MyPatch
|
||||
:call system("patch -o " . v:fname_out . " " . v:fname_in .
|
||||
\ " < " . v:fname_diff)
|
||||
endfunction
|
||||
|
||||
Make sure that using the "patch" program doesn't have unwanted side effects.
|
||||
For example, watch out for additionally generated files, which should be
|
||||
deleted. It should just patch the file and nothing else.
|
||||
Vim will change directory to "/tmp" or another temp directory before
|
||||
evaluating 'patchexpr'. This hopefully avoids that files in the current
|
||||
directory are accidentally patched. Vim will also delete files starting with
|
||||
v:fname_in and ending in ".rej" and ".orig".
|
||||
-->
|
||||
|
||||
@@ -1,321 +0,0 @@
|
||||
*digraph.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Digraphs *digraphs* *Digraphs*
|
||||
|
||||
Digraphs are used to enter characters that normally cannot be entered by
|
||||
an ordinary keyboard. These are mostly accented characters which have the
|
||||
eighth bit set. The digraphs are easier to remember than the decimal number
|
||||
that can be entered with CTRL-V (see |i_CTRL-V|).
|
||||
|
||||
There is a brief introduction on digraphs in the user manual: |24.9|
|
||||
An alternative is using the 'keymap' option.
|
||||
|
||||
1. Defining digraphs |digraphs-define|
|
||||
2. Using digraphs |digraphs-use|
|
||||
3. Default digraphs |digraphs-default|
|
||||
|
||||
==============================================================================
|
||||
1. Defining digraphs *digraphs-define*
|
||||
|
||||
*:dig* *:digraphs*
|
||||
:dig[raphs] show currently defined digraphs.
|
||||
*E104* *E39*
|
||||
<!--
|
||||
:dig[raphs] {char1}{char2} {number} ...
|
||||
Add digraph {char1}{char2} to the list. {number} is
|
||||
the decimal representation of the character.
|
||||
Example: >
|
||||
:digr e: 235 a: 228
|
||||
< Avoid defining a digraph with '_' (underscore) as the
|
||||
first character, it has a special meaning in the
|
||||
future.
|
||||
|
||||
Vim is normally compiled with the |+digraphs| feature. If the feature is
|
||||
disabled, the ":digraph" command will display an error message.
|
||||
-->
|
||||
|
||||
Example of the output of ":digraphs": >
|
||||
TH <20> 222 ss <20> 223 a! <20> 224 a' <20> 225 a> <20> 226 a? <20> 227 a: <20> 228
|
||||
|
||||
The first two characters in each column are the characters you have to type to
|
||||
enter the digraph.
|
||||
|
||||
In the middle of each column is the resulting character. This may be mangled
|
||||
if you look at it on a system that does not support digraphs or if you print
|
||||
this file.
|
||||
|
||||
The decimal number is the number of the character.
|
||||
|
||||
==============================================================================
|
||||
2. Using digraphs *digraphs-use*
|
||||
|
||||
There are two methods to enter digraphs: *i_digraph*
|
||||
CTRL-K {char1} {char2} or
|
||||
{char1} <BS> {char2}
|
||||
The first is always available; the second only when the 'digraph' option is
|
||||
set.
|
||||
|
||||
If a digraph with {char1}{char2} does not exist, Vim searches for a digraph
|
||||
{char2}{char1}. This helps when you don't remember which character comes
|
||||
first.
|
||||
|
||||
Note that when you enter CTRL-K {char1}, where {char1} is a special key, Vim
|
||||
enters the code for that special key. This is not a digraph.
|
||||
|
||||
Once you have entered the digraph, Vim treats the character like a normal
|
||||
character that occupies only one character in the file and on the screen.
|
||||
Example: >
|
||||
'B' <BS> 'B' will enter the broken '|' character (166)
|
||||
'a' <BS> '>' will enter an 'a' with a circumflex (226)
|
||||
CTRL-K '-' '-' will enter a soft hyphen (173)
|
||||
|
||||
The current digraphs are listed with the ":digraphs" command. Some of the
|
||||
default ones are listed below |digraph-table|.
|
||||
|
||||
For CTRL-K, there is one general digraph: CTRL-K <Space> {char} will enter
|
||||
{char} with the highest bit set. You can use this to enter meta-characters.
|
||||
|
||||
The <Esc> character cannot be part of a digraph. When hitting <Esc>, Vim
|
||||
stops digraph entry and ends Insert mode or Command-line mode, just like
|
||||
hitting an <Esc> out of digraph context. Use CTRL-V 155 to enter meta-ESC
|
||||
(CSI).
|
||||
|
||||
If you accidentally typed an 'a' that should be an 'e', you will type 'a' <BS>
|
||||
'e'. But that is a digraph, so you will not get what you want. To correct
|
||||
this, you will have to type <BS> e again. To avoid this don't set the
|
||||
'digraph' option and use CTRL-K to enter digraphs.
|
||||
|
||||
You may have problems using Vim with characters which have an ASCII value
|
||||
above 128. For example: You insert ue (u-umlaut) and the editor echoes \334
|
||||
in Insert mode. After leaving the Insert mode everything is fine. Note that
|
||||
fmt removes all characters with ASCII codes above 128 from the text being
|
||||
formatted. On some Unix systems this means you have to define the
|
||||
environment-variable LC_CTYPE. If you are using csh, then put the following
|
||||
line in your .cshrc: >
|
||||
setenv LC_CTYPE iso_8859_1
|
||||
|
||||
==============================================================================
|
||||
3. Default digraphs *digraphs-default*
|
||||
|
||||
Vim comes with a set of default digraphs. Check the output of ":digraphs" to
|
||||
see them.
|
||||
|
||||
On most systems Vim uses the same digraphs. They work for the Unicode and
|
||||
ISO-8859-1 character sets. These default digraphs are taken from the RFC1345
|
||||
mnemonics. To make it easy to remember the mnemonic, the second character has
|
||||
a standard meaning:
|
||||
|
||||
char name char meaning ~
|
||||
Exclamation mark ! Grave
|
||||
Apostrophe ' Acute accent
|
||||
Greater-Than sign > Circumflex accent
|
||||
Question Mark ? tilde
|
||||
Hyphen-Minus - Macron
|
||||
Left parenthesis ( Breve
|
||||
Full Stop . Dot Above
|
||||
Colon : Diaeresis
|
||||
Comma , Cedilla
|
||||
Underline _ Underline
|
||||
Solidus / Stroke
|
||||
Quotation mark " Double acute accent
|
||||
Semicolon ; Ogonek
|
||||
Less-Than sign < Caron
|
||||
Zero 0 Ring above
|
||||
Two 2 Hook
|
||||
Nine 9 Horn
|
||||
|
||||
Equals = Cyrillic
|
||||
Asterisk * Greek
|
||||
Percent sign % Greek/Cyrillic special
|
||||
Plus + smalls: Arabic, capitals: Hebrew
|
||||
Three 3 some Latin/Greek/Cyrillic letters
|
||||
Four 4 Bopomofo
|
||||
Five 5 Hiragana
|
||||
Six 6 Katakana
|
||||
|
||||
Example: a: is <20> and o: is <20>
|
||||
|
||||
These are the RFC1345 digraphs for the one-byte characters. See the output of
|
||||
":digraphs" for the others. All two character digraphs from RFC1345 are
|
||||
supported.
|
||||
*digraph-table*
|
||||
char digraph hex dec official name ~
|
||||
^@ NU 0x00 0 NULL (NUL)
|
||||
^A SH 0x01 1 START OF HEADING (SOH)
|
||||
^B SX 0x02 2 START OF TEXT (STX)
|
||||
^C EX 0x03 3 END OF TEXT (ETX)
|
||||
^D ET 0x04 4 END OF TRANSMISSION (EOT)
|
||||
^E EQ 0x05 5 ENQUIRY (ENQ)
|
||||
^F AK 0x06 6 ACKNOWLEDGE (ACK)
|
||||
^G BL 0x07 7 BELL (BEL)
|
||||
^H BS 0x08 8 BACKSPACE (BS)
|
||||
^I HT 0x09 9 CHARACTER TABULATION (HT)
|
||||
^@ LF 0x0a 10 LINE FEED (LF)
|
||||
^K VT 0x0b 11 LINE TABULATION (VT)
|
||||
^L FF 0x0c 12 FORM FEED (FF)
|
||||
^M CR 0x0d 13 CARRIAGE RETURN (CR)
|
||||
^N SO 0x0e 14 SHIFT OUT (SO)
|
||||
^O SI 0x0f 15 SHIFT IN (SI)
|
||||
^P DL 0x10 16 DATALINK ESCAPE (DLE)
|
||||
^Q D1 0x11 17 DEVICE CONTROL ONE (DC1)
|
||||
^R D2 0x12 18 DEVICE CONTROL TWO (DC2)
|
||||
^S D3 0x13 19 DEVICE CONTROL THREE (DC3)
|
||||
^T D4 0x14 20 DEVICE CONTROL FOUR (DC4)
|
||||
^U NK 0x15 21 NEGATIVE ACKNOWLEDGE (NAK)
|
||||
^V SY 0x16 22 SYNCRONOUS IDLE (SYN)
|
||||
^W EB 0x17 23 END OF TRANSMISSION BLOCK (ETB)
|
||||
^X CN 0x18 24 CANCEL (CAN)
|
||||
^Y EM 0x19 25 END OF MEDIUM (EM)
|
||||
^Z SB 0x1a 26 SUBSTITUTE (SUB)
|
||||
^[ EC 0x1b 27 ESCAPE (ESC)
|
||||
^\ FS 0x1c 28 FILE SEPARATOR (IS4)
|
||||
^] GS 0x1d 29 GROUP SEPARATOR (IS3)
|
||||
^^ RS 0x1e 30 RECORD SEPARATOR (IS2)
|
||||
^_ US 0x1f 31 UNIT SEPARATOR (IS1)
|
||||
SP 0x20 32 SPACE
|
||||
# Nb 0x23 35 NUMBER SIGN
|
||||
$ DO 0x24 36 DOLLAR SIGN
|
||||
@ At 0x40 64 COMMERCIAL AT
|
||||
[ <( 0x5b 91 LEFT SQUARE BRACKET
|
||||
\ // 0x5c 92 REVERSE SOLIDUS
|
||||
] )> 0x5d 93 RIGHT SQUARE BRACKET
|
||||
^ '> 0x5e 94 CIRCUMFLEX ACCENT
|
||||
` '! 0x60 96 GRAVE ACCENT
|
||||
{ (! 0x7b 123 LEFT CURLY BRACKET
|
||||
| !! 0x7c 124 VERTICAL LINE
|
||||
} !) 0x7d 125 RIGHT CURLY BRACKET
|
||||
~ '? 0x7e 126 TILDE
|
||||
^? DT 0x7f 127 DELETE (DEL)
|
||||
~@ PA 0x80 128 PADDING CHARACTER (PAD)
|
||||
~A HO 0x81 129 HIGH OCTET PRESET (HOP)
|
||||
~B BH 0x82 130 BREAK PERMITTED HERE (BPH)
|
||||
~C NH 0x83 131 NO BREAK HERE (NBH)
|
||||
~D IN 0x84 132 INDEX (IND)
|
||||
~E NL 0x85 133 NEXT LINE (NEL)
|
||||
~F SA 0x86 134 START OF SELECTED AREA (SSA)
|
||||
~G ES 0x87 135 END OF SELECTED AREA (ESA)
|
||||
~H HS 0x88 136 CHARACTER TABULATION SET (HTS)
|
||||
~I HJ 0x89 137 CHARACTER TABULATION WITH JUSTIFICATION (HTJ)
|
||||
~J VS 0x8a 138 LINE TABULATION SET (VTS)
|
||||
~K PD 0x8b 139 PARTIAL LINE FORWARD (PLD)
|
||||
~L PU 0x8c 140 PARTIAL LINE BACKWARD (PLU)
|
||||
~M RI 0x8d 141 REVERSE LINE FEED (RI)
|
||||
~N S2 0x8e 142 SINGLE-SHIFT TWO (SS2)
|
||||
~O S3 0x8f 143 SINGLE-SHIFT THREE (SS3)
|
||||
~P DC 0x90 144 DEVICE CONTROL STRING (DCS)
|
||||
~Q P1 0x91 145 PRIVATE USE ONE (PU1)
|
||||
~R P2 0x92 146 PRIVATE USE TWO (PU2)
|
||||
~S TS 0x93 147 SET TRANSMIT STATE (STS)
|
||||
~T CC 0x94 148 CANCEL CHARACTER (CCH)
|
||||
~U MW 0x95 149 MESSAGE WAITING (MW)
|
||||
~V SG 0x96 150 START OF GUARDED AREA (SPA)
|
||||
~W EG 0x97 151 END OF GUARDED AREA (EPA)
|
||||
~X SS 0x98 152 START OF STRING (SOS)
|
||||
~Y GC 0x99 153 SINGLE GRAPHIC CHARACTER INTRODUCER (SGCI)
|
||||
~Z SC 0x9a 154 SINGLE CHARACTER INTRODUCER (SCI)
|
||||
~[ CI 0x9b 155 CONTROL SEQUENCE INTRODUCER (CSI)
|
||||
~\ ST 0x9c 156 STRING TERMINATOR (ST)
|
||||
~] OC 0x9d 157 OPERATING SYSTEM COMMAND (OSC)
|
||||
~^ PM 0x9e 158 PRIVACY MESSAGE (PM)
|
||||
~_ AC 0x9f 159 APPLICATION PROGRAM COMMAND (APC)
|
||||
| NS 0xa0 160 NO-BREAK SPACE
|
||||
<EFBFBD> !I 0xa1 161 INVERTED EXCLAMATION MARK
|
||||
<EFBFBD> Ct 0xa2 162 CENT SIGN
|
||||
<EFBFBD> Pd 0xa3 163 POUND SIGN
|
||||
<EFBFBD> Cu 0xa4 164 CURRENCY SIGN
|
||||
<EFBFBD> Ye 0xa5 165 YEN SIGN
|
||||
<EFBFBD> BB 0xa6 166 BROKEN BAR
|
||||
<EFBFBD> SE 0xa7 167 SECTION SIGN
|
||||
<EFBFBD> ': 0xa8 168 DIAERESIS
|
||||
<EFBFBD> Co 0xa9 169 COPYRIGHT SIGN
|
||||
<EFBFBD> -a 0xaa 170 FEMININE ORDINAL INDICATOR
|
||||
<EFBFBD> << 0xab 171 LEFT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
<EFBFBD> NO 0xac 172 NOT SIGN
|
||||
<EFBFBD> -- 0xad 173 SOFT HYPHEN
|
||||
<EFBFBD> Rg 0xae 174 REGISTERED SIGN
|
||||
<EFBFBD> 'm 0xaf 175 MACRON
|
||||
<EFBFBD> DG 0xb0 176 DEGREE SIGN
|
||||
<EFBFBD> +- 0xb1 177 PLUS-MINUS SIGN
|
||||
<EFBFBD> 2S 0xb2 178 SUPERSCRIPT TWO
|
||||
<EFBFBD> 3S 0xb3 179 SUPERSCRIPT THREE
|
||||
<EFBFBD> '' 0xb4 180 ACUTE ACCENT
|
||||
<EFBFBD> My 0xb5 181 MICRO SIGN
|
||||
<EFBFBD> PI 0xb6 182 PILCROW SIGN
|
||||
<EFBFBD> .M 0xb7 183 MIDDLE DOT
|
||||
<EFBFBD> ', 0xb8 184 CEDILLA
|
||||
<EFBFBD> 1S 0xb9 185 SUPERSCRIPT ONE
|
||||
<EFBFBD> -o 0xba 186 MASCULINE ORDINAL INDICATOR
|
||||
<EFBFBD> >> 0xbb 187 RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK
|
||||
<EFBFBD> 14 0xbc 188 VULGAR FRACTION ONE QUARTER
|
||||
<EFBFBD> 12 0xbd 189 VULGAR FRACTION ONE HALF
|
||||
<EFBFBD> 34 0xbe 190 VULGAR FRACTION THREE QUARTERS
|
||||
<EFBFBD> ?I 0xbf 191 INVERTED QUESTION MARK
|
||||
<EFBFBD> A! 0xc0 192 LATIN CAPITAL LETTER A WITH GRAVE
|
||||
<EFBFBD> A' 0xc1 193 LATIN CAPITAL LETTER A WITH ACUTE
|
||||
<EFBFBD> A> 0xc2 194 LATIN CAPITAL LETTER A WITH CIRCUMFLEX
|
||||
<EFBFBD> A? 0xc3 195 LATIN CAPITAL LETTER A WITH TILDE
|
||||
<EFBFBD> A: 0xc4 196 LATIN CAPITAL LETTER A WITH DIAERESIS
|
||||
<EFBFBD> AA 0xc5 197 LATIN CAPITAL LETTER A WITH RING ABOVE
|
||||
<EFBFBD> AE 0xc6 198 LATIN CAPITAL LETTER AE
|
||||
<EFBFBD> C, 0xc7 199 LATIN CAPITAL LETTER C WITH CEDILLA
|
||||
<EFBFBD> E! 0xc8 200 LATIN CAPITAL LETTER E WITH GRAVE
|
||||
<EFBFBD> E' 0xc9 201 LATIN CAPITAL LETTER E WITH ACUTE
|
||||
<EFBFBD> E> 0xca 202 LATIN CAPITAL LETTER E WITH CIRCUMFLEX
|
||||
<EFBFBD> E: 0xcb 203 LATIN CAPITAL LETTER E WITH DIAERESIS
|
||||
<EFBFBD> I! 0xcc 204 LATIN CAPITAL LETTER I WITH GRAVE
|
||||
<EFBFBD> I' 0xcd 205 LATIN CAPITAL LETTER I WITH ACUTE
|
||||
<EFBFBD> I> 0xce 206 LATIN CAPITAL LETTER I WITH CIRCUMFLEX
|
||||
<EFBFBD> I: 0xcf 207 LATIN CAPITAL LETTER I WITH DIAERESIS
|
||||
<EFBFBD> D- 0xd0 208 LATIN CAPITAL LETTER ETH (Icelandic)
|
||||
<EFBFBD> N? 0xd1 209 LATIN CAPITAL LETTER N WITH TILDE
|
||||
<EFBFBD> O! 0xd2 210 LATIN CAPITAL LETTER O WITH GRAVE
|
||||
<EFBFBD> O' 0xd3 211 LATIN CAPITAL LETTER O WITH ACUTE
|
||||
<EFBFBD> O> 0xd4 212 LATIN CAPITAL LETTER O WITH CIRCUMFLEX
|
||||
<EFBFBD> O? 0xd5 213 LATIN CAPITAL LETTER O WITH TILDE
|
||||
<EFBFBD> O: 0xd6 214 LATIN CAPITAL LETTER O WITH DIAERESIS
|
||||
<EFBFBD> *X 0xd7 215 MULTIPLICATION SIGN
|
||||
<EFBFBD> O/ 0xd8 216 LATIN CAPITAL LETTER O WITH STROKE
|
||||
<EFBFBD> U! 0xd9 217 LATIN CAPITAL LETTER U WITH GRAVE
|
||||
<EFBFBD> U' 0xda 218 LATIN CAPITAL LETTER U WITH ACUTE
|
||||
<EFBFBD> U> 0xdb 219 LATIN CAPITAL LETTER U WITH CIRCUMFLEX
|
||||
<EFBFBD> U: 0xdc 220 LATIN CAPITAL LETTER U WITH DIAERESIS
|
||||
<EFBFBD> Y' 0xdd 221 LATIN CAPITAL LETTER Y WITH ACUTE
|
||||
<EFBFBD> TH 0xde 222 LATIN CAPITAL LETTER THORN (Icelandic)
|
||||
<EFBFBD> ss 0xdf 223 LATIN SMALL LETTER SHARP S (German)
|
||||
<EFBFBD> a! 0xe0 224 LATIN SMALL LETTER A WITH GRAVE
|
||||
<EFBFBD> a' 0xe1 225 LATIN SMALL LETTER A WITH ACUTE
|
||||
<EFBFBD> a> 0xe2 226 LATIN SMALL LETTER A WITH CIRCUMFLEX
|
||||
<EFBFBD> a? 0xe3 227 LATIN SMALL LETTER A WITH TILDE
|
||||
<EFBFBD> a: 0xe4 228 LATIN SMALL LETTER A WITH DIAERESIS
|
||||
<EFBFBD> aa 0xe5 229 LATIN SMALL LETTER A WITH RING ABOVE
|
||||
<EFBFBD> ae 0xe6 230 LATIN SMALL LETTER AE
|
||||
<EFBFBD> c, 0xe7 231 LATIN SMALL LETTER C WITH CEDILLA
|
||||
<EFBFBD> e! 0xe8 232 LATIN SMALL LETTER E WITH GRAVE
|
||||
<EFBFBD> e' 0xe9 233 LATIN SMALL LETTER E WITH ACUTE
|
||||
<EFBFBD> e> 0xea 234 LATIN SMALL LETTER E WITH CIRCUMFLEX
|
||||
<EFBFBD> e: 0xeb 235 LATIN SMALL LETTER E WITH DIAERESIS
|
||||
<EFBFBD> i! 0xec 236 LATIN SMALL LETTER I WITH GRAVE
|
||||
<EFBFBD> i' 0xed 237 LATIN SMALL LETTER I WITH ACUTE
|
||||
<EFBFBD> i> 0xee 238 LATIN SMALL LETTER I WITH CIRCUMFLEX
|
||||
<EFBFBD> i: 0xef 239 LATIN SMALL LETTER I WITH DIAERESIS
|
||||
<EFBFBD> d- 0xf0 240 LATIN SMALL LETTER ETH (Icelandic)
|
||||
<EFBFBD> n? 0xf1 241 LATIN SMALL LETTER N WITH TILDE
|
||||
<EFBFBD> o! 0xf2 242 LATIN SMALL LETTER O WITH GRAVE
|
||||
<EFBFBD> o' 0xf3 243 LATIN SMALL LETTER O WITH ACUTE
|
||||
<EFBFBD> o> 0xf4 244 LATIN SMALL LETTER O WITH CIRCUMFLEX
|
||||
<EFBFBD> o? 0xf5 245 LATIN SMALL LETTER O WITH TILDE
|
||||
<EFBFBD> o: 0xf6 246 LATIN SMALL LETTER O WITH DIAERESIS
|
||||
<EFBFBD> -: 0xf7 247 DIVISION SIGN
|
||||
<EFBFBD> o/ 0xf8 248 LATIN SMALL LETTER O WITH STROKE
|
||||
<EFBFBD> u! 0xf9 249 LATIN SMALL LETTER U WITH GRAVE
|
||||
<EFBFBD> u' 0xfa 250 LATIN SMALL LETTER U WITH ACUTE
|
||||
<EFBFBD> u> 0xfb 251 LATIN SMALL LETTER U WITH CIRCUMFLEX
|
||||
<EFBFBD> u: 0xfc 252 LATIN SMALL LETTER U WITH DIAERESIS
|
||||
<EFBFBD> y' 0xfd 253 LATIN SMALL LETTER Y WITH ACUTE
|
||||
<EFBFBD> th 0xfe 254 LATIN SMALL LETTER THORN (Icelandic)
|
||||
<EFBFBD> y: 0xff 255 LATIN SMALL LETTER Y WITH DIAERESIS
|
||||
|
||||
1486
help/txt/editing.txt
1486
help/txt/editing.txt
File diff suppressed because it is too large
Load Diff
4481
help/txt/eval.txt
4481
help/txt/eval.txt
File diff suppressed because it is too large
Load Diff
@@ -1,271 +0,0 @@
|
||||
*farsi.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Right to Left and Farsi Mapping for Vim *farsi* *Farsi*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
*E27*
|
||||
In order to use right-to-left and Farsi mapping support, it is necessary to
|
||||
compile Vim with the |+farsi| feature.
|
||||
|
||||
These functions have been made by Mortaza G. Shiran <shiran@jps.net>
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
In right-to-left oriented files the characters appear on the screen from right
|
||||
to left. This kind of file is most useful when writing Farsi documents,
|
||||
composing faxes or writing Farsi memos.
|
||||
|
||||
The commands, prompts and help files are not in Farsi, therefore the user
|
||||
interface remains the standard Vi interface.
|
||||
|
||||
|
||||
Highlights
|
||||
----------
|
||||
o Editing left-to-right files as in the original Vim, no change.
|
||||
|
||||
o Viewing and editing files in right-to-left windows. File orientation is
|
||||
per window, so it is possible to view the same file in right-to-left and
|
||||
left-to-right modes, simultaneously.
|
||||
|
||||
o Compatibility to the original Vim. Almost all features work in
|
||||
right-to-left mode (see bugs below).
|
||||
|
||||
o Changing keyboard mapping and reverse insert modes using a single
|
||||
command.
|
||||
|
||||
o Backing from reverse insert mode to the correct place in the file
|
||||
(if possible).
|
||||
|
||||
o While in Farsi mode, numbers are entered from left to right. Upon entering
|
||||
a none number character, that character will be inserted just into the
|
||||
left of the last number.
|
||||
|
||||
o No special terminal with right-to-left capabilities is required. The
|
||||
right-to-left changes are completely hardware independent. Only
|
||||
Farsi font is necessary.
|
||||
|
||||
o Farsi keymapping on the command line in reverse insert mode.
|
||||
|
||||
o Toggling between left-to-right and right-to-left via F8 function key.
|
||||
|
||||
o Toggling between Farsi ISIR-3342 standard encoding and VIM Farsi via F9
|
||||
function key. Since this makes sense only for the text written in
|
||||
right-to-left mode, this function is also supported only in right-to-left
|
||||
mode.
|
||||
|
||||
Farsi Fonts *farsi fonts*
|
||||
-----------
|
||||
|
||||
If the "extra" archive has been unpacked, the following files are found in the
|
||||
subdirectories of the '$VIM/farsi' directory:
|
||||
|
||||
+ far-a01.pcf X Windows fonts for Unix including Linux systems
|
||||
+ far-a01.bf X Windows fonts for SunOs
|
||||
+ far-a01.f16 a screen fonts for Unix including Linux systems
|
||||
+ far-a01.fon a monospaced fonts for Windows NT/95/98
|
||||
+ far-a01.com a screen fonts for DOS
|
||||
|
||||
|
||||
Font Installation
|
||||
-----------------
|
||||
|
||||
o Installation of fonts for MS Window systems (NT/95/98)
|
||||
|
||||
From 'Control Panel' folder, start the 'Fonts' program. Then from 'file'
|
||||
menu item select 'Install New Fonts ...'. Browse and select the
|
||||
'far-a01.fon', then follow the installation guide.
|
||||
NOTE: several people have reported that this does not work. The solution
|
||||
is unknown.
|
||||
|
||||
o Installation of fonts for X Window systems (Unix/Linux)
|
||||
|
||||
Depending on your system, copy far-a01.pcf.Z or far-a01.pcf.gz into a
|
||||
directory of your choice. Change to the directory containing the Farsi
|
||||
fonts and execute the following commands:
|
||||
|
||||
> mkfontdir
|
||||
> xset +fp path_name_of_farsi_fonts_directory
|
||||
|
||||
o Installation of fonts for X Window systems (SunOs)
|
||||
|
||||
Copy far-a01.bf font into a directory of your choice.
|
||||
Change to the directory containing the far-a01.fb fonts and
|
||||
execute the following commands:
|
||||
|
||||
> fldfamily
|
||||
> xset +fp path_name_of_fonts_directory
|
||||
|
||||
o Installation of ASCII screen fonts (Unix/Linux)
|
||||
|
||||
For Linux system, copy the far-a01.f16 fonts into /usr/lib/kbd/consolefonts
|
||||
directory and execute the setfont program as "setfont far-a01.f16". For
|
||||
other systems (e.g. SCO Unix), please refer to the fonts installation
|
||||
section of your system administration manuals.
|
||||
|
||||
o Installation of ASCII screen fonts (DOS)
|
||||
|
||||
After system power on, prior to the first use of VIM, upload the Farsi
|
||||
fonts by executing the far-a01.com font uploading program.
|
||||
|
||||
|
||||
Usage
|
||||
-----
|
||||
Prior to starting VIM, the environment in which VIM can run in Farsi mode,
|
||||
must be set. In addition to installation of Farsi fonts, following points
|
||||
refer to some of the system environments, which you may need to set:
|
||||
Key code mapping, loading graphic card in ASCII screen mode, setting the IO
|
||||
driver in 8 bit clean mode ... .
|
||||
|
||||
o Setting the Farsi fonts
|
||||
|
||||
+ For VIM GUI set the 'guifont' to far-a01. This is done by entering
|
||||
':set guifont=far-a01' in the VIM window.
|
||||
|
||||
You can have 'guifont' set to far-a01 by VIM during the VIM startup
|
||||
by appending the ':set guifont=far-a01' into your .vimrc file
|
||||
(in case of NT/95/98 platforms _vimrc).
|
||||
|
||||
Under the X Window environment, you can also start the VIM with
|
||||
'-fn far-a01' option.
|
||||
|
||||
+ For the VIM within a xterm, start a xterm with the Farsi fonts (e.g.
|
||||
kterm -fn far-a01). Then start the VIM inside the kterm.
|
||||
|
||||
+ For VIM under DOS, prior to the first usage of VIM, upload the Farsi
|
||||
fonts by executing the far-a01.com fonts uploading program.
|
||||
|
||||
o Farsi Keymapping Activation
|
||||
|
||||
To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'.
|
||||
This is done by entering ':set akm' or ':set fk' in the VIM window.
|
||||
You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm'
|
||||
or ':set fk' in your .vimrc file or _vimrc in case of NT/95/98 platforms.
|
||||
|
||||
To turn off the Farsi keymapping as a default second language keymapping,
|
||||
reset the 'altkeymap' by entering ':set noakm'.
|
||||
|
||||
o right-to-left Farsi Mode
|
||||
|
||||
By default VIM starts in Left-to-right mode. Following are ways to change
|
||||
the window orientation:
|
||||
|
||||
+ Start the VIM with -F option (e.g. vim -F ... ).
|
||||
|
||||
+ Use F8 function key to toggle between left-to-right and right-to-left.
|
||||
|
||||
+ While in Left-to-right mode, enter 'set rl' in the command line ('rl' is
|
||||
the abbreviation for rightleft).
|
||||
|
||||
+ Put the 'set rl' line in your '.vimrc' file to start the VIM in
|
||||
right-to-left mode permanently.
|
||||
|
||||
Encoding
|
||||
--------
|
||||
|
||||
The letter encoding used is the VIM extended ISIR-3342 standard with a built
|
||||
in function to convert between VIM extended ISIR-3342 and ISIR-3342 standard.
|
||||
|
||||
For document portability reasons, the letter encoding is kept the same across
|
||||
different platforms (i.e. UNIX's, NT/95/98, MS DOS, ...).
|
||||
|
||||
|
||||
o Keyboard
|
||||
|
||||
+ CTRL-_ in insert/replace modes toggles between Farsi(akm)/Latin
|
||||
mode as follows:
|
||||
|
||||
+ CTRL-_ moves the cursor to the end of the typed text in edit mode.
|
||||
|
||||
+ CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/
|
||||
Latin. The Farsi text is then entered in reverse insert mode.
|
||||
|
||||
+ F8 - Toggles between left-to-right and right-to-left.
|
||||
|
||||
+ F9 - Toggles the encoding between ISIR-3342 standard and VIM extended
|
||||
ISIR-3342 (supported only in right-to-left mode).
|
||||
|
||||
+ Keyboard mapping is based on the Iranian ISIRI-2901 standard.
|
||||
Following table shows the keyboard mapping while Farsi(akm) mode set:
|
||||
|
||||
-------------------------------------
|
||||
` 1 2 3 4 5 6 7 8 9 0 - =
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
~ ! @ # $ % ^ & * ( ) _ +
|
||||
~ <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
q w e r t z u i o p [ ]
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
Q W E R T Z U I O P { }
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> [ ] { }
|
||||
-------------------------------------
|
||||
a s d f g h j k l ; ' \
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
A S D F G H J K L : " |
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
< y x c v b n m , . /
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
> Y X C V B N M < > ?
|
||||
<20> <20> <20> <20> <20> <20> <20> <20> <20> <20> <20>
|
||||
-------------------------------------
|
||||
|
||||
Note:
|
||||
<20> stands for Farsi PSP (break without space)
|
||||
|
||||
<20> stands for Farsi PCN (for HAMZE attribute )
|
||||
|
||||
Restrictions
|
||||
------------
|
||||
|
||||
o In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not
|
||||
supported.
|
||||
|
||||
o If you change the character mapping between Latin/Farsi, the redo buffer
|
||||
will be reset (emptied). That is, redo is valid and will function (using
|
||||
'.') only within the mode you are in.
|
||||
|
||||
o While numbers are entered in Farsi mode, the redo buffer will be reset
|
||||
(emptied). That is, you can not redo the last changes (using '.') after
|
||||
entering numbers.
|
||||
|
||||
o While in left-to-right and Farsi mode set, CTRL-R is not supported.
|
||||
|
||||
o While in right-to-left mode, the search on 'Latin' pattern does not work,
|
||||
except if you enter the Latin search pattern in reverse.
|
||||
|
||||
o In the command mode, there is no support for entering the numbers from left
|
||||
to right and also for the sake of the flexibility the keymapping logic is
|
||||
restricted.
|
||||
|
||||
o Under X Window environment, if you want to run the VIM within a xterm
|
||||
terminal emulator and Farsi mode set, you need to have an ANSI compatible
|
||||
xterm terminal emulator. This is because the letter codes above 128 decimal
|
||||
have certain meanings in the standard xterm terminal emulator.
|
||||
|
||||
Note: Under X Window environment, VIM GUI works fine in Farsi mode.
|
||||
This eliminates the need of any xterm terminal emulator.
|
||||
|
||||
|
||||
Bugs
|
||||
----
|
||||
While in insert/replace and Farsi mode set, if you repeatedly change the
|
||||
cursor position (via cursor movement) and enter new text and then try to undo
|
||||
the last change, the undo will lag one change behind. But as you continue to
|
||||
undo, you will reach the original line of text. You can also use U to undo all
|
||||
changes made in the current line.
|
||||
|
||||
For more information about the bugs refer to rileft.txt.
|
||||
-->
|
||||
|
||||
@@ -1,493 +0,0 @@
|
||||
*filetype.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Filetypes *filetype* *file-type*
|
||||
|
||||
This information does not apply to IdeaVim. The IDE itself handles this functionality.
|
||||
<!--
|
||||
1. Filetypes |filetypes|
|
||||
2. Filetype plugin |filetype-plugins|
|
||||
3. Docs for the default filetype plugins. |ftplugin-docs|
|
||||
|
||||
Also see |autocmd.txt|.
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Filetypes *filetypes* *file-types*
|
||||
|
||||
Vim can detect the type of file that is edited. This is done by checking the
|
||||
file name and sometimes by inspecting the contents of the file for specific
|
||||
text.
|
||||
|
||||
*:filetype* *:filet*
|
||||
To enable file type detection, use this command in your vimrc: >
|
||||
:filetype on
|
||||
Each time a new or existing file is edited, Vim will try to recognize the type
|
||||
of the file and set the 'filetype' option. This will trigger the FileType
|
||||
event, which can be used to set the syntax highlighting, set options, etc.
|
||||
|
||||
NOTE: Filetypes and 'compatible' don't work together well, since being Vi
|
||||
compatible means options are global. Resetting 'compatible' is recommended,
|
||||
if you didn't do that already.
|
||||
|
||||
Detail: The ":filetype on" command will load one of these files:
|
||||
Amiga $VIMRUNTIME/filetype.vim
|
||||
Mac $VIMRUNTIME:filetype.vim
|
||||
MS-DOS $VIMRUNTIME\filetype.vim
|
||||
RiscOS Vim:Filetype
|
||||
Unix $VIMRUNTIME/filetype.vim
|
||||
VMS $VIMRUNTIME/filetype.vim
|
||||
This file is a Vim script that defines autocommands for the
|
||||
BufNewFile and BufRead events. If the file type is not found by the
|
||||
name, the file $VIMRUNTIME/scripts.vim is used to detect it from the
|
||||
contents of the file.
|
||||
|
||||
To add your own file types, see |new-filetype| below.
|
||||
|
||||
If the file type is not detected automatically, or it finds the wrong type,
|
||||
you can either set the 'filetype' option manually, or add a modeline to your
|
||||
file. Example, for in an IDL file use the command: >
|
||||
:set filetype=idl
|
||||
or add this |modeline| to the file: >
|
||||
/* vim: set filetype=idl : */
|
||||
<
|
||||
*:filetype-plugin-on*
|
||||
You can enable loading the plugin files for specific file types with: >
|
||||
:filetype plugin on
|
||||
If filetype detection was not switched on yet, it will be as well.
|
||||
This actually loads the file "ftplugin.vim" in 'runtimepath'.
|
||||
The result is that when a file is edited its plugin file is loaded (if there
|
||||
is one for the detected filetype). |filetype-plugin|
|
||||
|
||||
*:filetype-plugin-off*
|
||||
You can disable it again with: >
|
||||
:filetype plugin off
|
||||
The filetype detection is not switched off then. But if you do switch off
|
||||
filetype detection, the plugins will not be loaded either.
|
||||
This actually loads the file "ftplugof.vim" in 'runtimepath'.
|
||||
|
||||
*:filetype-indent-on*
|
||||
You can enable loading the indent file for specific file types with: >
|
||||
:filetype indent on
|
||||
If filetype detection was not switched on yet, it will be as well.
|
||||
This actually loads the file "indent.vim" in 'runtimepath'.
|
||||
The result is that when a file is edited its indent file is loaded (if there
|
||||
is one for the detected filetype). |indent-expression|
|
||||
|
||||
*:filetype-indent-off*
|
||||
You can disable it again with: >
|
||||
:filetype indent off
|
||||
The filetype detection is not switched off then. But if you do switch off
|
||||
filetype detection, the indent files will not be loaded either.
|
||||
This actually loads the file "indoff.vim" in 'runtimepath'.
|
||||
|
||||
*:filetype-off*
|
||||
To disable file type detection, use this command: >
|
||||
:filetype off
|
||||
This will keep the flags for "plugin" and "indent", but since no file types
|
||||
are being detected, they won't work until the next ":filetype on".
|
||||
|
||||
|
||||
Overview: *:filetype-overview*
|
||||
|
||||
command detection plugin indent ~
|
||||
:filetype on on unchanged unchanged
|
||||
:filetype off off unchanged unchanged
|
||||
:filetype plugin on on on unchanged
|
||||
:filetype plugin off unchanged off unchanged
|
||||
:filetype indent on on unchanged on
|
||||
:filetype indent off unchanged unchanged off
|
||||
:filetype plugin indent on on on on
|
||||
:filetype plugin indent off unchanged off off
|
||||
|
||||
To see the current status, type: >
|
||||
:filetype
|
||||
The output looks something like this: >
|
||||
filetype detection:ON plugin:ON indent:OFF
|
||||
|
||||
The file types are also used for syntax highlighting. If the ":syntax on"
|
||||
command is used, the file type detection is installed too. There is no need
|
||||
to do ":filetype on" after ":syntax on".
|
||||
|
||||
To disable one of the file types, add a line in the your filetype file, see
|
||||
|remove-filetype|.
|
||||
|
||||
*filetype-detect*
|
||||
To detect the file type again: >
|
||||
:filetype detect
|
||||
Use this if you started with an empty file and typed text that makes it
|
||||
possible to detect the file type. For example, when you entered this in a
|
||||
shell script: "#!/bin/csh".
|
||||
When filetype detection was off, it will be enabled first, like the "on"
|
||||
argument was used.
|
||||
|
||||
*filetype-overrule*
|
||||
When the same extension is used for two filetypes, Vim tries to guess what
|
||||
kind of file it is. This doesn't always work. A number of global variables
|
||||
can be used to overrule the filetype used for certain extensions:
|
||||
|
||||
file name variable ~
|
||||
*.asa g:filetype_asa |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asp g:filetype_asp |aspvbs-syntax| |aspperl-syntax|
|
||||
*.asm g:asmsyntax |asm-syntax|
|
||||
*.prg g:filetype_prg
|
||||
*.pl g:filetype_pl
|
||||
*.inc g:filetype_inc
|
||||
*.w g:filetype_w |cweb-syntax|
|
||||
*.i g:filetype_i |progress-syntax|
|
||||
*.p g:filetype_p |pascal-syntax|
|
||||
*.sh g:bash_is_sh |sh-syntax|
|
||||
|
||||
*filetype-ignore*
|
||||
To avoid that certain files are being inspected, the g:ft_ignore_pat variable
|
||||
is used. The default value is set like this: >
|
||||
:let g:ft_ignore_pat = '\.\(Z\|gz\|bz2\|zip\|tgz\)$'
|
||||
This means that the contents of compressed files are not inspected.
|
||||
|
||||
*new-filetype*
|
||||
If a file type that you want to use is not detected yet, there are two ways to
|
||||
add it. In any way, it's better not modify the $VIMRUNTIME/filetype.vim file.
|
||||
It will be overwritten when installing a new version of Vim.
|
||||
|
||||
A. If your file type can be detected by the file name.
|
||||
1. Create your user runtime directory. You would normally use the first
|
||||
item of the 'runtimepath' option. Example for Unix: >
|
||||
:!mkdir ~/.vim
|
||||
<
|
||||
2. Create a file that contains autocommands to detect the file type.
|
||||
Example: >
|
||||
" my filetype file
|
||||
if exists("did_load_filetypes")
|
||||
finish
|
||||
endif
|
||||
augroup filetypedetect
|
||||
au! BufRead,BufNewFile *.mine setfiletype mine
|
||||
au! BufRead,BufNewFile *.xyz setfiletype drawing
|
||||
augroup END
|
||||
< Write this file as "filetype.vim" in your user runtime directory. For
|
||||
example, for Unix: >
|
||||
:w ~/.vim/filetype.vim
|
||||
|
||||
< 3. To use the new filetype detection you must restart Vim.
|
||||
|
||||
Your filetype.vim will be sourced before the default FileType autocommands
|
||||
have been installed. Your autocommands will match first, and the
|
||||
":setfiletype" command will make sure that no other autocommands will set
|
||||
'filetype' after this.
|
||||
*new-filetype-scripts*
|
||||
B. If your filetype can only be detected by inspecting the contents of the
|
||||
file.
|
||||
|
||||
1. Create your user runtime directory. You would normally use the first
|
||||
item of the 'runtimepath' option. Example for Unix: >
|
||||
:!mkdir ~/.vim
|
||||
<
|
||||
2. Create a vim script file for doing this. Example: >
|
||||
if did_filetype() " filetype already set..
|
||||
finish " ..don't do these checks
|
||||
endif
|
||||
if getline(1) =~ '^#!.*\<mine\>'
|
||||
setfiletype mine
|
||||
elseif getline(1) =~? '\<drawing\>'
|
||||
setfiletype drawing
|
||||
endif
|
||||
< See $VIMRUNTIME/scripts.vim for more examples.
|
||||
Write this file as "scripts.vim" in your user runtime directory. For
|
||||
example, for Unix: >
|
||||
:w ~/.vim/scripts.vim
|
||||
<
|
||||
3. The detection will work right away, no need to restart Vim.
|
||||
|
||||
Your scripts.vim is loaded before the default checks for file types, which
|
||||
means that your rules override the default rules in
|
||||
$VIMRUNTIME/scripts.vim.
|
||||
|
||||
*remove-filetype*
|
||||
If a file type is detected that is wrong for you, install a filetype.vim or
|
||||
scripts.vim to catch it (see above). You can set 'filetype' to a non-existing
|
||||
name to avoid that it will be set later anyway: >
|
||||
:set filetype=ignored
|
||||
|
||||
If you are setting up a system with many users, and you don't want each user
|
||||
to add/remove the same filetypes, consider writing the filetype.vim and
|
||||
scripts.vim files in a runtime directory that is used for everybody. Check
|
||||
the 'runtimepath' for a directory to use. If there isn't one, set
|
||||
'runtimepath' in the |system-vimrc|. Be careful to keep the default
|
||||
directories!
|
||||
|
||||
|
||||
*autocmd-osfiletypes*
|
||||
On operating systems which support storing a file type with the file, you can
|
||||
specify that an autocommand should only be executed if the file is of a
|
||||
certain type.
|
||||
|
||||
The actual type checking depends on which platform you are running Vim
|
||||
on; see your system's documentation for details.
|
||||
|
||||
To use osfiletype checking in an autocommand you should put a list of types to
|
||||
match in angle brackets in place of a pattern, like this: >
|
||||
|
||||
:au BufRead *.html,<&faf;HTML> so $VIMRUNTIME/syntax/html.vim
|
||||
|
||||
This will match:
|
||||
|
||||
- Any file whose name ends in `.html'
|
||||
- Any file whose type is `&faf' or 'HTML', where the meaning of these types
|
||||
depends on which version of Vim you are using.
|
||||
Unknown types are considered NOT to match.
|
||||
|
||||
You can also specify a type and a pattern at the same time (in which case they
|
||||
must both match): >
|
||||
|
||||
:au BufRead <&fff>diff*
|
||||
|
||||
This will match files of type `&fff' whose names start with `diff'.
|
||||
|
||||
Note that osfiletype checking is skipped if Vim is compiled without the
|
||||
|+osfiletype| feature.
|
||||
|
||||
*plugin-details*
|
||||
The "plugin" directory can be in any of the directories in the 'runtimepath'
|
||||
option. All of these directories will be searched for plugins and they are
|
||||
all loaded. For example, if this command: >
|
||||
|
||||
set runtimepath
|
||||
|
||||
produces this output: >
|
||||
|
||||
runtimepath=/etc/vim,~/.vim,/usr/local/share/vim/vim60
|
||||
|
||||
then Vim will load all plugins in these directories: >
|
||||
|
||||
/etc/vim/plugin/
|
||||
~/.vim/plugin/
|
||||
/usr/local/share/vim/vim60/plugin/
|
||||
|
||||
Note that the last one is the value of $VIMRUNTIME which has been expanded.
|
||||
|
||||
What if it looks like your plugin is not being loaded? You can find out what
|
||||
happens when Vim starts up by using the |-V| argument: >
|
||||
vim -V1
|
||||
You will see a lot of messages, in between them is a remark about loading the
|
||||
plugins. It starts with: >
|
||||
Searching for "plugin/*.vim" in
|
||||
There you can see where Vim looks for your plugin scripts.
|
||||
|
||||
==============================================================================
|
||||
2. Filetype plugin *filetype-plugins*
|
||||
|
||||
When loading filetype plugins has been enabled |:filetype-plugin-on|, options
|
||||
will be set and mappings defined. These are all local to the buffer, they
|
||||
will not be used for other files.
|
||||
|
||||
Defining mappings for a filetype may get in the way of the mappings you
|
||||
define yourself. There are a few ways to avoid this:
|
||||
1. Set the "maplocalleader" variable to the key sequence you want the mappings
|
||||
to start with. Example: >
|
||||
:let maplocalleader = ","
|
||||
< All mappings will then start with a comma instead of the default, which
|
||||
is a backslash. Also see |<LocalLeader>|.
|
||||
|
||||
2. Define your own mapping. Example: >
|
||||
:map ,p <Plug>MailQuote
|
||||
< You need to check the description of the plugin file below for the
|
||||
functionality it offers and the string to map to.
|
||||
You need to define your own mapping before the plugin is loaded (before
|
||||
editing a file of that type). The plugin will then skip installing the
|
||||
default mapping.
|
||||
|
||||
3. Disable defining mappings for a specific filetype by setting a variable,
|
||||
which contains the name of the filetype. For the "mail" filetype this
|
||||
would be: >
|
||||
:let no_mail_maps = 1
|
||||
|
||||
4. Disable defining mappings for all filetypes by setting a variable: >
|
||||
:let no_plugin_maps = 1
|
||||
<
|
||||
|
||||
*ftplugin-overrule*
|
||||
If a global filetype plugin does not do exactly what you want, there are three
|
||||
ways to change this:
|
||||
|
||||
1. Add a few settings.
|
||||
You must create a new filetype plugin in a directory early in
|
||||
'runtimepath'. For Unix, for example you could use this file: >
|
||||
vim ~/.vim/ftplugin/fortran.vim
|
||||
< You can set those settings and mappings that you would like to add. Note
|
||||
that the global plugin will be loaded after this, it may overrule the
|
||||
settings that you do here. If this is the case, you need to use one of the
|
||||
following two methods.
|
||||
|
||||
2. Make a copy of the plugin and change it.
|
||||
You must put the copy in a directory early in 'runtimepath'. For Unix, for
|
||||
example, you could do this: >
|
||||
cp $VIMRUNTIME/ftplugin/fortran.vim ~/.vim/ftplugin/fortran.vim
|
||||
< Then you can edit the copied file to your liking. Since the b:did_ftplugin
|
||||
variable will be set, the global plugin will not be loaded.
|
||||
A disadvantage of this method is that when the distributed plugin gets
|
||||
improved, you will have to copy and modify it again.
|
||||
|
||||
3. Overrule the settings after loading the global plugin.
|
||||
You must create a new filetype plugin in a directory from the end of
|
||||
'runtimepath'. For Unix, for example, you could use this file: >
|
||||
vim ~/.vim/after/ftplugin/fortran.vim
|
||||
< In this file you can change just those settings that you want to change.
|
||||
|
||||
==============================================================================
|
||||
3. Docs for the default filetype plugins. *ftplugin-docs*
|
||||
|
||||
|
||||
CHANGELOG *changelog-plugin*
|
||||
|
||||
Allows for easy entrance of Changelog entries in Changelog files. There are
|
||||
some commands, mappings, and variables worth exploring:
|
||||
|
||||
Options:
|
||||
'comments' is made empty to not mess up formatting.
|
||||
'textwidth' is set to 78, which is standard.
|
||||
'formatoptions' the 't' flag is added to wrap when inserting text.
|
||||
|
||||
Commands:
|
||||
NewChangelogEntry Adds a new Changelog entry in an intelligent fashion
|
||||
(see below).
|
||||
|
||||
Local mappings:
|
||||
<Leader>o Starts a new Changelog entry in an equally intelligent
|
||||
fashion (see below).
|
||||
|
||||
Global mappings:
|
||||
NOTE: The global mappings are accessed by sourcing the
|
||||
ftplugin/changelog.vim file first, e.g. with >
|
||||
runtime ftplugin/man.vim
|
||||
< in your |.vimrc|.
|
||||
<Leader>o Switches to the ChangeLog buffer opened for the
|
||||
current directory, or opens it in a new buffer if it
|
||||
exists in the current directory. Then it does the
|
||||
same as the local <Leader>o described above.
|
||||
|
||||
Variables:
|
||||
g:changelog_timeformat The date (and time) format used in ChangeLog entries.
|
||||
The format accepted is the same as for the
|
||||
|strftime()| function.
|
||||
The default is "%Y-%m-%d" which is the standard format
|
||||
for many ChangeLog layouts.
|
||||
g:changelog_username The name and email address of the user.
|
||||
The default is deduced from environment variables and
|
||||
system files. It searches /etc/passwd for the comment
|
||||
part of the current user, which informally contains
|
||||
the real name of the user up to the first separating
|
||||
comma. then it checks the $NAME environment variable
|
||||
and finally runs `whoami` and `hostname` to build an
|
||||
email adress. The final form is >
|
||||
Full Name <user@host>
|
||||
<
|
||||
g:changelog_new_date_format
|
||||
The format to use when creating a new date-entry.
|
||||
The following table describes special tokens in the
|
||||
string:
|
||||
%% insert a single '%' character
|
||||
%d insert the date from above
|
||||
%u insert the user from above
|
||||
%c where to position cursor when done
|
||||
The default is "%d %u\n\n\t* %c\n\n", which produces
|
||||
something like (| is where cursor will be, unless at
|
||||
the start of the line where it denotes the beginning
|
||||
of the line) >
|
||||
|2003-01-14 Full Name <user@host>
|
||||
|
|
||||
| * |
|
||||
<
|
||||
g:changelog_new_entry_format
|
||||
The format used when creating a new entry.
|
||||
The following table describes special tokens in the
|
||||
string:
|
||||
%c where to position cursor when done
|
||||
The default is "\t*%c", which produces something
|
||||
similar to >
|
||||
| * |
|
||||
<
|
||||
g:changelog_date_entry_search
|
||||
The search pattern to use when searching for a
|
||||
date-entry.
|
||||
The same tokens that can be used for
|
||||
g:changelog_new_date_format can be used here as well.
|
||||
The default is '^\s*%d\_s*%u' which finds lines
|
||||
matching the form >
|
||||
|2003-01-14 Full Name <user@host>
|
||||
< and some similar formats.
|
||||
|
||||
The Changelog entries are inserted where they add the least amount of text.
|
||||
After figuring out the current date and user, the file is searched for an
|
||||
entry beginning with the current date and user and if found adds another item
|
||||
under it. If not found, a new entry and item is prepended to the beginning of
|
||||
the Changelog.
|
||||
|
||||
|
||||
FORTRAN *fortran-plugin*
|
||||
|
||||
Options:
|
||||
'expandtab' is switched on to avoid tabs as required by the Fortran
|
||||
standards unless the user has set fortran_have_tabs in .vimrc.
|
||||
'textwidth' is set to 72 for fixed source format as required by the
|
||||
Fortran standards and to 80 for free source format.
|
||||
'formatoptions' is set to break code and comment lines and to preserve long
|
||||
lines. You can format comments with |gq|.
|
||||
For further discussion of fortran_have_tabs and the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
|
||||
|
||||
MAIL *mail-plugin*
|
||||
|
||||
Options:
|
||||
'modeline' is switched off to avoid the danger of trojan horses, and to
|
||||
avoid that a Subject line with "Vim:" in it will cause an
|
||||
error message.
|
||||
'textwidth' is set to 72. This is often recommended for e-mail.
|
||||
'formatoptions' is set to break text lines and to repeat the comment leader
|
||||
in new lines, so that a leading ">" for quotes is repeated.
|
||||
You can also format quoted text with |gq|.
|
||||
|
||||
Local mappings:
|
||||
<LocalLeader>q or \\MailQuote
|
||||
Quotes the text selected in Visual mode, or from the cursor position
|
||||
to the end of the file in Normal mode. This means "> " is inserted in
|
||||
each line.
|
||||
|
||||
MAN *man-plugin* *:Man*
|
||||
|
||||
Displays a manual page in a nice way. Also see the user manual
|
||||
|find-manpage|.
|
||||
|
||||
To start using the ":Man" command before any manual page was loaded, source
|
||||
this script from your startup vimrc file: >
|
||||
|
||||
runtime ftplugin/man.vim
|
||||
|
||||
Options:
|
||||
'iskeyword' the '.' character is added to be able to use CTRL-] on the
|
||||
manual page name.
|
||||
|
||||
Commands:
|
||||
Man {name} Display the manual page for {name} in a window.
|
||||
Man {number} {name}
|
||||
Display the manual page for {name} in a section {number}.
|
||||
|
||||
Global mapping:
|
||||
<Leader>K Displays the manual page for the word under the cursor.
|
||||
|
||||
Local mappings:
|
||||
CTRL-] Jump to the manual page for the word under the cursor.
|
||||
CTRL-T Jump back to the previous manual page.
|
||||
|
||||
|
||||
RPM SPEC *spec-plugin*
|
||||
|
||||
Since the text for this plugin is rather long it has been put in a separate
|
||||
file: |pi_spec.txt|.
|
||||
-->
|
||||
|
||||
|
||||
@@ -1,588 +0,0 @@
|
||||
*fold.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Folding *Folding* *folding*
|
||||
|
||||
You can find an introduction on folding in chapter 28 of the user manual.
|
||||
|usr_28.txt|
|
||||
|
||||
1. Fold methods |fold-methods|
|
||||
2. Fold commands |fold-commands|
|
||||
3. Fold options |fold-options|
|
||||
4. Behavior of folds |fold-behavior|
|
||||
|
||||
Most folding behavior is controlled by the IDE itself.
|
||||
|
||||
==============================================================================
|
||||
1. Fold methods *fold-methods*
|
||||
|
||||
<!--
|
||||
The folding method can be set with the 'foldmethod' option.
|
||||
|
||||
When setting 'foldmethod' to a value other than "manual", all folds are
|
||||
deleted and new ones created. Switching to the "manual" method doesn't remove
|
||||
the existing folds. This can be used to first define the folds automatically
|
||||
and then change them manually.
|
||||
|
||||
There are six methods to select folds:
|
||||
manual manually define folds
|
||||
indent more indent means a higher fold level
|
||||
expr specify an expression to define folds
|
||||
syntax folds defined by syntax highlighting
|
||||
diff folds for unchanged text
|
||||
marker folds defined by markers in the text
|
||||
|
||||
|
||||
MANUAL *fold-manual*
|
||||
|
||||
Use commands to manually define the fold regions. This can also be used by a
|
||||
script that parses text to find folds.
|
||||
|
||||
The level of a fold is only defined by its nesting. To increase the fold
|
||||
level of a fold for a range of lines, define a fold inside it that has the
|
||||
same lines.
|
||||
|
||||
The manual folds are lost when you abandon the file. To save the folds use
|
||||
the |:mkview| command. The view can be restored later with |:loadview|.
|
||||
|
||||
|
||||
INDENT *fold-indent*
|
||||
|
||||
The folds are automatically defined by the indent of the lines.
|
||||
|
||||
The foldlevel is computed from the indent of the line, divided by the
|
||||
'shiftwidth' (rounded down). A sequence of lines with the same or higher fold
|
||||
level form a fold, with the lines with a higher level forming a nested fold.
|
||||
|
||||
The nesting of folds is limited with 'foldnestmax'.
|
||||
|
||||
Some lines are ignored and get the fold level of the line above or below it,
|
||||
whatever is the lowest. These are empty or white lines and lines starting
|
||||
with a character in 'foldignore'. White space is skipped before checking for
|
||||
characters in 'foldignore'. For C use "#" to ignore preprocessor lines.
|
||||
|
||||
When you want to ignore lines in another way, use the 'expr' method. The
|
||||
|indent()| function can be used in 'foldexpr' to get the indent of a line.
|
||||
|
||||
|
||||
EXPR *fold-expr*
|
||||
|
||||
The folds are automatically defined by their foldlevel, like with the "indent"
|
||||
method. The value of the 'foldexpr' option is evaluated to get the foldlevel
|
||||
of a line. Examples:
|
||||
This will create a fold for all consecutive lines that start with a Tab: >
|
||||
:set foldexpr=getline(v:lnum)[0]==\"\\t\"
|
||||
This will call a function to compute the fold level: >
|
||||
:set foldexpr=MyFoldLevel(v:lnum)
|
||||
This will make a fold out of paragraphs separated by blank lines: >
|
||||
:set foldexpr=getline(v:lnum)=~'^\\s*$'&&getline(v:lnum+1)=~'\\S'?'<1':1
|
||||
this does the same: >
|
||||
:set foldexpr=getline(v:lnum-1)=~'^\\s*$'&&getline(v:lnum)=~'\\S'?'>1':1
|
||||
|
||||
Note that backslashes must be used to escape characters that ":set" handles
|
||||
differently (space, backslash, double quote, etc., see |option-backslash|).
|
||||
|
||||
These are the conditions with which the expression is evaluated:
|
||||
- The current buffer and window are set for the line.
|
||||
- The variable "v:lnum" is set to the line number.
|
||||
- The result is used for the fold level in this way:
|
||||
value meaning ~
|
||||
0 the line is not in a fold
|
||||
1, 2, .. the line is in a fold with this level
|
||||
-1 the fold level is undefined, use the fold level of a
|
||||
line before or after this line, whichever is the
|
||||
lowest.
|
||||
"=" use fold level from the previous line
|
||||
"a1", "a2", .. add one, two, .. to the fold level of the previous
|
||||
line
|
||||
"s1", "s2", .. subtract one, two, .. from the fold level of the
|
||||
previous line
|
||||
"<1", "<2", .. a fold with this level ends at this line
|
||||
">1", ">2", .. a fold with this level starts at this line
|
||||
|
||||
It is not required to mark the start (end) of a fold with ">1" ("<1"), a fold
|
||||
will also start (end) when the fold level is higher (lower) than the fold
|
||||
level of the previous line.
|
||||
|
||||
There must be no side effects from the expression. The text in the buffer,
|
||||
cursor position, the search patterns, options etc. must not be changed.
|
||||
|
||||
If there is some error in the expression, or the resulting value isn't
|
||||
recognized, there is no error message and the fold level will be zero.
|
||||
For debugging the 'debug' option can be set to "msg", the error messages will
|
||||
be visible then.
|
||||
|
||||
Note: Since the expression has to be evaluated for every line, this fold
|
||||
method can be very slow!
|
||||
|
||||
Try to avoid the "=", "a" and "s" return values, since Vim often has to search
|
||||
backwards for a line for which the fold level is defined. Using foldlevel()
|
||||
can help here. Example: >
|
||||
" extra is level compared to previous line
|
||||
let lvl = foldlevel(v:lnum - 1)
|
||||
if lvl >= 0
|
||||
return lvl + extra
|
||||
endif
|
||||
" return "=", "a" or "s"
|
||||
|
||||
|
||||
SYNTAX *fold-syntax*
|
||||
|
||||
A fold is defined by syntax items that have the "fold" argument. |:syn-fold|
|
||||
|
||||
The fold level is defined by nesting folds. The nesting of folds is limited
|
||||
with 'foldnestmax'.
|
||||
|
||||
|
||||
DIFF *fold-diff*
|
||||
|
||||
The folds are automatically defined for text that is not part of a change or
|
||||
close to a change.
|
||||
|
||||
This method only works properly when the 'diff' option is set for the current
|
||||
window and changes are being displayed. Otherwise the whole buffer will be
|
||||
one big fold.
|
||||
|
||||
The 'diffopt' option can be used to specify the context. That is, the number
|
||||
of lines between the fold and a change that are not included in the fold. For
|
||||
example, to use a context of 8 lines: >
|
||||
:set diffopt=filler,context:8
|
||||
The default context is six lines.
|
||||
|
||||
|
||||
MARKER *fold-marker*
|
||||
|
||||
Markers in the text tell where folds start and end. This allows you to
|
||||
precisely specify the folds. This will allow deleting and putting a fold,
|
||||
without the risk of including the wrong lines. The 'foldtext' option is
|
||||
normally set such that the text before the marker shows up in the folded line.
|
||||
This makes it possible to give a name to the fold.
|
||||
|
||||
Markers can have a level included, or can use matching pairs. Including a
|
||||
level is easier, you don't have to add end markers and avoid problems with
|
||||
non-matching marker pairs. Example: >
|
||||
/* global variables {{{1 */
|
||||
int varA, varB;
|
||||
|
||||
/* functions {{{1 */
|
||||
/* funcA() {{{2 */
|
||||
void funcA() {}
|
||||
|
||||
/* funcB() {{{2 */
|
||||
void funcB() {}
|
||||
|
||||
A fold starts at a "{{{" marker. The following number specifies the fold
|
||||
level. What happens depends on the difference between the current fold level
|
||||
and the level given by the marker:
|
||||
1. If a marker with the same fold level is encountered, the previous fold
|
||||
ends and another fold with the same level starts.
|
||||
2. If a marker with a higher fold level is found, a nested fold is started.
|
||||
3. if a marker with a lower fold level is found, all folds up to and including
|
||||
this level end and a fold with the specified level starts.
|
||||
|
||||
The number indicates the fold level. A zero cannot be used.
|
||||
You can use "}}}" with a digit to indicate the level of the fold that
|
||||
ends. The fold level of the following line will be one less than the
|
||||
indicated level. Note that Vim doesn't look back to the level of the matching
|
||||
marker (that would take too much time). Example: >
|
||||
|
||||
{{{1
|
||||
fold level here is 1
|
||||
{{{3
|
||||
fold level here is 3
|
||||
}}}3
|
||||
fold level here is 2
|
||||
|
||||
You can also use matching pairs of "{{{" and "}}}" markers to define folds.
|
||||
Each "{{{" increases the fold level by one, each "}}}" decreases the fold
|
||||
level by one. Be careful to keep the markers matching! Example: >
|
||||
|
||||
{{{
|
||||
fold level here is 1
|
||||
{{{
|
||||
fold level here is 2
|
||||
}}}
|
||||
fold level here is 1
|
||||
|
||||
You can mix using markers with a number and without a number. A useful way of
|
||||
doing this is to use numbered markers for large folds, and unnumbered markers
|
||||
locally in a function. For example use level one folds for the sections of
|
||||
your file like "structure definitions", "local variables" and "functions".
|
||||
Use level 2 markers for each definition and function, Use unnumbered markers
|
||||
inside functions. When you make changes in a function to split up folds, you
|
||||
don't have to renumber the markers.
|
||||
|
||||
The markers can be set with the 'foldmarker' option. It is recommended to
|
||||
keep this at the default value of "{{{,}}}", so that files can be exchanged
|
||||
between Vim users. Only change it when it is required for the file (e.g., it
|
||||
contains markers from another folding editor, or the default markers cause
|
||||
trouble for the language of the file).
|
||||
|
||||
*fold-create-marker*
|
||||
"zf" can be used to create a fold defined by markers. Vim will insert the
|
||||
markers for you. Vim will append the start and end marker, as specified with
|
||||
'foldmarker'. The markers are appended to the end of the line.
|
||||
'commentstring' is used if it isn't empty.
|
||||
This does not work properly when:
|
||||
- The line already contains a marker with a level number. Vim then doesn't
|
||||
know what to do.
|
||||
- Folds nearby use a level number in their marker which gets in the way.
|
||||
- The line is inside a comment, 'commentstring' isn't empty and nested
|
||||
comments don't work. For example with C: adding /* {{{ */ inside a comment
|
||||
will truncate the existing comment. Either put the marker before or after
|
||||
the comment, or add the marker manually.
|
||||
Generally it's not a good idea to let Vim create markers when you already have
|
||||
markers with a level number.
|
||||
|
||||
*fold-delete-marker*
|
||||
"zd" can be used to delete a fold defined by markers. Vim will delete the
|
||||
markers for you. Vim will search for the start and end markers, as specified
|
||||
with 'foldmarker', at the start and end of the fold. When the text around the
|
||||
marker matches with 'commentstring', that text is deleted as well.
|
||||
This does not work properly when:
|
||||
- A line contains more than one marker and one of them specifies a level.
|
||||
Only the first one is removed, without checking if this will have the
|
||||
desired effect of deleting the fold.
|
||||
- The marker contains a level number and is used to start or end several folds
|
||||
at the same time.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
2. Fold commands *fold-commands* *E490*
|
||||
|
||||
All folding commands start with "z". Hint: the "z" looks like a folded piece
|
||||
of paper, if you look at it from the side.
|
||||
|
||||
|
||||
<!--
|
||||
CREATING AND DELETING FOLDS ~
|
||||
*zf* *E350*
|
||||
zf{motion} or
|
||||
{Visual}zf Operator to create a fold.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
The new fold will be closed for the "manual" method.
|
||||
'foldenable' will be set.
|
||||
Also see |fold-create-marker|.
|
||||
|
||||
*zF*
|
||||
zF Create a fold for N lines. Works like "zf".
|
||||
|
||||
:{range}fo[ld] *:fold* *:fo*
|
||||
Create a fold for the lines in {range}. Works like "zf".
|
||||
|
||||
*zd* *E351*
|
||||
zd Delete one fold at the cursor. When the cursor is on folded
|
||||
line, that fold is deleted. Nested folds are moved one level
|
||||
up. In Visual mode all folds (partially) in the selected area
|
||||
are deleted. Careful: This easily deletes more folds than you
|
||||
expect and there is no undo.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
*zD*
|
||||
zD Delete folds recursively at the cursor. In Visual mode all
|
||||
folds (partially) in the selected area and all nested folds in
|
||||
them are deleted.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
*zE* *E352*
|
||||
zE Eliminate all folds in the window.
|
||||
This only works when 'foldmethod' is "manual" or "marker".
|
||||
Also see |fold-delete-marker|.
|
||||
|
||||
|
||||
-->
|
||||
OPENING AND CLOSING FOLDS ~
|
||||
|
||||
A fold smaller than 'foldminlines' will always be displayed like it was open.
|
||||
Therefore the commands below may work differently on small folds.
|
||||
|
||||
*zo*
|
||||
zo Open one fold under the cursor. When a count is given, that
|
||||
many folds deep will be opened. In Visual mode one level of
|
||||
folds is opened for all lines in the selected area.
|
||||
|
||||
<!--
|
||||
*zO*
|
||||
zO Open all folds under the cursor recursively. Folds that don't
|
||||
contain the cursor line are unchanged.
|
||||
In Visual mode it opens all folds that are in the selected
|
||||
area, also those that are only partly selected.
|
||||
|
||||
-->
|
||||
*zc*
|
||||
zc Close one fold under the cursor. When a count is given, that
|
||||
many folds deep are closed. In Visual mode one level of folds
|
||||
is closed for all lines in the selected area.
|
||||
'foldenable' will be set.
|
||||
|
||||
<!--
|
||||
*zC*
|
||||
zC Close all folds under the cursor recursively. Folds that
|
||||
don't contain the cursor line are unchanged.
|
||||
In Visual mode it closes all folds that are in the selected
|
||||
area, also those that are only partly selected.
|
||||
'foldenable' will be set.
|
||||
|
||||
*za*
|
||||
za When on a closed fold: open it. When folds are nested, you
|
||||
may have to use "za" several times. When a count is given,
|
||||
that many closed folds are opened.
|
||||
When on an open fold: close it and set 'foldenable'. This
|
||||
will only close one level, since using "za" again will open
|
||||
the fold. When a count is given that many folds will be
|
||||
closed (that's not the same as repeating "za" that many
|
||||
times).
|
||||
|
||||
*zA*
|
||||
zA When on a closed fold: open it recursively.
|
||||
When on an open fold: close it recursively and set
|
||||
'foldenable'.
|
||||
|
||||
*zv*
|
||||
zv View cursor line: Open just enough folds to make the line in
|
||||
which the cursor is located not folded.
|
||||
|
||||
*zx*
|
||||
zx Update folds: Undo manually opened and closed folds: re-apply
|
||||
'foldlevel', then do "zv": View cursor line.
|
||||
|
||||
*zX*
|
||||
zX Undo manually opened and closed folds: re-apply 'foldlevel'.
|
||||
|
||||
*zm*
|
||||
zm Fold more: Subtract one from 'foldlevel'. If 'foldlevel' was
|
||||
already zero nothing happens.
|
||||
'foldenable' will be set.
|
||||
|
||||
-->
|
||||
*zM*
|
||||
zM Close all folds: set 'foldlevel' to 0.
|
||||
'foldenable' will be set.
|
||||
|
||||
<!--
|
||||
*zr*
|
||||
zr Reduce folding: Add one to 'foldlevel'.
|
||||
|
||||
-->
|
||||
*zR*
|
||||
zR Open all folds. This sets 'foldlevel' to highest fold level.
|
||||
|
||||
<!--
|
||||
*:foldo* *:foldopen*
|
||||
:{range}foldo[pen][!]
|
||||
Open folds in {range}. When [!] is added all folds are
|
||||
opened. Useful to see all the text in {range}. Without [!]
|
||||
one level of folds is opened.
|
||||
|
||||
*:foldc* *:foldclose*
|
||||
:{range}foldc[lose][!]
|
||||
Close folds in {range}. When [!] is added all folds are
|
||||
closed. Useful to hide all the text in {range}. Without [!]
|
||||
one level of folds is closed.
|
||||
|
||||
*zn*
|
||||
zn Fold none: reset 'foldenable'. All folds will be open.
|
||||
|
||||
*zN*
|
||||
zN Fold normal: set 'foldenable'. All folds will be as they
|
||||
were before.
|
||||
|
||||
*zi*
|
||||
zi Invert 'foldenable'.
|
||||
|
||||
|
||||
MOVING OVER FOLDS ~
|
||||
*[z*
|
||||
[z Move to the start of the current open fold. If already at the
|
||||
start, move to the start of the fold that contains it. If
|
||||
there is no containing fold, the command fails.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
*]z*
|
||||
]z Move to the end of the current open fold. If already at the
|
||||
end, move to the end of the fold that contains it. If there
|
||||
is no containing fold, the command fails.
|
||||
When a count is used, repeats the command N times.
|
||||
|
||||
*zj*
|
||||
zj Move downwards. to the start of the next fold. A closed fold
|
||||
is counted as one fold.
|
||||
When a count is used, repeats the command N times.
|
||||
This command can be used after an |operator|.
|
||||
|
||||
*zk*
|
||||
zk Move upwards to the end of the previous fold. A closed fold
|
||||
is counted as one fold.
|
||||
When a count is used, repeats the command N times.
|
||||
This command can be used after an |operator|.
|
||||
|
||||
|
||||
EXECUTING COMMANDS ON FOLDS ~
|
||||
|
||||
:[range]foldd[oopen] {cmd} *:foldd* *:folddoopen*
|
||||
Execute {cmd} on all lines that are not in a closed fold.
|
||||
When [range] is given, only these lines are used.
|
||||
Each time {cmd} is executed the cursor is positioned on the
|
||||
line it is executed for.
|
||||
This works like the ":global" command: First all lines that
|
||||
are not in a closed fold are marked. Then the {cmd} is
|
||||
executed for all marked lines. Thus when {cmd} changes the
|
||||
folds, this has no influence on where it is executed (except
|
||||
when lines are deleted, of course).
|
||||
Example: >
|
||||
:folddoopen s/end/loop_end/ge
|
||||
< Note the use of the "e" flag to avoid getting an error message
|
||||
where "end" doesn't match.
|
||||
|
||||
:[range]folddoc[losed] {cmd} *:folddoc* *:folddoclosed*
|
||||
Execute {cmd} on all lines that are in a closed fold.
|
||||
Otherwise like ":folddoopen".
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
3. Fold options *fold-options*
|
||||
|
||||
<!--
|
||||
COLORS *fold-colors*
|
||||
|
||||
The colors of a closed fold are set with the Folded group |hl-Folded|. The
|
||||
colors of the fold column are set with the FoldColumn group |hl-FoldColumn|.
|
||||
Example to set the colors: >
|
||||
|
||||
:highlight Folded guibg=grey guifg=blue
|
||||
:highlight FoldColumn guibg=darkgrey guifg=white
|
||||
|
||||
|
||||
FOLDLEVEL *fold-foldlevel*
|
||||
|
||||
'foldlevel' is a number option: The higher the more folded regions are open.
|
||||
When 'foldlevel' is 0, all folds are closed.
|
||||
When 'foldlevel' is positive, some folds closed.
|
||||
When 'foldlevel' is very high, all folds are open.
|
||||
'foldlevel' is applied when it is changed. After that manually folds can be
|
||||
opened and closed.
|
||||
When increased, folds above the new level are opened. No manually opened
|
||||
folds will be closed.
|
||||
When decreased, folds above the new level are closed. No manually closed
|
||||
folds will be opened.
|
||||
|
||||
|
||||
FOLDTEXT *fold-foldtext*
|
||||
|
||||
'foldtext' is a string option that specifies an expression. This expression
|
||||
is evaluated to obtain the text displayed for a closed fold. Example: >
|
||||
|
||||
:set foldtext=v:folddashes.substitute(getline(v:foldstart),'/\\*\\\|\\*/\\\|{{{\\d\\=','','g')
|
||||
|
||||
This shows the first line of the fold, with "/*", "*/" and "{{{" removed.
|
||||
Note the use of backslashes to avoid some characters to be interpreted by the
|
||||
":set" command. It's simpler to define a function and call that: >
|
||||
|
||||
:set foldtext=MyFoldText()
|
||||
:function MyFoldText()
|
||||
: let line = getline(v:foldstart)
|
||||
: let sub = substitute(line, '/\*\|\*/\|{{{\d\=', '', 'g')
|
||||
: return v:folddashes . sub
|
||||
:endfunction
|
||||
|
||||
Evaluating 'foldtext' is done in the |sandbox|. The current window is set to
|
||||
the window that displays the line. Errors are ignored.
|
||||
|
||||
The default value is |foldtext()|. This returns a reasonable text for most
|
||||
types of folding. If you don't like it, you can specify your own 'foldtext'
|
||||
expression. It can use these special Vim variables:
|
||||
v:foldstart line number of first line in the fold
|
||||
v:foldend line number of last line in the fold
|
||||
v:folddashes a string that contains dashes to represent the
|
||||
foldlevel.
|
||||
v:foldlevel the foldlevel of the fold
|
||||
|
||||
In the result a TAB is replaced with a space and unprintable characters are
|
||||
made into printable characters.
|
||||
|
||||
The resulting line is truncated to fit in the window, it never wraps.
|
||||
When there is room after the text, it is filled with the character specified
|
||||
by 'fillchars'.
|
||||
|
||||
Note that backslashes need to be used for characters that the ":set" command
|
||||
handles differently: Space, backslash and double-quote. |option-backslash|
|
||||
|
||||
|
||||
FOLDCOLUMN *fold-foldcolumn*
|
||||
|
||||
'foldcolumn' is a number, which sets the width for a column on the side of the
|
||||
window to indicate folds. When it is zero, there is no foldcolumn. A normal
|
||||
value is 4 or 5. The minimal useful value is 2. The maximum is 12.
|
||||
|
||||
An open fold is indicated with a column that has a '-' at the top and '|'
|
||||
characters below it. This column stops where the open fold stops. When folds
|
||||
nest, the nested fold is one character right of the fold it's contained in.
|
||||
|
||||
A closed fold is indicated with a '+'.
|
||||
|
||||
Where the fold column is too narrow to display all nested folds, digits are
|
||||
shown to indicate the nesting level.
|
||||
|
||||
The mouse can also be used to open and close folds by clicking in the
|
||||
fold column:
|
||||
- Click on a '+' to open the closed fold at this row.
|
||||
- Click on any other non-blank character to close the open fold at this row
|
||||
|
||||
|
||||
OTHER OPTIONS
|
||||
|
||||
'foldenable' 'fen': Open all folds while not set.
|
||||
'foldexpr' 'fde': Expression used for "expr" folding.
|
||||
'foldignore' 'fdi': Characters used for "indent" folding.
|
||||
'foldmarker' 'fmr': Defined markers used for "marker" folding.
|
||||
'foldmethod' 'fdm': Name of the current folding method.
|
||||
'foldminlines' 'fml': Minimum number of screen lines for a fold to be
|
||||
displayed closed.
|
||||
'foldnestmax' 'fdn': Maximum nesting for "indent" and "syntax" folding.
|
||||
'foldopen' 'fdo': Which kinds of commands open closed folds.
|
||||
'foldclose' 'fcl': When the folds not under the cursor are closed.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
4. Behavior of folds *fold-behavior*
|
||||
|
||||
<!--
|
||||
When moving the cursor upwards or downwards and when scrolling, the cursor
|
||||
will move to the first line of a sequence of folded lines. When the cursor is
|
||||
already on a folded line, it moves to the next unfolded line or the next
|
||||
closed fold.
|
||||
|
||||
While the cursor is on folded lines, the cursor is always displayed in the
|
||||
first column. The ruler does show the actual cursor position, but since the
|
||||
line is folded, it cannot be displayed there.
|
||||
|
||||
Movement commands handle a sequence of folded lines like an empty line. For
|
||||
example, the "w" command stops once in the first column.
|
||||
|
||||
When in Insert mode, the cursor line is never folded. That allows you to see
|
||||
what you type!
|
||||
|
||||
When using an operator, a closed fold is included as a whole. Thus "dl"
|
||||
deletes the whole closed fold under the cursor.
|
||||
|
||||
For Ex commands the range is adjusted to always start at the first line of a
|
||||
fold and end at the last line of a fold. Thus this command: >
|
||||
:s/foo/bar/g
|
||||
when used with the cursor on a closed fold, will replace "foo" with "bar" in
|
||||
all lines of the fold.
|
||||
This does not happen for |:folddoopen| and |:folddoclosed|.
|
||||
|
||||
When editing a buffer that has been edited before, the last used folding
|
||||
settings are used again. For manual folding the defined folds are restored.
|
||||
For all folding methods the manually opened and closed folds are restored.
|
||||
If this buffer has been edited in this window, the values from back then are
|
||||
used. Otherwise the values from the window where the buffer was edited last
|
||||
are used.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
910
help/txt/gui.txt
910
help/txt/gui.txt
@@ -1,910 +0,0 @@
|
||||
*gui.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Vim's Graphical User Interface *gui* *GUI*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Starting the GUI |gui-start|
|
||||
2. Scrollbars |gui-scrollbars|
|
||||
3. Mouse Control |gui-mouse|
|
||||
4. Making GUI Selections |gui-selections|
|
||||
5. Menus |menus|
|
||||
6. Extras |gui-extras|
|
||||
7. Shell Commands |gui-shell|
|
||||
|
||||
Other GUI documentation:
|
||||
|gui_x11.txt| For specific items of the X11 GUI.
|
||||
|gui_w32.txt| For specific items of the Win32 GUI.
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *gui-start* *E229* *E233*
|
||||
|
||||
First you must make sure you actually have a version of Vim with the GUI code
|
||||
included. You can check this with the ":version" command, it should include
|
||||
"+GUI_Athena", "+GUI_BeOS", "+GUI_GTK", "+GUI_Motif" or "MS-Windows ... bit
|
||||
GUI version".
|
||||
|
||||
How to start the GUI depends on the system used. Mostly you can run the
|
||||
GUI version of Vim with:
|
||||
gvim [options] [files...]
|
||||
|
||||
The X11 version of Vim can run both in GUI and in non-GUI mode. See
|
||||
|gui-x11-start|.
|
||||
|
||||
*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.
|
||||
- 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
|
||||
'guioptions'. *buffers-menu* *no_buffers_menu*
|
||||
The system menu file includes a "Buffers" menu. If you don't want this, set
|
||||
the "no_buffers_menu" variable in your .vimrc (not .gvimrc!): >
|
||||
:let no_buffers_menu = 1
|
||||
< NOTE: Switching on syntax highlighting also loads the menu file, thus
|
||||
disabling the buffer menu must be done before ":syntax on".
|
||||
The path names are truncated to 35 characters. You can truncate them at a
|
||||
different length, for example 50, like this: >
|
||||
:let bmenu_max_pathlen = 50
|
||||
- If the "-U {gvimrc}" command-line option has been used when starting Vim,
|
||||
the {gvimrc} file will be read for initializations. The following
|
||||
initializations are skipped.
|
||||
- For Unix and MS-Windows, if the system gvimrc exists, it is sourced. The
|
||||
name of this file is normally "$VIM/gvimrc". You can check this with
|
||||
":version". Also see |$VIM|.
|
||||
- The following are tried, and only the first one that exists is used:
|
||||
- If the GVIMINIT environment variable exists and is not empty, it is
|
||||
executed as an Ex command.
|
||||
- If the user gvimrc file exists, it is sourced. The name of this file is
|
||||
normally "$HOME/.gvimrc". You can check this with ":version".
|
||||
- For Win32, when $HOME is not set, "$VIM\_gvimrc" is used.
|
||||
- When a "_gvimrc" file is not found, ".gvimrc" is tried too. And vice
|
||||
versa.
|
||||
- If the 'exrc' option is set (which is NOT the default) the file ./.gvimrc
|
||||
is sourced, if it exists and isn't the same file as the system or user
|
||||
gvimrc file. If this file is not owned by you, some security restrictions
|
||||
apply. When ".gvimrc" is not found, "_gvimrc" is tried too. For Macintosh
|
||||
and DOS/Win32 "_gvimrc" is tried first.
|
||||
|
||||
NOTE: All but the first one are not carried out if Vim was started with
|
||||
"-u NONE" and no "-U" argument was given, or when started with "-U NONE".
|
||||
|
||||
All this happens AFTER the normal Vim initializations, like reading your
|
||||
.vimrc file. See |initialization|.
|
||||
But the GUI window is only opened after all the initializations have been
|
||||
carried out. If you want some commands to be executed just after opening the
|
||||
GUI window, use the |GUIEnter| autocommand event. Example: >
|
||||
:autocommand GUIEnter * winpos 100 50
|
||||
|
||||
You can use the gvimrc files to set up your own customized menus (see |:menu|)
|
||||
and initialize other things that you may want to set up differently from the
|
||||
terminal version.
|
||||
|
||||
Recommended place for your personal GUI initializations:
|
||||
Unix $HOME/.gvimrc
|
||||
OS/2 $HOME/.gvimrc or $VIM/.gvimrc
|
||||
MS-DOS and Win32 $HOME/_gvimrc or $VIM/_gvimrc
|
||||
Amiga s:.gvimrc or $VIM/.gvimrc
|
||||
|
||||
There are a number of options which only have meaning in the GUI version of
|
||||
Vim. These are 'guicursor', 'guifont', 'guipty' and 'guioptions'. They are
|
||||
documented in |options.txt| with all the other options.
|
||||
|
||||
If using the Motif or Athena version of the GUI (but not for the GTK+ or Win32
|
||||
version), a number of X resources are available. See |gui-resources|.
|
||||
|
||||
Another way to set the colors for different occasions is with highlight
|
||||
groups. The "Normal" group is used to set the background and foreground
|
||||
colors. Example (which looks nice): >
|
||||
|
||||
:highlight Normal guibg=grey90
|
||||
|
||||
The "guibg" and "guifg" settings override the normal background and
|
||||
foreground settings. The other settings for the Normal highlight group are
|
||||
not used. Use the 'guifont' option to set the font.
|
||||
|
||||
Also check out the 'guicursor' option, to set the colors for the cursor in
|
||||
various modes.
|
||||
|
||||
Vim tries to make the window fit on the screen when it starts up. This avoids
|
||||
that you can't see part of it. On the X Window System this requires a bit of
|
||||
guesswork. You can change the height that is used for the window title and a
|
||||
task bar with the 'guiheadroom' option.
|
||||
|
||||
*:winp* *:winpos* *E188*
|
||||
:winp[os]
|
||||
Display current position of the top left corner of the GUI vim
|
||||
window in pixels. Does not work in all versions.
|
||||
|
||||
:winp[os] {X} {Y} *E466*
|
||||
Put the GUI vim window at the given {X} and {Y} coordinates.
|
||||
The coordinates should specify the position in pixels of the
|
||||
top left corner of the window. Does not work in all versions.
|
||||
Does work in an (new) xterm |xterm-color|.
|
||||
When the GUI window has not been opened yet, the values are
|
||||
remembered until the window is opened. The position is
|
||||
adjusted to make the window fit on the screen (if possible).
|
||||
|
||||
*:win* *:winsize* *E465*
|
||||
:win[size] {width} {height}
|
||||
Set the window height to {width} by {height} characters.
|
||||
Obsolete, use ":set lines=11 columns=22".
|
||||
|
||||
If you are running the X Window System, you can get information about the
|
||||
window Vim is running in with this command: >
|
||||
:!xwininfo -id $WINDOWID
|
||||
|
||||
==============================================================================
|
||||
2. Scrollbars *gui-scrollbars*
|
||||
|
||||
There are vertical scrollbars and a horizontal scrollbars. You may
|
||||
configure which ones appear with the 'guioptions' option.
|
||||
|
||||
The interface looks like this (with ":set guioptions=mlrb"):
|
||||
|
||||
+------------------------------+
|
||||
| File Edit Help | <- Menu bar (m)
|
||||
+-+--------------------------+-+
|
||||
|^| |^|
|
||||
|#| Text area. |#|
|
||||
| | | |
|
||||
|v|__________________________|v|
|
||||
Normal status line -> |-+ File.c 5,2 +-|
|
||||
between Vim windows |^|""""""""""""""""""""""""""|^|
|
||||
| | | |
|
||||
| | Another file buffer. | |
|
||||
| | | |
|
||||
|#| |#|
|
||||
Left scrollbar (l) -> |#| |#| <- Right
|
||||
|#| |#| scrollbar (r)
|
||||
| | | |
|
||||
|v| |v|
|
||||
+-+--------------------------+-+
|
||||
| |< #### >| | <- Bottom
|
||||
+-+--------------------------+-+ scrollbar (b)
|
||||
|
||||
Any of the scrollbar or menu components may be turned off by not putting the
|
||||
appropriate letter in the 'guioptions' string. The bottom scrollbar is
|
||||
only useful when 'nowrap' is set.
|
||||
|
||||
|
||||
Vertical Scrollbars *gui-vert-scroll*
|
||||
|
||||
Each Vim window has a scrollbar next to it which may be scrolled up and down
|
||||
to move through the text in that buffer. The size of the scrollbar-thumb
|
||||
indicates the fraction of the buffer which can be seen in the window.
|
||||
When the scrollbar is dragged all the way down, the last line of the file
|
||||
will appear in the top of the window.
|
||||
|
||||
If a window is shrunk to zero height (by the growth of another window) its
|
||||
scrollbar disappears. It reappears when the window is restored.
|
||||
|
||||
If a window is vertically split, it will only get a scrollbar when it is the
|
||||
current window, or the middle of the current window is above or below it.
|
||||
When there are scrollbars on both sides, and the middle of the current window
|
||||
is on the left halve, the right scrollbar column will contain scrollbars for
|
||||
the rightmost windows. The same happens on the other side.
|
||||
|
||||
|
||||
Horizontal Scrollbars *gui-horiz-scroll*
|
||||
|
||||
The horizontal scrollbar (at the bottom of the Vim GUI) may be used to
|
||||
scroll text sideways when the 'wrap' option is turned off. The
|
||||
scrollbar-thumb size is such that the text of the current cursor line may be
|
||||
scrolled as far as possible left and right.
|
||||
|
||||
*athena-intellimouse*
|
||||
If you have an Intellimouse and an X server that supports using the wheel,
|
||||
then you can use the wheel to scroll the text up and down in gvim. This works
|
||||
with XFree86 4.0 and later, and with some older versions when you add patches.
|
||||
See |scroll-mouse-wheel|.
|
||||
|
||||
For older versions of XFree86 you must patch your X server. The following
|
||||
page has a bit of information about using the Intellimouse on Linux as well as
|
||||
links to the patches and X server binaries (may not have the one you need
|
||||
though):
|
||||
http://www.inria.fr/koala/colas/mouse-wheel-scroll/
|
||||
|
||||
==============================================================================
|
||||
3. Mouse Control *gui-mouse*
|
||||
|
||||
The mouse only works if the appropriate flag in the 'mouse' option is set.
|
||||
When the GUI is switched on, and 'mouse' wasn't set yet, the 'mouse' option is
|
||||
automatically set to "a", enabling it for all modes except for the
|
||||
|hit-enter| prompt. If you don't want this, a good place to change the
|
||||
'mouse' option is the "gvimrc" file.
|
||||
|
||||
Other options that are relevant:
|
||||
'mousefocus' window focus follows mouse pointer |gui-mouse-focus|
|
||||
'mousemodel' what mouse button does which action
|
||||
'mousehide' hide mouse pointer while typing text
|
||||
'selectmode' whether to start Select mode or Visual mode
|
||||
|
||||
A quick way to set these is with the ":behave" command.
|
||||
*:behave* *:be*
|
||||
:be[have] {model} Set behavior for mouse and selection. Valid
|
||||
arguments are:
|
||||
mswin MS-Windows behavior
|
||||
xterm Xterm behavior
|
||||
|
||||
Using ":behave" changes these options:
|
||||
option mswin xterm ~
|
||||
'selectmode' "mouse,key" ""
|
||||
'mousemodel' "popup" "extend"
|
||||
'keymodel' "startsel,stopsel" ""
|
||||
'selection' "exclusive" "inclusive"
|
||||
|
||||
In the $VIMRUNTIME directory, there is a script called "mswin.vim", which will
|
||||
also map a few keys to the MS-Windows cut/copy/paste commands. This is NOT
|
||||
compatible, since it uses the CTRL-V, CTRL-X and CTRL-C keys. If you don't
|
||||
mind, use this command: >
|
||||
:so $VIMRUNTIME/mswin.vim
|
||||
|
||||
For scrolling with a wheel on a mouse, see |scroll-mouse-wheel|.
|
||||
|
||||
|
||||
3.1 Moving Cursor with Mouse *gui-mouse-move*
|
||||
|
||||
Click the left mouse button somewhere in a text buffer where you want the
|
||||
cursor to go, and it does!
|
||||
This works in when 'mouse' contains ~
|
||||
Normal mode 'n' or 'a'
|
||||
Visual mode 'v' or 'a'
|
||||
Insert mode 'i' or 'a'
|
||||
|
||||
Select mode is handled like Visual mode.
|
||||
|
||||
You may use this with an operator such as 'd' to delete text from the current
|
||||
cursor position to the position you point to with the mouse. That is, you hit
|
||||
'd' and then click the mouse somewhere.
|
||||
|
||||
*gui-mouse-focus*
|
||||
The 'mousefocus' option can be set to make the keyboard focus follow the
|
||||
mouse pointer. This means that the window where the mouse pointer is, is the
|
||||
active window. Warning: this doesn't work very well when using a menu,
|
||||
because the menu command will always be applied to the top window.
|
||||
|
||||
If you are on the ':' line (or '/' or '?'), then clicking the left or right
|
||||
mouse button will position the cursor on the ':' line (if 'mouse' contains
|
||||
'c', 'a' or 'A').
|
||||
|
||||
In any situation the middle mouse button may be clicked to paste the current
|
||||
selection.
|
||||
|
||||
|
||||
3.2 Selection with Mouse *gui-mouse-select*
|
||||
|
||||
The mouse can be used to start a selection. How depends on the 'mousemodel'
|
||||
option:
|
||||
'mousemodel' is "extend": use the right mouse button
|
||||
'mousemodel' is "popup": use the left mouse button, while keeping the Shift
|
||||
key pressed.
|
||||
|
||||
If there was no selection yet, this starts a selection from the old cursor
|
||||
position to the position pointed to with the mouse. If there already is a
|
||||
selection then the closest end will be extended.
|
||||
|
||||
If 'selectmode' contains "mouse", then the selection will be in Select mode.
|
||||
This means that typing normal text will replace the selection. See
|
||||
|Select-mode|. Otherwise, the selection will be in Visual mode.
|
||||
|
||||
Double clicking may be done to make the selection word-wise, triple clicking
|
||||
makes it line-wise, and quadruple clicking makes it rectangular block-wise.
|
||||
|
||||
See |gui-selections| on how the selection is used.
|
||||
|
||||
|
||||
3.3 Other Text Selection with Mouse *gui-mouse-modeless*
|
||||
*modeless-selection*
|
||||
A different kind of selection is used when:
|
||||
- in Command-line mode
|
||||
- in the Command-line window and pointing in another window
|
||||
- at the |hit-enter| prompt
|
||||
- whenever the current mode is not in the 'mouse' option
|
||||
- when holding the CTRL and SHIFT keys in the GUI
|
||||
Since Vim continues like the selection isn't there, and there is no mode
|
||||
associated with the selection, this is called modeless selection. Any text in
|
||||
the Vim window can be selected. Select the text by pressing the left mouse
|
||||
button at the start, drag to the end and release. To extend the selection,
|
||||
use the right mouse button when 'mousemodel' is "extend", or the left mouse
|
||||
button with the shift key pressed when 'mousemodel' is "popup".
|
||||
The middle mouse button pastes the text.
|
||||
The selection is removed when the selected text is scrolled or changed.
|
||||
On the command line CTRL-Y can be used to copy the selection into the
|
||||
clipboard. To do this from Insert mode, use CTRL-O : CTRL-Y <CR>.
|
||||
|
||||
|
||||
3.4 Using Mouse on Status Lines *gui-mouse-status*
|
||||
|
||||
Clicking the left or right mouse button on the status line below a Vim
|
||||
window makes that window the current window. This actually happens on button
|
||||
release (to be able to distinguish a click from a drag action).
|
||||
|
||||
With the left mouse button a status line can be dragged up and down, thus
|
||||
resizing the windows above and below it. This does not change window focus.
|
||||
|
||||
The same can be used on the vertical separator: click to give the window left
|
||||
of it focus, drag left and right to make windows wider and narrower.
|
||||
|
||||
|
||||
3.5 Various Mouse Clicks *gui-mouse-various*
|
||||
|
||||
<S-LeftMouse> Search forward for the word under the mouse click.
|
||||
When 'mousemodel' is "popup" this starts or extends a
|
||||
selection.
|
||||
<S-RightMouse> Search backward for the word under the mouse click.
|
||||
<C-LeftMouse> Jump to the tag name under the mouse click.
|
||||
<C-RightMouse> Jump back to position before the previous tag jump
|
||||
(same as "CTRL-T")
|
||||
|
||||
|
||||
3.6 Mouse Mappings *gui-mouse-mapping*
|
||||
|
||||
The mouse events, complete with modifiers, may be mapped. Eg: >
|
||||
:map <S-LeftMouse> <RightMouse>
|
||||
:map <S-LeftDrag> <RightDrag>
|
||||
:map <S-LeftRelease> <RightRelease>
|
||||
:map <2-S-LeftMouse> <2-RightMouse>
|
||||
:map <2-S-LeftDrag> <2-RightDrag>
|
||||
:map <2-S-LeftRelease> <2-RightRelease>
|
||||
:map <3-S-LeftMouse> <3-RightMouse>
|
||||
:map <3-S-LeftDrag> <3-RightDrag>
|
||||
:map <3-S-LeftRelease> <3-RightRelease>
|
||||
:map <4-S-LeftMouse> <4-RightMouse>
|
||||
:map <4-S-LeftDrag> <4-RightDrag>
|
||||
:map <4-S-LeftRelease> <4-RightRelease>
|
||||
These mappings make selection work the way it probably should in a Motif
|
||||
application, with shift-left mouse allowing for extending the visual area
|
||||
rather than the right mouse button.
|
||||
|
||||
Mouse mapping with modifiers does not work for modeless selection.
|
||||
|
||||
==============================================================================
|
||||
4. Making GUI Selections *gui-selections*
|
||||
|
||||
*quotestar*
|
||||
You may make selections with the mouse (see |gui-mouse-select|), or by using
|
||||
Vim's Visual mode (see |v|). If 'a' is present in 'guioptions', then
|
||||
whenever a selection is started (Visual or Select mode), or when the selection
|
||||
is changed, Vim becomes the owner of the windowing system's primary selection
|
||||
(on MS-Windows the |gui-clipboard| is used; under X11, the |x11-selection| is
|
||||
used - you should read whichever of these is appropriate now).
|
||||
|
||||
*clipboard*
|
||||
There is a special register for storing this selection, it is the "*
|
||||
register. Nothing is put in here unless the information about what text is
|
||||
selected is about to change (eg with a left mouse click somewhere), or when
|
||||
another application wants to paste the selected text. Then the text is put
|
||||
in the "* register. For example, to cut a line and make it the current
|
||||
selection/put it on the clipboard: >
|
||||
|
||||
"*dd
|
||||
|
||||
Similarly, when you want to paste a selection from another application, e.g.,
|
||||
by clicking the middle mouse button, the selection is put in the "* register
|
||||
first, and then 'put' like any other register. For example, to put the
|
||||
selection (contents of the clipboard): >
|
||||
|
||||
"*p
|
||||
|
||||
When using this register under X11, also see |x11-selection|. This also
|
||||
explains the related "+ register.
|
||||
|
||||
Note that when pasting text from one Vim into another separate Vim, the type
|
||||
of selection (character, line, or block) will also be copied. For other
|
||||
applications the type is always character. However, if the text gets
|
||||
transferred via the |x11-cut-buffer|, the selection type is ALWAYS lost.
|
||||
|
||||
When the "unnamed" string is included in the 'clipboard' option, the unnamed
|
||||
register is the same as the "* register. Thus you can yank to and paste the
|
||||
selection without prepending "* to commands.
|
||||
|
||||
==============================================================================
|
||||
5. Menus *menus*
|
||||
|
||||
For an introduction see |usr_42.txt| in the user manual.
|
||||
|
||||
|
||||
5.1 Using Menus *using-menus*
|
||||
|
||||
Basically, menus can be used just like mappings. You can define you own
|
||||
menus, as many as you like.
|
||||
Long-time Vim users won't use menus much. But the power is in adding your own
|
||||
menus and menu items. They are most useful for things that you can't remember
|
||||
what the key sequence was.
|
||||
|
||||
For creating menus in a different language, see |:menutrans|.
|
||||
|
||||
*menu.vim*
|
||||
The default menus are read from the file "$VIMRUNTIME/menu.vim". See
|
||||
|$VIMRUNTIME| for where the path comes from. You can set up your own menus.
|
||||
Starting off with the default set is a good idea. You can add more items, or,
|
||||
if you don't like the defaults at all, start with removing all menus
|
||||
|:unmenu-all|. You can also avoid the default menus being loaded by adding
|
||||
this line to your .vimrc file (NOT your .gvimrc file!): >
|
||||
:let did_install_default_menus = 1
|
||||
If you also want to avoid the Syntax menu: >
|
||||
:let did_install_syntax_menu = 1
|
||||
If you do want the Syntax menu but not all the entries for each available
|
||||
syntax file (which take quite a bit of time to load): >
|
||||
:let skip_syntax_sel_menu = 1
|
||||
<
|
||||
*console-menus*
|
||||
Although this documentation is in the GUI section, you can actually use menus
|
||||
in console mode too. You will have to load |menu.vim| explicitly then, it is
|
||||
not done by default. You can use the |:emenu| command and command-line
|
||||
completion with 'wildmenu' to access the menu entries almost like a real menu
|
||||
system. To do this, put these commands in your .vimrc file: >
|
||||
:source $VIMRUNTIME/menu.vim
|
||||
:set wildmenu
|
||||
:set cpo-=<
|
||||
:set wcm=<C-Z>
|
||||
:map <F4> :emenu <C-Z>
|
||||
Pressing <F4> will start the menu. You can now use the cursor keys to select
|
||||
a menu entry. Hit <Enter> to execute it. Hit <Esc> if you want to cancel.
|
||||
This does require the |+menu| feature enabled at compile time.
|
||||
|
||||
*tear-off-menus*
|
||||
GTK+ and Motif support Tear-off menus. These are sort of sticky menus or
|
||||
pop-up menus that are present all the time. If the resizing does not work
|
||||
correctly, this may be caused by using something like "Vim*geometry" in the
|
||||
defaults. Use "Vim.geometry" instead.
|
||||
|
||||
The Win32 GUI version emulates Motif's tear-off menus. Actually, a Motif user
|
||||
will spot the differences easily, but hopefully they're just as useful. You
|
||||
can also use the |:tearoff| command together with |hidden-menus| to create
|
||||
floating menus that do not appear on the main menu bar.
|
||||
|
||||
|
||||
5.2 Creating New Menus *creating-menus*
|
||||
|
||||
*:me* *:menu* *:noreme* *:noremenu*
|
||||
*:am* *:amenu* *:an* *:anoremenu*
|
||||
*:nme* *:nmenu* *:nnoreme* *:nnoremenu*
|
||||
*:ome* *:omenu* *:onoreme* *:onoremenu*
|
||||
*:vme* *:vmenu* *:vnoreme* *:vnoremenu*
|
||||
*:ime* *:imenu* *:inoreme* *:inoremenu*
|
||||
*:cme* *:cmenu* *:cnoreme* *:cnoremenu*
|
||||
*E330* *E327* *E331* *E336* *E333*
|
||||
*E328* *E329* *E337*
|
||||
To create a new menu item, use the ":menu" commands. They are mostly like
|
||||
the ":map" set of commands but the first argument is a menu item name, given
|
||||
as a path of menus and submenus with a '.' between them. eg: >
|
||||
|
||||
:menu File.Save :w<CR>
|
||||
:inoremenu File.Save <C-O>:w<CR>
|
||||
:menu Edit.Big\ Changes.Delete\ All\ Spaces :%s/[ ^I]//g<CR>
|
||||
|
||||
This last one will create a new item in the menu bar called "Edit", holding
|
||||
the mouse button down on this will pop up a menu containing the item
|
||||
"Big Changes", which is a sub-menu containing the item "Delete All Spaces",
|
||||
which when selected, performs the operation.
|
||||
|
||||
Special characters in a menu name:
|
||||
|
||||
& The next character is the shortcut key. Make sure each
|
||||
shortcut key is only used once in a (sub)menu. If you want to
|
||||
insert a literal "&" in the menu name use "&&".
|
||||
<Tab> Separates the menu name from right-aligned text. This can be
|
||||
used to show the equivalent typed command. The text "<Tab>"
|
||||
can be used here for convenience. If you are using a real
|
||||
Tab, don't forget to put a backslash before it!
|
||||
Example: >
|
||||
|
||||
:amenu &File.&Open<Tab>:e :browse e<CR>
|
||||
|
||||
[typed literally]
|
||||
With the shortcut "F" (while keeping the <Alt> key pressed), and then "O",
|
||||
this menu can be used. The second part is shown as "Open :e". The ":e"
|
||||
is right aligned, and the "O" is underlined, to indicate it is the shortcut.
|
||||
|
||||
The ":amenu" command can be used to define menu entries for all modes at once.
|
||||
To make the command work correctly, a character is automatically inserted for
|
||||
some modes:
|
||||
mode inserted appended ~
|
||||
Normal nothing nothing
|
||||
Visual <C-C> <C-\><C-G>
|
||||
Insert <C-O>
|
||||
Cmdline <C-C> <C-\><C-G>
|
||||
Op-pending <C-C> <C-\><C-G>
|
||||
|
||||
Appending CTRL-\ CTRL-G is for going back to insert mode when 'insertmode' is
|
||||
set. |CTRL-\_CTRL-G|
|
||||
|
||||
Example: >
|
||||
|
||||
:amenu File.Next :next^M
|
||||
|
||||
is equal to: >
|
||||
|
||||
:nmenu File.Next :next^M
|
||||
:vmenu File.Next ^C:next^M^\^G
|
||||
:imenu File.Next ^O:next^M
|
||||
:cmenu File.Next ^C:next^M^\^G
|
||||
:omenu File.Next ^C:next^M^\^G
|
||||
|
||||
Careful: In Insert mode this only works for a SINGLE Normal mode command,
|
||||
because of the CTRL-O. If you have two or more commands, you will need to use
|
||||
the ":imenu" command. For inserting text in any mode, you can use the
|
||||
expression register: >
|
||||
|
||||
:amenu Insert.foobar "='foobar'<CR>P
|
||||
|
||||
Note that the '<' and 'k' flags in 'cpoptions' also apply here (when
|
||||
included they make the <> form and raw key codes not being recognized).
|
||||
|
||||
Note that <Esc> in Cmdline mode executes the command, like in a mapping. This
|
||||
is Vi compatible. Use CTRL-C to quit Cmdline mode.
|
||||
|
||||
*:menu-<silent>* *:menu-silent*
|
||||
To define a menu which will not be echoed on the command line, add
|
||||
"<silent>" as the first argument. Example: >
|
||||
:menu <silent> Settings.Ignore\ case :set ic<CR>
|
||||
The ":set ic" will not be echoed when using this menu. Messages from the
|
||||
executed command are still given though. To shut them up too, add a ":silent"
|
||||
in the executed command: >
|
||||
:menu <silent> Search.Header :exe ":silent normal /Header\r"<CR>
|
||||
<
|
||||
*:menu-<script>* *:menu-script*
|
||||
The "to" part of the menu will be inspected for mappings. If you don't want
|
||||
this, use the ":noremenu" command (or the similar one for a specific mode).
|
||||
If you do want to use script-local mappings, add "<script>" as the very first
|
||||
argument to the ":menu" command or after "<silent>".
|
||||
|
||||
*menu-priority*
|
||||
You can give a priority to a menu. Menus with a higher priority go more to
|
||||
the right. The priority is given as a number before the ":menu" command.
|
||||
Example: >
|
||||
:80menu Buffer.next :bn<CR>
|
||||
|
||||
The default menus have these priorities:
|
||||
File 10
|
||||
Edit 20
|
||||
Tools 40
|
||||
Syntax 50
|
||||
Buffers 60
|
||||
Window 70
|
||||
Help 9999
|
||||
|
||||
When no or zero priority is given, 500 is used.
|
||||
The priority for the PopUp menu is not used.
|
||||
|
||||
The Help menu will be placed on the far right side of the menu bar on systems
|
||||
which support this (Motif and GTK+). For GTK+ 2, this is not done anymore
|
||||
because right-aligning the Help menu is now discouraged UI design.
|
||||
|
||||
You can use a priority higher than 9999, to make it go after the Help menu,
|
||||
but that is non-standard and is discouraged. The highest possible priority is
|
||||
about 32000. The lowest is 1.
|
||||
|
||||
*sub-menu-priority*
|
||||
The same mechanism can be used to position a sub-menu. The priority is then
|
||||
given as a dot-separated list of priorities, before the menu name: >
|
||||
:menu 80.500 Buffer.next :bn<CR>
|
||||
Giving the sub-menu priority is only needed when the item is not to be put
|
||||
in a normal position. For example, to put a sub-menu before the other items: >
|
||||
:menu 80.100 Buffer.first :brew<CR>
|
||||
Or to put a sub-menu after the other items, and further items with default
|
||||
priority will be put before it: >
|
||||
:menu 80.900 Buffer.last :blast<CR>
|
||||
When a number is missing, the default value 500 will be used: >
|
||||
:menu .900 myMenu.test :echo "text"<CR>
|
||||
The menu priority is only used when creating a new menu. When it already
|
||||
existed, e.g., in another mode, the priority will not change. Thus, the
|
||||
priority only needs to be given the first time a menu is used.
|
||||
An exception is the PopUp menu. There is a separate menu for each mode
|
||||
(Normal, Op-pending, Visual, Insert, Cmdline). The order in each of these
|
||||
menus can be different. This is different from menu-bar menus, which have
|
||||
the same order for all modes.
|
||||
NOTE: sub-menu priorities currently don't work for all versions of the GUI.
|
||||
|
||||
*menu-separator* *E332*
|
||||
Menu items can be separated by a special item that inserts some space between
|
||||
items. Depending on the system this is displayed as a line or a dotted line.
|
||||
These items must start with a '-' and end in a '-'. The part in between is
|
||||
used to give it a unique name. Priorities can be used as with normal items.
|
||||
Example: >
|
||||
:menu Example.item1 :do something
|
||||
:menu Example.-Sep- :
|
||||
:menu Example.item2 :do something different
|
||||
Note that the separator also requires a rhs. It doesn't matter what it is,
|
||||
because the item will never be selected. Use a single colon to keep it
|
||||
simple.
|
||||
|
||||
*gui-toolbar*
|
||||
The toolbar is currently available in the Win32, Athena, Motif, GTK+ (X11) and
|
||||
Photon GUI. It should turn up in other GUIs in due course. The default
|
||||
toolbar is setup in menu.vim.
|
||||
The display of the toolbar is controlled by the 'guioptions' letter 'T'. You
|
||||
can thus have menu & toolbar together, or either on its own, or neither.
|
||||
The appearance is controlled by the 'toolbar' option. You can chose between
|
||||
an image, text or both.
|
||||
|
||||
*toolbar-icon*
|
||||
The toolbar is defined as a special menu called ToolBar, which only has one
|
||||
level. Vim interprets the items in this menu as follows:
|
||||
1) If an "icon=" argument was specified, the file with this name is used.
|
||||
The file can either be specified with the full path or with the base name.
|
||||
In the last case it is searched for in the "bitmaps" directory in
|
||||
'runtimepath, like in point 3). Examples: >
|
||||
:amenu icon=/usr/local/pixmaps/foo_icon.xpm ToolBar.Foo :echo "Foo"<CR>
|
||||
:amenu icon=FooIcon ToolBar.Foo :echo "Foo"<CR>
|
||||
< Note that in the first case the extension is included, while in the second
|
||||
case it is omitted.
|
||||
If the file cannot be opened the next points are tried.
|
||||
A space in the file name must be escaped with a backslash.
|
||||
A menu priority must come _after_ the icon argument: >
|
||||
:amenu icon=foo 1.42 ToolBar.Foo :echo "42!"<CR>
|
||||
2) An item called 'BuiltIn##', where ## is a number, is taken as number ## of
|
||||
the built-in bitmaps available in Vim. Currently there are 31 numbered
|
||||
from 0 to 30 which cover most common editing operations |builtin-tools|. >
|
||||
:amenu ToolBar.BuiltIn22 :call SearchNext("back")<CR>
|
||||
3) An item with another name is first searched for in the directory
|
||||
"bitmaps" in 'runtimepath'. If found, the bitmap file is used as the
|
||||
toolbar button image. Note that the exact filename is OS-specific: For
|
||||
example, under Win32 the command >
|
||||
:amenu ToolBar.Hello :echo "hello"<CR>
|
||||
< would find the file 'hello.bmp'. Under GTK+/X11 it is 'Hello.xpm'. With
|
||||
GTK+ 2 the files 'Hello.png', 'Hello.xpm' and 'Hello.bmp' are checked for
|
||||
existence, and the first one found would be used.
|
||||
For MS-Windows and GTK+ 2 the bitmap is scaled to fit the button. For
|
||||
MS-Windows a size of 18 by 18 pixels works best.
|
||||
For MS-Windows the bitmap should have 16 colors with the standard palette.
|
||||
The light grey pixels will be changed to the Window frame color and the
|
||||
dark grey pixels to the window shadow color. More colors might also work,
|
||||
depending on your system.
|
||||
4) If the bitmap is still not found, Vim checks for a match against its list
|
||||
of built-in names. Each built-in button image has a name.
|
||||
So the command >
|
||||
:amenu ToolBar.Open :e
|
||||
< will show the built in "open a file" button image if no open.bmp exists.
|
||||
All the built-in names can be seen used in menu.vim.
|
||||
5) If all else fails, a blank, but functioning, button is displayed.
|
||||
|
||||
*builtin-tools*
|
||||
nr Name Normal action ~
|
||||
00 New open new window
|
||||
01 Open browse for file to open in current window
|
||||
02 Save write buffer to file
|
||||
03 Undo undo last change
|
||||
04 Redo redo last undone change
|
||||
05 Cut delete selected text to clipboard
|
||||
06 Copy copy selected text to clipboard
|
||||
07 Paste paste text from clipboard
|
||||
08 Print print current buffer
|
||||
09 Help open a buffer on Vim's builtin help
|
||||
10 Find start a search command
|
||||
11 SaveAll write all modified buffers to file
|
||||
12 SaveSesn write session file for current situation
|
||||
13 NewSesn write new session file
|
||||
14 LoadSesn load session file
|
||||
15 RunScript browse for file to run as a Vim script
|
||||
16 Replace prompt for substitute command
|
||||
17 WinClose close current window
|
||||
18 WinMax make current window use many lines
|
||||
19 WinMin make current window use few lines
|
||||
20 WinSplit split current window
|
||||
21 Shell start a shell
|
||||
22 FindPrev search again, backward
|
||||
23 FindNext search again, forward
|
||||
24 FindHelp prompt for word to search help for
|
||||
25 Make run make and jump to first error
|
||||
26 TagJump jump to tag under the cursor
|
||||
27 RunCtags build tags for files in current directory
|
||||
28 WinVSplit split current window vertically
|
||||
29 WinMaxWidth make current window use many columns
|
||||
30 WinMinWidth make current window use few columns
|
||||
|
||||
*hidden-menus* *win32-hidden-menus*
|
||||
In the Win32 and GTK+ GUI, starting a menu name with ']' excludes that menu
|
||||
from the main menu bar. You must then use the |:popup| or |:tearoff| command
|
||||
to display it.
|
||||
|
||||
*popup-menu*
|
||||
In the Win32, GTK+, Motif, Athena and Photon GUI, you can define the special
|
||||
menu "PopUp". This is the menu that is displayed when the right mouse button
|
||||
is pressed, if 'mousemodel' is set to popup or popup_setpos.
|
||||
|
||||
|
||||
5.3 Showing What Menus Are Mapped To *showing-menus*
|
||||
|
||||
To see what an existing menu is mapped to, use just one argument after the
|
||||
menu commands (just like you would with the ":map" commands). If the menu
|
||||
specified is a submenu, then all menus under that hierarchy will be shown.
|
||||
If no argument is given after :menu at all, then ALL menu items are shown
|
||||
for the appropriate mode (eg, Command-line mode for :cmenu).
|
||||
|
||||
Special characters in the list, just before the rhs:
|
||||
* The menu was defined with "nore" to disallow remapping.
|
||||
& The menu was defined with "<script>" to allow remapping script-local
|
||||
mappings only.
|
||||
- The menu was disabled.
|
||||
|
||||
Note that hitting <Tab> while entering a menu name after a menu command may
|
||||
be used to complete the name of the menu item.
|
||||
|
||||
|
||||
5.4 Executing Menus *execute-menus*
|
||||
|
||||
*:em* *:emenu* *E334* *E335*
|
||||
:[range]em[enu] {menu} Execute {menu} from the command line.
|
||||
The default is to execute the Normal mode
|
||||
menu. If a range is specified, it executes
|
||||
the Visual mode menu.
|
||||
If used from <c-o>, it executes the
|
||||
insert-mode menu Eg: >
|
||||
:emenu File.Exit
|
||||
|
||||
If the console-mode vim has been compiled with WANT_MENU defined, you can
|
||||
use :emenu to access useful menu items you may have got used to from GUI
|
||||
mode. See 'wildmenu' for an option that works well with this. See
|
||||
|console-menus| for an example.
|
||||
|
||||
When using a range, if the lines match with '<,'>, then the menu is executed
|
||||
using the last visual selection.
|
||||
|
||||
|
||||
5.5 Deleting Menus *delete-menus*
|
||||
|
||||
*:unme* *:unmenu*
|
||||
*:aun* *:aunmenu*
|
||||
*:nunme* *:nunmenu*
|
||||
*:ounme* *:ounmenu*
|
||||
*:vunme* *:vunmenu*
|
||||
*:iunme* *:iunmenu*
|
||||
*:cunme* *:cunmenu*
|
||||
To delete a menu item or a whole submenu, use the unmenu commands, which are
|
||||
analogous to the unmap commands. Eg: >
|
||||
:unmenu! Edit.Paste
|
||||
|
||||
This will remove the Paste item from the Edit menu for Insert and
|
||||
Command-line modes.
|
||||
|
||||
Note that hitting <Tab> while entering a menu name after an umenu command
|
||||
may be used to complete the name of the menu item for the appropriate mode.
|
||||
|
||||
To remove all menus use: *:unmenu-all* >
|
||||
:unmenu * " remove all menus in Normal and visual mode
|
||||
:unmenu! * " remove all menus in Insert and Command-line mode
|
||||
|
||||
|
||||
5.6 Disabling Menus *disable-menus*
|
||||
|
||||
*:menu-disable* *:menu-enable*
|
||||
If you do not want to remove a menu, but disable it for a moment, this can be
|
||||
done by adding the "enable" or "disable" keyword to a ":menu" command.
|
||||
Examples: >
|
||||
:menu disable &File.&Open\.\.\.
|
||||
:amenu enable *
|
||||
:amenu disable &Tools.*
|
||||
|
||||
The command applies to the modes as used with all menu commands. Note that
|
||||
characters like "&" need to be included for translated names to be found.
|
||||
When the argument is "*", all menus are affected. Otherwise the given menu
|
||||
name and all existing submenus below it are affected.
|
||||
|
||||
|
||||
5.7 Examples for Menus *menu-examples*
|
||||
|
||||
Here is an example on how to add menu items with menu's! You can add a menu
|
||||
item for the keyword under the cursor. The register "z" is used. >
|
||||
|
||||
:nmenu Words.Add\ Var wb"zye:menu! Words.<C-R>z <C-R>z<CR>
|
||||
:nmenu Words.Remove\ Var wb"zye:unmenu! Words.<C-R>z<CR>
|
||||
:vmenu Words.Add\ Var "zy:menu! Words.<C-R>z <C-R>z <CR>
|
||||
:vmenu Words.Remove\ Var "zy:unmenu! Words.<C-R>z<CR>
|
||||
:imenu Words.Add\ Var <Esc>wb"zye:menu! Words.<C-R>z <C-R>z<CR>a
|
||||
:imenu Words.Remove\ Var <Esc>wb"zye:unmenu! Words.<C-R>z<CR>a
|
||||
|
||||
(the rhs is in <> notation, you can copy/paste this text to try out the
|
||||
mappings, or put these lines in your gvimrc; "<C-R>" is CTRL-R, "<CR>" is
|
||||
the <CR> key. |<>|)
|
||||
|
||||
|
||||
5.8 Tooltips & Menu tips
|
||||
|
||||
See section |42.4| in the user manual.
|
||||
|
||||
*:tmenu* *:tm*
|
||||
:tm[enu] {menupath} {rhs} Define a tip for a menu or tool. {only in
|
||||
X11 and Win32 GUI}
|
||||
|
||||
:tm[enu] [menupath] List menu tips. {only in X11 and Win32 GUI}
|
||||
|
||||
*:tunmenu* *:tu*
|
||||
:tu[nmenu] {menupath} Remove a tip for a menu or tool.
|
||||
{only in X11 and Win32 GUI}
|
||||
|
||||
When a tip is defined for a menu item, it appears in the command-line area
|
||||
when the mouse is over that item, much like a standard Windows menu hint in
|
||||
the status bar. (Except when Vim is in Command-line mode, when of course
|
||||
nothing is displayed.)
|
||||
When a tip is defined for a ToolBar item, it appears as a tooltip when the
|
||||
mouse pauses over that button, in the usual fashion. Use the |hl-Tooltip|
|
||||
highlight group to change its colors.
|
||||
|
||||
A "tip" can be defined for each menu item. For example, when defining a menu
|
||||
item like this: >
|
||||
:amenu MyMenu.Hello :echo "Hello"<CR>
|
||||
The tip is defined like this: >
|
||||
:tmenu MyMenu.Hello Displays a greeting.
|
||||
And delete it with: >
|
||||
:tunmenu MyMenu.Hello
|
||||
|
||||
Tooltips are currently only supported for the X11 and Win32 GUI. However, they
|
||||
should appear for the other gui platforms in the not too distant future.
|
||||
|
||||
The ":tmenu" command works just like other menu commands, it uses the same
|
||||
arguments. ":tunmenu" deletes an existing menu tip, in the same way as the
|
||||
other unmenu commands.
|
||||
|
||||
If a menu item becomes invalid (i.e. its actions in all modes are deleted) Vim
|
||||
deletes the menu tip (and the item) for you. This means that :aunmenu deletes
|
||||
a menu item - you don't need to do a :tunmenu as well.
|
||||
|
||||
|
||||
5.9 Popup Menus
|
||||
|
||||
In the Win32 and GTK+ GUI, you can cause a menu to popup at the cursor.
|
||||
This behaves similarly to the PopUp menus except that any menu tree can
|
||||
be popped up.
|
||||
|
||||
This command is for backwards compatibility, using it is discouraged, because
|
||||
it behaves in a strange way.
|
||||
|
||||
*:popup* *:popu*
|
||||
:pop[up] {name} Popup the menu {name}. The menu named must
|
||||
have at least one subentry, but need not
|
||||
appear on the menu-bar (see |hidden-menus|).
|
||||
{only available for Win32 and GTK GUI}
|
||||
|
||||
Example: >
|
||||
:popup File
|
||||
will make the "File" menu (if there is one) appear at the text cursor. >
|
||||
|
||||
:amenu ]Toolbar.Make :make<CR>
|
||||
:popup ]Toolbar
|
||||
This creates a popup menu that doesn't exist on the main menu-bar.
|
||||
|
||||
Note that a menu that starts with ']' will not be displayed.
|
||||
|
||||
==============================================================================
|
||||
6. Extras *gui-extras*
|
||||
|
||||
This section describes other features which are related to the GUI.
|
||||
|
||||
- With the GUI, there is no wait for one second after hitting escape, because
|
||||
the key codes don't start with <Esc>.
|
||||
|
||||
- Typing ^V followed by a special key in the GUI will insert "<Key>", since
|
||||
the internal string used is meaningless. Modifiers may also be held down to
|
||||
get "<Modifiers-Key>".
|
||||
|
||||
- In the GUI, the modifiers SHIFT, CTRL, and ALT (or META) may be used within
|
||||
mappings of special keys and mouse events. eg: :map <M-LeftDrag> <LeftDrag>
|
||||
|
||||
- In the GUI, several normal keys may have modifiers in mappings etc, these
|
||||
are <Space>, <Tab>, <NL>, <CR>, <Esc>.
|
||||
|
||||
==============================================================================
|
||||
7. Shell Commands *gui-shell*
|
||||
|
||||
For the X11 GUI the external commands are executed inside the gvim window.
|
||||
See |gui-pty|.
|
||||
|
||||
WARNING: Executing an external command from the X11 GUI will not always
|
||||
work. "normal" commands like "ls", "grep" and "make" mostly work fine.
|
||||
Commands that require an intelligent terminal like "less" and "ispell" won't
|
||||
work. Some may even hang and need to be killed from another terminal. So be
|
||||
careful!
|
||||
|
||||
For the Win32 GUI the external commands are executed in a separate window.
|
||||
See |gui-shell-win32|.
|
||||
-->
|
||||
|
||||
@@ -1,188 +0,0 @@
|
||||
*gui_w16.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Vim's Graphical User Interface *gui-w16* *win16-gui*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Starting the GUI |win16-start|
|
||||
2. Vim as default editor |win16-default-editor|
|
||||
3. Using the clipboard |win16-clipboard|
|
||||
4. Shell Commands |win16-shell|
|
||||
5. Special colors |win16-colors|
|
||||
6. Windows dialogs & browsers |win16-dialogs|
|
||||
7. Various |win16-various|
|
||||
|
||||
Other relevant documentation:
|
||||
|gui.txt| For generic items of the GUI.
|
||||
|os_msdos.txt| For items common to DOS and Windows.
|
||||
|gui_w32.txt| Some items here are also applicable to the Win16 version.
|
||||
|
||||
{Vi does not have a Windows GUI}
|
||||
|
||||
The Win16 version of Vim will run on Windows 3.1 or later. It has not been
|
||||
tested on 3.0, it probably won't work without being recompiled and
|
||||
modified. (but you really should upgrade to 3.11 anyway. :)
|
||||
|
||||
In most respects it behaves identically to the Win32 GUI version, including
|
||||
having a flat-style toolbar(!). The chief differences:
|
||||
|
||||
1) Bold/Italic text is not available, to speed up repaint/reduce resource
|
||||
usage. (You can re-instate this by undefining MSWIN16_FASTTEXT.)
|
||||
2) No tearoff menu emulation.
|
||||
3) No OLE interface.
|
||||
4) No long filename support (of course)
|
||||
5) No tooltips on toolbar buttons - instead they produce command-line tips
|
||||
like menu items do.
|
||||
6) Line length limited to 32767 characters (like 16-bit DOS version)
|
||||
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *win16-start*
|
||||
|
||||
The Win16 GUI version of Vim will always start the GUI, no matter how you
|
||||
start it or what it's called. There is no 'console' version as such, but you
|
||||
can use one of the DOS versions in a DOS box.
|
||||
|
||||
The Win16 GUI has an extra menu item: "Window/Select Font". It brings up the
|
||||
standard Windows font selector. Note that bold and italic fonts are not
|
||||
supported in an attempt to maximize GDI drawing speed.
|
||||
|
||||
Setting the menu height doesn't work for the Win16 GUI.
|
||||
|
||||
*win16-maximized*
|
||||
If you want Vim to start with a maximized window, add this command to your
|
||||
vimrc or gvimrc file: >
|
||||
au GUIEnter * simalt ~x
|
||||
<
|
||||
|
||||
There is a specific version of gvim.exe that runs under the Win32s subsystem
|
||||
of Windows 3.1 or 3.11. See |win32s|.
|
||||
|
||||
==============================================================================
|
||||
2. Vim as default editor *win16-default-editor*
|
||||
|
||||
To set Vim as the default editor for a file type you can use File Manager's
|
||||
"Associate" feature.
|
||||
|
||||
When you open a file in Vim by double clicking it, Vim changes to that
|
||||
file's directory.
|
||||
|
||||
See also |notepad|.
|
||||
|
||||
==============================================================================
|
||||
3. Using the clipboard *win16-clipboard*
|
||||
|
||||
Windows has a clipboard, where you can copy text to, and paste text from. Vim
|
||||
supports this in several ways.
|
||||
The clipboard works in the same way as the Win32 version: see |gui-clipboard|.
|
||||
|
||||
==============================================================================
|
||||
4. Shell Commands *win16-shell*
|
||||
|
||||
Vim spawns a DOS window for external commands, to make it possible to run any
|
||||
DOS command. The window uses the _default.pif settings.
|
||||
|
||||
*win16-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
sense for most shell commands which produce output for Vim to use). If you
|
||||
want Vim to start a program and return immediately, you can use the following
|
||||
syntax:
|
||||
:!start {command}
|
||||
This may only work for a Windows program though.
|
||||
Don't forget that you must tell Windows 3.1x to keep executing a DOS command
|
||||
in the background while you switch back to Vim.
|
||||
|
||||
==============================================================================
|
||||
5. Special colors *win16-colors*
|
||||
|
||||
On Win16, the normal DOS colors can be used. See |dos-colors|.
|
||||
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored.
|
||||
|
||||
Sys_BTNFace Sys_BTNShadow Sys_ActiveBorder
|
||||
Sys_ActiveCaption Sys_AppWorkspace Sys_Background
|
||||
Sys_BTNText Sys_CaptionText Sys_GrayText
|
||||
Sys_Highlight Sys_HighlightText Sys_InactiveBorder
|
||||
Sys_InactiveCaption Sys_InactiveCaptionText Sys_Menu
|
||||
Sys_MenuText Sys_ScrollBar Sys_Window
|
||||
Sys_WindowFrame Sys_WindowText
|
||||
|
||||
Probably the most useful values are
|
||||
Sys_Window Normal window background
|
||||
Sys_WindowText Normal window text
|
||||
Sys_Highlight Highlighted background
|
||||
Sys_HighlightText Highlighted text
|
||||
|
||||
These extra colors are also available:
|
||||
Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
|
||||
|
||||
|
||||
See also |rgb.txt|.
|
||||
|
||||
==============================================================================
|
||||
*win16-dialogs*
|
||||
6. Windows dialogs & browsers
|
||||
|
||||
The Win16 GUI can use familiar Windows components for some operations, as well
|
||||
as the traditional interface shared with the console version.
|
||||
|
||||
|
||||
6.1 Dialogs
|
||||
|
||||
The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|
||||
|:confirm| command and |confirm()| function are GUI-based rather than the
|
||||
console-based ones used by other versions. There is no option to change this.
|
||||
|
||||
|
||||
6.2 File Browsers
|
||||
|
||||
When prepending ":browse" before file editing commands, a file requester is
|
||||
used to allow you to select an existing file. See |:browse|.
|
||||
|
||||
|
||||
==============================================================================
|
||||
7. Various *win16-various*
|
||||
|
||||
*win16-printing*
|
||||
The "File/Print" menu uses Notepad to print the current buffer. This is a bit
|
||||
clumsy, but it's portable. If you want something else, you can define your
|
||||
own print command. For example, you could look for the 16-bit version of
|
||||
PrintFile. See $VIMRUNTIME/menu.vim for how it works by default.
|
||||
|
||||
Using this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
Also see |:simalt|
|
||||
|
||||
*win16-drag-n-drop*
|
||||
You can drag and drop one or more files into the vim window, where they will
|
||||
be opened as normal. If you hold down Shift while doing this, Vim changes to
|
||||
the (first) dropped file's directory. If you hold Ctrl, Vim will always split
|
||||
a new window for the file. Otherwise it's only done if the current buffer has
|
||||
been changed.
|
||||
You can also drop a directory's icon, but rather than open all files in the
|
||||
directory (which wouldn't usually be what you want) Vim instead changes to
|
||||
that directory and begins a new file.
|
||||
If Vim happens to be editing a command line, the names of the dropped files
|
||||
and directories will be inserted at the cursor. This allows you to use these
|
||||
names with any Ex command.
|
||||
|
||||
*win16-truetype*
|
||||
It is recommended that you use a raster font and not a TrueType
|
||||
fixed-pitch font. e.g. Use Courier, not Courier New. This is not just
|
||||
to use less resources but because there are subtle bugs in the
|
||||
handling of fixed-pitch TrueType in Win3.1x. In particular, when you move
|
||||
a block cursor over a pipe character '|', the cursor is drawn in the wrong
|
||||
size and bits get left behind. This is a bug in the Win3.1x GDI, it doesn't
|
||||
happen if you run the exe under 95/NT.
|
||||
-->
|
||||
|
||||
@@ -1,445 +0,0 @@
|
||||
*gui_w32.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Vim's Win32 Graphical User Interface *gui-w32* *win32-gui*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Starting the GUI |gui-w32-start|
|
||||
2. Vim as default editor |vim-default-editor|
|
||||
3. Using the clipboard |gui-clipboard|
|
||||
4. Shell Commands |gui-shell-win32|
|
||||
5. Special colors |win32-colors|
|
||||
6. Windows dialogs & browsers |gui-w32-dialogs|
|
||||
7. Command line arguments |gui-w32-cmdargs|
|
||||
8. Various |gui-w32-various|
|
||||
|
||||
Other relevant documentation:
|
||||
|gui.txt| For generic items of the GUI.
|
||||
|os_win32.txt| For Win32 specific items.
|
||||
|
||||
{Vi does not have a Windows GUI}
|
||||
|
||||
==============================================================================
|
||||
1. Starting the GUI *gui-w32-start*
|
||||
|
||||
The Win32 GUI version of Vim will always start the GUI, no matter how you
|
||||
start it or what it's called.
|
||||
|
||||
The GUI will always run in the Windows subsystem. Mostly shells automatically
|
||||
return with a command prompt after starting gvim. If not, you should use the
|
||||
"start" command: >
|
||||
start gvim [options] file ..
|
||||
|
||||
Note: All fonts (bold, italic) must be of the same size!!! If you don't do
|
||||
this, text will disappear or mess up the display. Vim does not check the font
|
||||
sizes. It's the size in screen pixels that must be the same. Note that some
|
||||
fonts that have the same point size don't have the same pixel size!
|
||||
Additionally, the positioning of the fonts must be the same (ascent and
|
||||
descent).
|
||||
|
||||
The Win32 GUI has an extra menu item: "Edit/Select Font". It brings up the
|
||||
standard Windows font selector.
|
||||
|
||||
Setting the menu height doesn't work for the Win32 GUI.
|
||||
|
||||
*gui-win32-maximized*
|
||||
If you want Vim to start with a maximized window, add this command to your
|
||||
vimrc or gvimrc file: >
|
||||
au GUIEnter * simalt ~x
|
||||
<
|
||||
*gui-w32s*
|
||||
There is a specific version of gvim.exe that runs under the Win32s subsystem
|
||||
of Windows 3.1 or 3.11. See |win32s|.
|
||||
|
||||
==============================================================================
|
||||
2. Vim as default editor *vim-default-editor*
|
||||
|
||||
To set Vim as the default editor for a file type:
|
||||
1. Start a Windows Explorer
|
||||
2. Chose View/Options -> File Types
|
||||
3. Select the path to gvim for every file type that you want to use it for.
|
||||
(you can also use three spaces in the file type field, for files without an
|
||||
extension).
|
||||
In the "open" action, use: >
|
||||
gvim "%1"
|
||||
< The quotes are required for using file names with embedded spaces.
|
||||
You can also use this: >
|
||||
gvim "%L"
|
||||
< This should avoid short (8.3 character) file names in some situations. But
|
||||
I'm not sure if this works everywhere.
|
||||
|
||||
When you open a file in Vim by double clicking it, Vim changes to that
|
||||
file's directory.
|
||||
|
||||
If you want Vim to start full-screen, use this for the Open action: >
|
||||
gvim -c "simalt ~x" "%1"
|
||||
|
||||
Another method, which also works When you put Vim in another directory (e.g.,
|
||||
when you have got a new version):
|
||||
1. select a file you want to use Vim with
|
||||
2. <Shift-F10>
|
||||
3. select "Open With..." menu entry
|
||||
4. click "Other..."
|
||||
5. browse to the (new) location of Vim and click "Open"
|
||||
6. make "Always Use this program..." checked
|
||||
7. <OK>
|
||||
|
||||
*send-to-menu* *sendto*
|
||||
You can also install Vim in the "Send To" menu:
|
||||
1. Start a Windows Explorer
|
||||
2. Navigate to your sendto directory:
|
||||
Windows 95: %windir%\sendto (e.g. "c:\windows\sendto")
|
||||
Windows NT: %windir%\profiles\%user%\sendto (e.g.
|
||||
"c:\winnt\profiles\mattha\sendto").
|
||||
3. Right-click in the file pane and select New->Shortcut
|
||||
4. Follow the shortcut wizard, using the full path to VIM/GVIM.
|
||||
|
||||
When you 'send a file to Vim', Vim changes to that file's directory. Note,
|
||||
however, that any long directory names will appear in their short (MS-DOS)
|
||||
form. This is a limitation of the Windows "Send To" mechanism.
|
||||
|
||||
*notepad*
|
||||
You could replace notepad.exe with gvim.exe, but that has a few side effects.
|
||||
Some programs rely on notepad arguments, which are not recognized by Vim. For
|
||||
example "notepad -p" is used by some applications to print a file. It's
|
||||
better to leave notepad where it is and use another way to start Vim.
|
||||
|
||||
*win32-popup-menu*
|
||||
A more drastic approach is to install an "Edit with Vim" entry in the popup
|
||||
menu for the right mouse button. With this you can edit any file with Vim.
|
||||
|
||||
This can co-exist with the file associations mentioned above. The difference
|
||||
is that the file associations will make starting Vim the default action. With
|
||||
the "Edit with Vim" menu entry you can keep the existing file association for
|
||||
double clicking on the file, and edit the file with Vim when you want. For
|
||||
example, you can associate "*.mak" with your make program. You can execute
|
||||
the makefile by double clicking it and use the "Edit with Vim" entry to edit
|
||||
the makefile.
|
||||
|
||||
You can select any files and right-click to see a menu option called "Edit
|
||||
with gvim". Chosing this menu option will invoke gvim with the file you have
|
||||
selected. If you select multiple files, you will find two gvim-related menu
|
||||
options:
|
||||
"Edit with multiple gvims" -- one gvim for each file in the selection
|
||||
"Edit with single gvim" -- one gvim for all the files in the selection
|
||||
And if there already is a gvim running:
|
||||
"Edit with existing gvim" -- edit the file with the running gvim
|
||||
|
||||
*install-registry*
|
||||
You can add the "Edit with Vim" menu entry in an easy way by using the
|
||||
"install.exe" program. It will add several registry entries for you.
|
||||
|
||||
You can also do this by hand. This is complicated! Use the install.exe if
|
||||
you can.
|
||||
|
||||
1. Start the registry editor with "regedit".
|
||||
2. Add these keys:
|
||||
key value name value ~
|
||||
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
{default} Vim Shell Extension
|
||||
HKEY_CLASSES_ROOT\CLSID\{51EEE242-AD87-11d3-9C1E-0090278BBD99}\InProcServer32
|
||||
{default} {path}\gvimext.dll
|
||||
ThreadingModel Apartment
|
||||
HKEY_CLASSES_ROOT\*\shellex\ContextMenuHandlers\gvim
|
||||
{default} {51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Shell Extensions\Approved
|
||||
{51EEE242-AD87-11d3-9C1E-0090278BBD99}
|
||||
Vim Shell Extension
|
||||
HKEY_LOCAL_MACHINE\Software\Vim\Gvim
|
||||
path {path}\gvim.exe
|
||||
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\vim 5.6
|
||||
DisplayName Vim 5.6: Edit with Vim popup menu entry
|
||||
UninstallString {path}\uninstal.exe
|
||||
|
||||
Replace {path} with the path that leads to the executable.
|
||||
Don't type {default}, this is the value for the key itself.
|
||||
|
||||
To remove "Edit with Vim" from the popup menu, just remove the registry
|
||||
entries mentioned above. The "uninstal.exe" program can do this for you. You
|
||||
can also use the entry in the Windows standard "Add/Remove Programs" list.
|
||||
|
||||
If you notice that this entry overrules other file type associations, set
|
||||
those associations again by hand (using Windows Explorer, see above). This
|
||||
only seems to happen on some Windows NT versions (Windows bug?). Procedure:
|
||||
1. Find the name of the file type. This can be done by starting the registry
|
||||
editor, and searching for the extension in \\HKEY_CLASSES_ROOT
|
||||
2. In a Windows Explorer, use View/Options/File Types. Search for the file
|
||||
type in the list and click "Edit". In the actions list, you can select on
|
||||
to be used as the default (normally the "open" action) and click on the
|
||||
"Set Default" button.
|
||||
|
||||
==============================================================================
|
||||
3. Using the clipboard *gui-clipboard*
|
||||
|
||||
Windows has a clipboard, where you can copy text to, and paste text from. Vim
|
||||
supports this in several ways. For other systems see |gui-selections|.
|
||||
|
||||
The "* register reflects the contents of the clipboard. |quotestar|
|
||||
|
||||
When the "unnamed" string is included in the 'clipboard' option, the unnamed
|
||||
register is the same. Thus you can yank to and paste from the clipboard
|
||||
without prepending "* to commands.
|
||||
|
||||
The 'a' flag in 'guioptions' is not included by default. This means that text
|
||||
is only put on the clipboard when an operation is performed on it. Just
|
||||
Visually selecting text doesn't put it on the clipboard. When the 'a' flag is
|
||||
included, the text is copied to the clipboard even when it is not operated
|
||||
upon.
|
||||
|
||||
To use the standard MS-Windows way of CTRL-X, CTRL-C and CTRL-V, use the
|
||||
$VIMRUNTIME/mswin.vim script. You could add this line to your _vimrc file: >
|
||||
source $VIMRUNTIME/mswin.vim
|
||||
|
||||
Since CTRL-C is used to copy the text to the clipboard, it can't be used to
|
||||
cancel an operation. Use CTRL-Break for that.
|
||||
|
||||
*CTRL-V-alternative*
|
||||
Since CTRL-V is used to paste, you can't use it to start a blockwise Visual
|
||||
selection. You can use CTRL-Q instead. You can also use CTRL-Q in Insert
|
||||
mode and Command-line mode to get the old meaning of CTRL-V. But CTRL-Q
|
||||
doesn't work for terminals when it's used for control flow.
|
||||
|
||||
NOTE: The clipboard support still has a number of bugs. See |todo|.
|
||||
|
||||
==============================================================================
|
||||
4. Shell Commands *gui-shell-win32*
|
||||
|
||||
Vim uses another window for external commands, to make it possible to run any
|
||||
command. The external command gets its own environment for running, just like
|
||||
it was started from a DOS prompt.
|
||||
|
||||
*win32-vimrun*
|
||||
Executing an external command is done indirectly by the "vimrun" command. The
|
||||
"vimrun.exe" must be in the path for this to work. Or it must be in the same
|
||||
directory as the Vim executable. If "vimrun" cannot be found, the command is
|
||||
executed directly, but then the DOS window closes immediately after the
|
||||
external command has finished.
|
||||
WARNING: If you close this window with the "X" button, and confirm the
|
||||
question if you really want to kill the application, Vim may be killed too!
|
||||
(This does not apply to commands run asynchronously with ":!start".)
|
||||
|
||||
In Windows 95, the window in which the commands are executed is always 25x80
|
||||
characters, to be as DOS compatible as possible (this matters!). The default
|
||||
system font is used. On NT, the window will be the default you have set up for
|
||||
"Console" in Control Panel. On Win32s, the properties of the DOS box are
|
||||
determined by _default.pif in the windows directory.
|
||||
|
||||
*msdos-mode*
|
||||
If you get a dialog that says "This program is set to run in MS-DOS mode..."
|
||||
when you run an external program, you can solve this by changing the
|
||||
properties of the associated shortcut:
|
||||
- Use a Windows Explorer to find the command.com that is used. It can be
|
||||
c:\command.com, c:\dos\command.com, c:\windows\command.com, etc.
|
||||
- With the right mouse button, select properties of this command.com.
|
||||
- In the Program tab select "Advanced".
|
||||
- Unselect "MS-DOS mode".
|
||||
- Click "OK" twice.
|
||||
|
||||
*win32-!start*
|
||||
Normally, Vim waits for a command to complete before continuing (this makes
|
||||
sense for most shell commands which produce output for Vim to use). If you
|
||||
want Vim to start a program and return immediately, you can use the following
|
||||
syntax on W95 & NT: >
|
||||
:!start {command}
|
||||
On Win32s, you will have to go to another window instead. Don't forget that
|
||||
you must tell Windows 3.1x to keep executing a DOS command in the background
|
||||
while you switch back to Vim.
|
||||
|
||||
==============================================================================
|
||||
5. Special colors *win32-colors*
|
||||
|
||||
On Win32, the normal DOS colors can be used. See |dos-colors|.
|
||||
|
||||
Additionally the system configured colors can also be used. These are known
|
||||
by the names Sys_XXX, where XXX is the appropriate system color name, from the
|
||||
following list (see the Win32 documentation for full descriptions). Case is
|
||||
ignored. note: On Win32s not all of these colors are supported.
|
||||
|
||||
Sys_3DDKShadow Sys_3DFace Sys_BTNFace
|
||||
Sys_3DHilight Sys_3DHighlight Sys_BTNHilight
|
||||
Sys_BTNHighlight Sys_3DLight Sys_3DShadow
|
||||
Sys_BTNShadow Sys_ActiveBorder Sys_ActiveCaption
|
||||
Sys_AppWorkspace Sys_Background Sys_Desktop
|
||||
Sys_BTNText Sys_CaptionText Sys_GrayText
|
||||
Sys_Highlight Sys_HighlightText Sys_InactiveBorder
|
||||
Sys_InactiveCaption Sys_InactiveCaptionText Sys_InfoBK
|
||||
Sys_InfoText Sys_Menu Sys_MenuText
|
||||
Sys_ScrollBar Sys_Window Sys_WindowFrame
|
||||
Sys_WindowText
|
||||
|
||||
Probably the most useful values are
|
||||
Sys_Window Normal window background
|
||||
Sys_WindowText Normal window text
|
||||
Sys_Highlight Highlighted background
|
||||
Sys_HighlightText Highlighted text
|
||||
|
||||
These extra colors are also available:
|
||||
Gray, Grey, LightYellow, SeaGreen, Orange, Purple, SlateBlue, Violet,
|
||||
|
||||
*rgb.txt*
|
||||
Additionally, colors defined by a "rgb.txt" file can be used. This file is
|
||||
well known from X11. A few lines from it: >
|
||||
|
||||
255 218 185 peach puff
|
||||
205 133 63 peru
|
||||
255 181 197 pink
|
||||
|
||||
This shows the layout of the file: First the R, G and B value as a decimal
|
||||
number, followed by the name of the color. The four fields are separated by
|
||||
spaces.
|
||||
|
||||
You can get an rgb.txt file from any X11 distribution. It is located in a
|
||||
directory like "/usr/X11R6/lib/X11/". For Vim it must be located in the
|
||||
$VIMRUNTIME directory. Thus the file can be found with "$VIMRUNTIME/rgb.txt".
|
||||
|
||||
==============================================================================
|
||||
*gui-w32-dialogs* *dialog*
|
||||
6. Windows dialogs & browsers
|
||||
|
||||
The Win32 GUI can use familiar Windows components for some operations, as well
|
||||
as the traditional interface shared with the console version.
|
||||
|
||||
|
||||
6.1 Dialogs
|
||||
|
||||
The dialogs displayed by the "confirm" family (i.e. the 'confirm' option,
|
||||
|:confirm| command and |confirm()| function are GUI-based rather than the
|
||||
console-based ones used by other versions. The 'c' flag in 'guioptions'
|
||||
changes this.
|
||||
|
||||
|
||||
6.2 File Browsers
|
||||
|
||||
When prepending ":browse" before file editing commands, a file requester is
|
||||
used to allow you to select an existing file. See |:browse|.
|
||||
|
||||
|
||||
6.3 Tearoff Menus
|
||||
|
||||
The Win32 GUI emulates Motif's tear-off menus. At the top of each menu you
|
||||
will see a small graphic "rip here" sign. Selecting it will cause a floating
|
||||
window to be created with the same menu entries on it. The floating menu can
|
||||
then be accessed just as if it was the original (including sub-menus), but
|
||||
without having to go to the menu bar each time.
|
||||
This is most useful if you find yourself using a command buried in a sub-menu
|
||||
over and over again.
|
||||
The tearoff menus can be positioned where you like, and always stay just above
|
||||
the Main Vim window. You can get rid of them by closing them as usual; they
|
||||
also of course close when you exit Vim.
|
||||
|
||||
*:tearoff* *:te*
|
||||
:te[aroff] {name} Tear-off the menu {name}. The menu named must have at
|
||||
least one subentry, but need not appear on the
|
||||
menu-bar (see |win32-hidden-menus|).
|
||||
|
||||
Example: >
|
||||
:tearoff File
|
||||
will make the "File" menu (if there is one) appear as a tearoff menu. >
|
||||
|
||||
:amenu ]Toolbar.Make :make<CR>
|
||||
:tearoff ]Toolbar
|
||||
This creates a floating menu that doesn't exist on the main menu-bar.
|
||||
|
||||
Note that a menu that starts with ']' will not be displayed.
|
||||
|
||||
==============================================================================
|
||||
7. Command line arguments *gui-w32-cmdargs*
|
||||
|
||||
Analysis of a command line into parameters is not standardised in MS Windows.
|
||||
Gvim has to provide logic to analyse a command line. This logic is likely to
|
||||
be different from the default logic provided by a compilation system used to
|
||||
build vim. The differences relate to unusual double quote (") usage.
|
||||
The arguments "C:\My Music\freude.txt" and "+/Sch\"iller" are handled in the
|
||||
same way. The argument "+/Sch""iller" may be handled different by gvim and
|
||||
vim, depending what it was compiled with.
|
||||
|
||||
The rules are:
|
||||
a) A parameter is a sequence of graphic characters.
|
||||
b) Parameters are separated by white space.
|
||||
c) A parameter can be enclosed in double quotes to include white space.
|
||||
d) A sequence of zero or more backslashes (\) and a double quote (")
|
||||
is special. The effective number of backslashes is halved, rounded
|
||||
down. An even number of backslashes reverses the acceptability of
|
||||
spaces and tabs, an odd number of backslashes produces a literal
|
||||
double quote.
|
||||
|
||||
So:
|
||||
" is a special double quote
|
||||
\" is a literal double quote
|
||||
\\" is a literal backslash and a special double quote
|
||||
\\\" is a literal backslash and a literal double quote
|
||||
\\\\" is 2 literal backslashes and a special double quote
|
||||
\\\\\" is 2 literal backslashes and a literal double quote
|
||||
etc.
|
||||
|
||||
Example: >
|
||||
gvim "C:\My Music\freude" +"set ignorecase" +/"\"foo\\" +\"bar\\\"
|
||||
|
||||
opens "C:\My Music\freude" and executes the line mode commands: >
|
||||
set ignorecase; /"foo\ and /bar\"
|
||||
|
||||
==============================================================================
|
||||
8. Various *gui-w32-various*
|
||||
|
||||
*gui-w32-printing*
|
||||
The "File/Print" menu prints the text with syntax highlighting, see
|
||||
|:hardcopy|. If you just want to print the raw text and have a default
|
||||
printer installed this should also work: >
|
||||
:w >>prn
|
||||
|
||||
Vim supports a number of standard MS Windows features. Some of these are
|
||||
detailed elsewhere: see |'mouse'|, |win32-hidden-menus|.
|
||||
|
||||
*drag-n-drop-win32*
|
||||
You can drag and drop one or more files into the vim window, where they will
|
||||
be opened as normal. If you hold down Shift while doing this, Vim changes to
|
||||
the (first) dropped file's directory. If you hold Ctrl Vim will always split
|
||||
a new window for the file. Otherwise it's only done if the current buffer has
|
||||
been changed.
|
||||
You can also drop a directory's icon, but rather than open all files in the
|
||||
directory (which wouldn't usually be what you want) Vim instead changes to
|
||||
that directory and begins a new file.
|
||||
If Vim happens to be editing a command line, the names of the dropped files
|
||||
and directories will be inserted at the cursor. This allows you to use these
|
||||
names with any Ex command.
|
||||
|
||||
*:simalt* *:si*
|
||||
:sim[alt] {key} simulate pressing {key} while holding Alt pressed.
|
||||
{only for Win32 versions}
|
||||
|
||||
Normally, Vim takes control of all Alt-<Key> combinations, to increase the
|
||||
number of possible mappings. This clashes with the standard use of Alt as the
|
||||
key for accessing menus.
|
||||
The quick way of getting standard behavior is to set the 'winaltkeys' option
|
||||
to "yes". This however prevents you from mapping Alt keys at all.
|
||||
Another way is to set 'winaltkeys' to "menu". Menu shortcut keys are then
|
||||
handled by windows, other ALT keys can be mapped. This doesn't allow a
|
||||
dependency on the current state though.
|
||||
To get round this, the :simalt command allows Vim (when 'winaltkeys' is not
|
||||
"yes") to fake a Windows-style Alt keypress. You can use this to map Alt key
|
||||
combinations (or anything else for that matter) to produce standard Windows
|
||||
actions. Here are some examples: >
|
||||
|
||||
:map <M-f> :simalt f<CR>
|
||||
This makes Alt-F pop down the 'File' menu (with the stock Menu.vim) by
|
||||
simulating the keystrokes Alt, F. >
|
||||
:map <M-Space> :simalt ~<CR>
|
||||
This maps Alt-Space to pop down the system menu for the Vim window. Note that
|
||||
~ is used by simalt to represent the <Space> character. >
|
||||
:map <C-n> :simalt ~n<CR>
|
||||
Maps Control-N to produce the keys Alt-Space followed by N. This minimizes the
|
||||
Vim window via the system menu.
|
||||
|
||||
*intellimouse-wheel-problems*
|
||||
When using the Intellimouse mouse wheel causes Vim to stop accepting input, go
|
||||
to:
|
||||
ControlPanel - Mouse - Wheel - UniversalScrolling - Exceptions
|
||||
|
||||
And add gvim to the list of applications. This problem only appears to happen
|
||||
with the Intellimouse driver 2.2 and when "Universal Scrolling" is turned on.
|
||||
-->
|
||||
|
||||
@@ -1,575 +0,0 @@
|
||||
*gui_x11.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Vim's Graphical User Interface *gui-x11* *GUI-X11*
|
||||
*Athena* *Motif*
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Starting the X11 GUI |gui-x11-start|
|
||||
2. GUI Resources |gui-resources|
|
||||
3. Shell Commands |gui-pty|
|
||||
4. Various |gui-x11-various|
|
||||
5. GTK version |gui-gtk|
|
||||
6. GNOME version |gui-gnome|
|
||||
7. Compiling |gui-x11-compiling|
|
||||
8. X11 selection mechanism |x11-selection|
|
||||
|
||||
Other relevant documentation:
|
||||
|gui.txt| For generic items of the GUI.
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Starting the X11 GUI *gui-x11-start*
|
||||
|
||||
Then you can run the GUI version of Vim in either of these ways:
|
||||
gvim [options] [files...]
|
||||
vim -g [options] [files...]
|
||||
|
||||
So if you call the executable "gvim", or make "gvim" a link to the executable,
|
||||
then the GUI version will automatically be used. Additional characters may be
|
||||
added after "gvim", for example "gvim-5".
|
||||
|
||||
You may also start up the GUI from within the terminal version by using one of
|
||||
these commands:
|
||||
:gui [++opt] [+cmd] [-f|-b] [files...] *:gu* *:gui*
|
||||
:gvim [++opt] [+cmd] [-f|-b] [files...] *:gv* *:gvim*
|
||||
The "-f" option runs Vim in the foreground.
|
||||
The "-b" option runs Vim in the background (this is the default).
|
||||
Also see |++opt| and |+cmd|.
|
||||
|
||||
*gui-fork*
|
||||
When the GUI is started, it does a fork() and exits the current process.
|
||||
When gvim was started from a shell this makes the shell accept further
|
||||
commands. If you don't want this (e.g. when using gvim for a mail program
|
||||
that waits for gvim to exit), start gvim with "gvim -f", "vim -gf" or use
|
||||
":gui -f". Don't use "vim -fg", because "-fg" specifies the foreground
|
||||
color.
|
||||
|
||||
When using "gvim -f" and then ":gui", Vim will run in the foreground. The
|
||||
"-f" argument will be remembered. To force running Vim in the background use
|
||||
":gui -b".
|
||||
|
||||
"gvim --nofork" does the same as "gvim -f".
|
||||
|
||||
If you want the GUI to run in the foreground always, include the 'f'
|
||||
flag in 'guioptions'. |-f|.
|
||||
|
||||
==============================================================================
|
||||
2. GUI Resources *gui-resources* *.Xdefaults*
|
||||
|
||||
If using the Motif or Athena version of the GUI (not for the GTK+ or Win32
|
||||
version), a number of X resources are available. You should use Vim's class
|
||||
"Vim" when setting these. They are as follows:
|
||||
|
||||
Resource name Meaning ~
|
||||
|
||||
reverseVideo Boolean: should reverse video be used?
|
||||
background Color of background.
|
||||
foreground Color of normal text.
|
||||
scrollBackground Color of trough portion of scrollbars.
|
||||
scrollForeground Color of slider and arrow portions of scrollbars.
|
||||
menuBackground Color of menu backgrounds.
|
||||
menuForeground Color of menu foregrounds.
|
||||
tooltipForeground Color of tooltip and balloon foreground.
|
||||
tooltipBackground Color of tooltip and balloon background.
|
||||
|
||||
font Name of font used for normal text.
|
||||
boldFont Name of font used for bold text.
|
||||
italicFont Name of font used for italic text.
|
||||
boldItalicFont Name of font used for bold, italic text.
|
||||
menuFont Name of font used for the menus, used when compiled
|
||||
without the |+xfontset| feature
|
||||
menuFontSet Name of fontset used for the menus, used when compiled
|
||||
with the |+xfontset| feature
|
||||
tooltipFont Name of the font used for the tooltip and balloons.
|
||||
When compiled with the |+xfontset| feature this is a
|
||||
fontset name.
|
||||
|
||||
geometry Initial geometry to use for gvim's window (default
|
||||
is same size as terminal that started it).
|
||||
scrollbarWidth Thickness of scrollbars.
|
||||
borderWidth Thickness of border around text area.
|
||||
menuHeight Height of the menu bar (only for Athena).
|
||||
|
||||
A special font for italic, bold, and italic-bold text will only be used if
|
||||
the user has specified one via a resource. No attempt is made to guess what
|
||||
fonts should be used for these based on the normal text font at the moment.
|
||||
|
||||
Note that the colors can also be set with the ":highlight" command, using the
|
||||
"Normal", "Menu", "Tooltip", and "Scrollbar" groups. Example: >
|
||||
:highlight Menu guibg=lightblue
|
||||
:highlight Tooltip guibg=yellow
|
||||
:highlight Scrollbar guibg=lightblue guifg=blue
|
||||
:highlight Normal guibg=grey90
|
||||
<
|
||||
*font-sizes*
|
||||
Note: All fonts (except for the menu and tooltip) must be of the same size!!!
|
||||
If you don't do this, text will disappear or mess up the display. Vim does
|
||||
not check the font sizes. It's the size in screen pixels that must be the
|
||||
same. Note that some fonts that have the same point size don't have the same
|
||||
pixel size! Additionally, the positioning of the fonts must be the same
|
||||
(ascent and descent). You can check this with "xlsfonts -l {fontname}".
|
||||
|
||||
If any of these things are also set with Vim commands, eg with
|
||||
":set guifont=Screen15", then this will override the X resources (currently
|
||||
'guifont' is the only option that is supported).
|
||||
|
||||
Here is an example of what you might put in your ~/.Xdefaults file: >
|
||||
|
||||
Vim*useSchemes: all
|
||||
Vim*sgiMode: true
|
||||
Vim*useEnhancedFSB: true
|
||||
Vim.foreground: Black
|
||||
Vim.background: Wheat
|
||||
Vim*fontList: 7x13
|
||||
|
||||
The first three of these are standard resources on Silicon Graphics machines
|
||||
which make Motif applications look even better, highly recommended!
|
||||
|
||||
The "Vim*fontList" is to set the menu font for Motif. Example: >
|
||||
Vim*menuBar*fontList: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
With Athena: >
|
||||
Vim*menuBar*SmeBSB*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
Vim*menuBar*MenuButton*font: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
|
||||
NOTE: A more portable, and indeed more correct, way to specify the menu font
|
||||
in either Motif or Athena is through the resource: >
|
||||
Vim.menuFont: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
Or, when compiled with the |+xfontset| feature: >
|
||||
Vim.menuFontSet: -*-courier-medium-r-*-*-10-*-*-*-*-*-*-*
|
||||
|
||||
Don't use "Vim*geometry" in the defaults. This will break the menus. Use
|
||||
"Vim.geometry" instead.
|
||||
|
||||
If you get an error message "Cannot allocate colormap entry for "gray60",
|
||||
try adding this to your Vim resources (change the colors to your liking): >
|
||||
|
||||
Vim*scrollBackground: Black
|
||||
Vim*scrollForeground: Blue
|
||||
|
||||
The resources can also be set with arguments to vim:
|
||||
|
||||
argument meaning ~
|
||||
*-gui*
|
||||
-display {display} Run vim on {display} *-display*
|
||||
-iconic Start vim iconified *-iconic*
|
||||
-background {color} Use {color} for the background *-background*
|
||||
-bg {color} idem *-bg*
|
||||
-foreground {color} Use {color} for normal text *-foreground*
|
||||
-fg {color} idem *-fg*
|
||||
-ul {color} idem *-ul*
|
||||
-font {font} Use {font} for normal text *-font*
|
||||
-fn {font} idem *-fn*
|
||||
-boldfont {font} Use {font} for bold text *-boldfont*
|
||||
-italicfont {font} Use {font} for italic text *-italicfont*
|
||||
-menufont {font} Use {font} for menu items *-menufont*
|
||||
-menufontset {fontset} Use {fontset} for menu items *-menufontset*
|
||||
-mf {font} idem *-mf*
|
||||
-geometry {geom} Use {geom} for initial geometry *-geometry*
|
||||
-geom {geom} idem, see |-geometry-example| *-geom*
|
||||
-borderwidth {width} Use a border width of {width} *-borderwidth*
|
||||
-bw {width} idem *-bw*
|
||||
*-scrollbarwidth*
|
||||
-scrollbarwidth {width} Use a scrollbar width of {width}
|
||||
-sw {width} idem *-sw*
|
||||
-menuheight {height} Use a menu bar height of {height} *-menuheight*
|
||||
-mh {height} idem *-mh*
|
||||
NOTE: On Motif the value is ignored, the menu height
|
||||
is computed to fit the menus.
|
||||
-reverse Use reverse video *-reverse*
|
||||
-rv idem *-rv*
|
||||
+reverse Don't use reverse video *-+reverse*
|
||||
+rv idem *-+rv*
|
||||
-xrm {resource} Set the specified resource *-xrm*
|
||||
|
||||
Note about reverse video: Vim checks that the result is actually a light text
|
||||
on a dark background. The reason is that some X11 versions swap the colors,
|
||||
and some don't. These two examples will both give yellow text on a blue
|
||||
background:
|
||||
gvim -fg Yellow -bg Blue -reverse
|
||||
gvim -bg Yellow -fg Blue -reverse
|
||||
|
||||
*-geometry-example*
|
||||
An example for the geometry argument: >
|
||||
gvim -geometry 80x63+8+100
|
||||
This creates a window with 80 columns and 63 lines at position 8 pixels from
|
||||
the left and 100 pixels from the top of the screen.
|
||||
|
||||
==============================================================================
|
||||
3. Shell Commands *gui-pty*
|
||||
|
||||
WARNING: Executing an external command from the GUI will not always work.
|
||||
"normal" commands like "ls", "grep" and "make" mostly work fine. Commands
|
||||
that require an intelligent terminal like "less" and "ispell" won't work.
|
||||
Some may even hang and need to be killed from another terminal. So be
|
||||
careful!
|
||||
|
||||
There are two ways to do the I/O with a shell command: Pipes and a pseudo-tty.
|
||||
The default is to use a pseudo-tty. This should work best on most systems.
|
||||
|
||||
Unfortunately, the implementation of the pseudo-tty is different on every Unix
|
||||
system. And some systems require root permission. To avoid running into
|
||||
problems with a pseudo-tty when you least expect it, test it when not editing
|
||||
a file. Be prepared to "kill" the started command or Vim. Commands like
|
||||
":r !cat" may hang!
|
||||
|
||||
If using a pseudo-tty does not work for you, reset the 'guipty' option: >
|
||||
|
||||
:set noguipty
|
||||
|
||||
Using a pipe should work on any Unix system, but there are disadvantages:
|
||||
- Some shell commands will notice that a pipe is being used and behave
|
||||
differently. E.g., ":!ls" will list the files in one column.
|
||||
- The ":sh" command won't show a prompt, although it will sort of work.
|
||||
- When using ":make" it's not possible to interrupt with a CTRL-C.
|
||||
|
||||
Typeahead while the external command is running is often lost. This happens
|
||||
both with a pipe and a pseudo-tty. This is a known problem, but it seems it
|
||||
can't be fixed (or at least, it's very difficult).
|
||||
|
||||
*gui-pty-erase*
|
||||
When your erase character is wrong for an external command, you should fix
|
||||
this in your "~/.cshrc" file, or whatever file your shell uses for
|
||||
initializations. For example, when you want to use backspace to delete
|
||||
characters, but hitting backspaces produces "^H" instead, try adding this to
|
||||
your "~/.cshrc": >
|
||||
stty erase ^H
|
||||
The ^H is a real CTRL-H, type it as CTRL-V CTRL-H.
|
||||
|
||||
==============================================================================
|
||||
4. Various *gui-x11-various*
|
||||
|
||||
*gui-x11-printing*
|
||||
The "File/Print" menu simply sends the current buffer to "lpr". No options or
|
||||
whatever. If you want something else, you can define your own print command.
|
||||
For example: >
|
||||
|
||||
:10amenu File.Print :w !lpr -Php3
|
||||
:10vmenu File.Print :w !lpr -Php3
|
||||
<
|
||||
*X11-icon*
|
||||
Vim uses a black&white icon by default when compiled with Motif or Athena. A
|
||||
colored Vim icon is included as $VIMRUNTIME/vim32x32.xpm. For GTK+, this is
|
||||
the builtin icon used. Unfortunately, how you should install it depends on
|
||||
your window manager. When you use this, remove the 'i' flag from
|
||||
'guioptions', to remove the black&white icon: >
|
||||
:set guioptions-=i
|
||||
|
||||
If you use one of the fvwm* family of window managers simply add this line to
|
||||
your .fvwm2rc configuration file: >
|
||||
|
||||
Style "vim" Icon vim32x32.xpm
|
||||
|
||||
Make sure the icon file's location is consistent with the window manager's
|
||||
IconPath statement. Either modify the IconPath from within your .fvwm2rc or
|
||||
drop the icon into one the pre-defined directories:
|
||||
|
||||
IconPath /usr/X11R6/include/X11/pixmaps:/usr/X11R6/include/X11/bitmaps >
|
||||
|
||||
For CDE "dtwm" (a derivative of Motif) add this line in the .Xdefaults: >
|
||||
Dtwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm
|
||||
|
||||
For "mwm" (Motif window manager) the line would be: >
|
||||
Mwm*Vim*iconImage: /usr/local/share/vim/vim32x32.xpm
|
||||
|
||||
Mouse Pointers Available in X11 *X11_mouse_shapes*
|
||||
|
||||
By using the |'mouseshape'| option, the mouse pointer can be automatically
|
||||
changed whenever vim enters one of its various modes (e.g., Insert or
|
||||
Command). Currently, the available pointers are:
|
||||
|
||||
arrow an arrow pointing northwest
|
||||
beam a I-like vertical bar
|
||||
size an arrow pointing up and down
|
||||
busy a wristwatch
|
||||
blank an invisible pointer
|
||||
crosshair a thin "+" sign
|
||||
hand1 a dark hand pointing northeast
|
||||
hand2 a light hand pointing northwest
|
||||
pencil a pencil pointing southeast
|
||||
question question_arrow
|
||||
right_arrow an arrow pointing northeast
|
||||
up_arrow an arrow pointing upwards
|
||||
|
||||
Additionally, any of the mouse pointers that are built into X11 may be
|
||||
used by specifying an integer from the X11/cursorfont.h include file.
|
||||
|
||||
If a name is used that exists on other systems, but not in X11, the default
|
||||
"arrow" pointer is used.
|
||||
|
||||
==============================================================================
|
||||
5. GTK version *gui-gtk* *GTK+* *GTK*
|
||||
|
||||
The GTK version of the GUI works a little bit different.
|
||||
|
||||
GTK does _not_ use the traditional X resource settings. Thus items in your
|
||||
~/.Xdefaults or app-defaults files are not used.
|
||||
Many of the traditional X command line arguments are not supported. (e.g.,
|
||||
stuff like -bg, -fg, etc). The ones that are supported are:
|
||||
|
||||
command line argument resource name meaning ~
|
||||
-fn or -font .font font name for the text
|
||||
-geom or -geometry .geometry size of the gvim window
|
||||
-rv or -reverse *reverseVideo white text on black background
|
||||
-display display to be used
|
||||
-fg -foreground {color} foreground color
|
||||
-bg -background {color} background color
|
||||
|
||||
To set the font, see |'guifont'|. For GTK, there's also a menu option that
|
||||
does this.
|
||||
|
||||
Additionally, there are these command line arguments, which are handled by GTK
|
||||
internally. Look in the GTK documentation for how they are used:
|
||||
--sync
|
||||
--gdk-debug
|
||||
--gdk-no-debug
|
||||
--no-xshm (not in GTK+ 2)
|
||||
--xim-preedit (not in GTK+ 2)
|
||||
--xim-status (not in GTK+ 2)
|
||||
--gtk-debug
|
||||
--gtk-no-debug
|
||||
--g-fatal-warnings
|
||||
--gtk-module
|
||||
--display (GTK+ counterpart of -display; works the same way.)
|
||||
--screen (The screen number; for GTK+ 2.2 multihead support.)
|
||||
|
||||
These arguments are ignored when the |+netbeans_intg| feature is used:
|
||||
-xrm
|
||||
-mf
|
||||
|
||||
As for colors, vim's color settings (for syntax highlighting) is still
|
||||
done the traditional vim way. See |:highlight| for more help.
|
||||
|
||||
If you want to set the colors of remaining gui components (e.g., the
|
||||
menubar, scrollbar, whatever), those are GTK specific settings and you
|
||||
need to set those up in some sort of gtkrc file. you'll have to refer
|
||||
to the GTK documentation, however little there is, on how to do this.
|
||||
See http://developer.gnome.org/doc/API/2.0/gtk/gtk-Resource-Files.html
|
||||
for more information.
|
||||
|
||||
*gtk-tooltip-colors*
|
||||
Example, which sets the tooltip colors to black on light-yellow: >
|
||||
|
||||
style "tooltips"
|
||||
{
|
||||
bg[NORMAL] = "#ffffcc"
|
||||
fg[NORMAL] = "#000000"
|
||||
}
|
||||
|
||||
widget "gtk-tooltips*" style "tooltips"
|
||||
|
||||
Write this in the file ~/.gtkrc and it will be used by GTK+. For GTK+ 2
|
||||
you might have to use the file ~/.gtkrc-2.0 instead, depending on your
|
||||
distribution.
|
||||
|
||||
Using Vim as a GTK+ plugin *gui-gtk-socketid*
|
||||
|
||||
When the GTK+ version of Vim starts up normally, it creates its own top level
|
||||
window (technically, a 'GtkWindow'). GTK+ provides an embedding facility with
|
||||
its GtkSocket and GtkPlug widgets. If one GTK+ application creates a
|
||||
GtkSocket widget in one of its windows, an entirely different GTK+ application
|
||||
may embed itself into the first application by creating a top-level GtkPlug
|
||||
widget using the socket's ID.
|
||||
|
||||
If you pass Vim the command-line option '--socketid' with a decimal or
|
||||
hexadecimal value, Vim will create a GtkPlug widget using that value instead
|
||||
of the normal GtkWindow. This enables Vim to act as a GTK+ plugin.
|
||||
|
||||
This really is a programmer's interface, and is of no use without a supporting
|
||||
application to spawn the Vim correctly. For more details on GTK+ sockets, see
|
||||
http://www.gtk.org/api/
|
||||
|
||||
Note that this feature requires the latest GTK version. GTK 1.2.10 still has
|
||||
a small problem. The socket feature has not yet been tested with GTK+ 2 --
|
||||
feel free to volunteer.
|
||||
|
||||
==============================================================================
|
||||
6. GNOME version *gui-gnome* *Gnome* *GNOME*
|
||||
|
||||
The GNOME GUI works just like the GTK+ version. See |GTK+| above for how it
|
||||
works. It looks a bit different though, and implements one important feature
|
||||
that's not available in the plain GTK+ GUI: Interaction with the session
|
||||
manager. |gui-gnome-session|
|
||||
|
||||
These are the different looks:
|
||||
- Uses GNOME dialogs (GNOME 1 only). The GNOME 2 GUI uses the same nice
|
||||
dialogs as the GTK+ 2 version.
|
||||
- Uses the GNOME dock, so that the toolbar and menubar can be moved to
|
||||
different locations other than the top (e.g., the toolbar can be placed on
|
||||
the left, right, top, or bottom). The placement of the menubar and
|
||||
toolbar is only saved in the GNOME 2 version.
|
||||
- That means the menubar and toolbar handles are back! Yeah! And the
|
||||
resizing grid still works too.
|
||||
|
||||
GNOME is automatically compiled with if it was found by configure.
|
||||
(FIXME: Is this still true? Use --enable-gnome-check to force it to.)
|
||||
|
||||
GNOME session support *gui-gnome-session* *gnome-session*
|
||||
|
||||
On logout, Vim shows the well-known exit confirmation dialog if any buffers
|
||||
are modified. Clicking [Cancel] will stop the logout process. Otherwise the
|
||||
current session is stored to disk by using the |:mksession| command, and
|
||||
restored the next time you log in.
|
||||
|
||||
The GNOME session support should also work with the KDE session manager.
|
||||
If you are experiencing any problems please report them as bugs.
|
||||
|
||||
Note: The automatic session save works entirely transparent, in order to
|
||||
avoid conflicts with your own session files, scripts and autocommands. That
|
||||
means in detail:
|
||||
- The session file is stored to a separate directory (usually $HOME/.gnome2).
|
||||
- 'sessionoptions' is ignored, and a hardcoded set of appropriate flags is
|
||||
used instead: >
|
||||
blank,curdir,folds,globals,help,options,winsize
|
||||
- The internal variable |v:this_session| is not changed when storing the
|
||||
session. Also, it is restored to its old value when logging in again.
|
||||
|
||||
The position and size of the GUI window is not saved by Vim since doing so
|
||||
is the window manager's job. But if compiled with GTK+ 2 support, Vim helps
|
||||
the WM to identify the window by restoring the window role (using the |--role|
|
||||
command line argument).
|
||||
|
||||
==============================================================================
|
||||
7. Compiling *gui-x11-compiling*
|
||||
|
||||
If using X11, Vim's Makefile will by default first try to find the necessary
|
||||
GTK+ files on your system. If the GTK+ files cannot be found, then the Motif
|
||||
files will be searched for. Finally, if this fails, the Athena files will be
|
||||
searched for. If all three fail, the GUI will be disabled.
|
||||
|
||||
For GTK+, Vim's configuration process requires that GTK+ be properly
|
||||
installed. That is, the shell script 'gtk-config' must be in your PATH, and
|
||||
you can already successful compile, build, and execute a GTK+ program. The
|
||||
reason for this is because the compiler flags (CFLAGS) and link flags
|
||||
(LDFLAGS) are obtained through the 'gtk-config' shell script.
|
||||
|
||||
If you want to build with GTK+ 2 support pass the --enable-gtk2-check argument
|
||||
to ./configure. Optionally, support for GNOME 2 will be compiled if the
|
||||
--enable-gnome-check option is also given. Note that the support for GTK+ 2
|
||||
is still experimental. However, many people have reported that it works just
|
||||
fine for them.
|
||||
|
||||
Otherwise, if you are using Motif or Athena, when you have the Motif or Athena
|
||||
files in a directory where configure doesn't look, edit the Makefile to enter
|
||||
the names of the directories. Search for "GUI_INC_LOC" for an example to set
|
||||
the Motif directories, "CONF_OPT_X" for Athena.
|
||||
|
||||
*gui-x11-gtk*
|
||||
At the time of this writing, you may use either GTK+ version 1.0.6 or 1.2. It
|
||||
is suggested that you use v1.2 since not all of Vim's GUI features are present
|
||||
if using v1.0.6. For instance, there are no tearoff menus present in v1.0.6.
|
||||
Using a version from GTK+'s CVS tree may or may not work, and is therefore not
|
||||
supported and not recommended.
|
||||
|
||||
For the experimental GTK+ 2 GUI, using the latest release of the GTK+ 2.0 or
|
||||
GTK+ 2.2 series is recommended. CVS HEAD seems to work fine most of time as
|
||||
well.
|
||||
|
||||
Lastly, although GTK+ has supposedly been ported to the Win32 platform, this
|
||||
has not been tested with Vim and is also unsupported. Also, it's unlikely to
|
||||
even compile since GTK+ GUI uses parts of the generic X11 code. This might
|
||||
change in distant future; particularly because getting rid of the X11 centric
|
||||
code parts is also required for GTK+ framebuffer support.
|
||||
|
||||
*gui-x11-motif*
|
||||
For Motif, you need at least Motif version 1.2 and/or X11R5. Motif 2.0 and
|
||||
X11R6 are OK. Motif 1.1 and X11R4 might work, no guarantee (there may be a
|
||||
few problems, but you might make it compile and run with a bit of work, please
|
||||
send me the patches if you do). The newest releases of LessTif have been
|
||||
reported to work fine too.
|
||||
|
||||
*gui-x11-athena*
|
||||
The Athena version uses the Xaw widget set by default. If you have the 3D
|
||||
version, you might want to link with Xaw3d instead. This will make the
|
||||
menus look a bit better. Edit the Makefile and look for "XAW_LIB". The
|
||||
scrollbars will remain the same, because Vim has its own, which are already
|
||||
3D (in fact, they look more like Motif).
|
||||
|
||||
*gui-x11-neXtaw*
|
||||
The neXtaw version is mostly like Athena, but uses different widgets.
|
||||
|
||||
*gui-x11-misc*
|
||||
In general, do not try to mix files from different GTK+, Motif, Athena and X11
|
||||
versions. This will cause problems. For example, using header files for
|
||||
X11R5 with a library for X11R6 probably doesn't work (although the linking
|
||||
won't give an error message, Vim will crash later).
|
||||
|
||||
==============================================================================
|
||||
8. X11 selection mechanism *x11-selection*
|
||||
|
||||
If using X11, in either the GUI or an xterm with an X11-aware Vim, then Vim
|
||||
provides varied access to the X11 selection and clipboard. These are accessed
|
||||
by using the two selection registers "* and "+.
|
||||
|
||||
X11 provides two basic types of global store, selections and cut-buffers,
|
||||
which differ in one important aspect: selections are "owned" by an
|
||||
application, and disappear when that application (e.g., Vim) exits, thus
|
||||
losing the data, whereas cut-buffers, are stored within the X-server itself
|
||||
and remain until written over or the X-server exits (e.g., upon logging out).
|
||||
|
||||
The contents of selections are held by the originating application (e.g., upon
|
||||
a copy), and only passed on to another application when that other application
|
||||
asks for them (e.g., upon a paste).
|
||||
|
||||
The contents of cut-buffers are immediately written to, and are then
|
||||
accessible directly from the X-server, without contacting the originating
|
||||
application.
|
||||
|
||||
*quoteplus* *quote+*
|
||||
There are three documented X selections: PRIMARY (which is expected to
|
||||
represent the current visual selection - as in Vim's Visual mode), SECONDARY
|
||||
(which is ill-defined) and CLIPBOARD (which is expected to be used for
|
||||
cut, copy and paste operations).
|
||||
|
||||
Of these three, Vim uses PRIMARY when reading and writing the "* register
|
||||
(hence when the X11 selections are available, Vim sets a default value for
|
||||
|'clipboard'| of "autoselect"), and CLIPBOARD when reading and writing the "+
|
||||
register. Vim does not access the SECONDARY selection.
|
||||
|
||||
Examples: (assuming the default option values)
|
||||
- Select an URL in Visual mode in Vim. Go to a text field in Netscape and
|
||||
click the middle mouse button. The selected text will be inserted
|
||||
(hopefully!).
|
||||
- Select some text in Netscape by dragging with the mouse. Go to Vim and
|
||||
press the middle mouse button: The selected text is inserted.
|
||||
- Select some text in Vim and do "+y. Go to Netscape, select some text in a
|
||||
textfield by dragging with the mouse. Now use the right mouse button and
|
||||
select "Paste" from the popup menu. The selected text is overwritten by the
|
||||
text from Vim.
|
||||
Note that the text in the "+ register remains available when making a Visual
|
||||
selection, which makes other text available in the "* register. That allows
|
||||
overwriting selected text.
|
||||
*x11-cut-buffer*
|
||||
There are, by default, 8 cut-buffers: CUT_BUFFER0 to CUT_BUFFER7. Vim only
|
||||
uses CUT_BUFFER0, which is the one that xterm uses by default.
|
||||
|
||||
Whenever Vim is about to become unavailable (either via exiting or becoming
|
||||
suspended), and thus unable to respond to another application's selection
|
||||
request, it writes the contents of any owned selection to CUT_BUFFER0. If the
|
||||
"+ CLIPBOARD selection is owned by Vim, then this is written in preference,
|
||||
otherwise if the "* PRIMARY selection is owned by Vim, then that is written.
|
||||
|
||||
Similarly, when Vim tries to paste from "* or "+ (either explicitly, or, in
|
||||
the case of the "* register, when the middle mouse button is clicked), if the
|
||||
requested X selection is empty or unavailable, Vim reverts to reading the
|
||||
current value of the CUT_BUFFER0.
|
||||
|
||||
Note that when text is copied to CUT_BUFFER0 in this way, the type of
|
||||
selection (character, line or block) is always lost, even if it is a Vim which
|
||||
later pastes it.
|
||||
|
||||
Xterm, by default, always writes visible selections to both PRIMARY and
|
||||
CUT_BUFFER0. When it pastes, it uses PRIMARY if this is available, or else
|
||||
falls back upon CUT_BUFFER0. For this reason, when cutting and pasting
|
||||
between Vim and an xterm, you should use the "* register. Xterm doesn't use
|
||||
CLIPBOARD, thus the "+ doesn't work with xterm.
|
||||
|
||||
Most newer applications will provide their current selection via PRIMARY ("*)
|
||||
and use CLIPBOARD ("+) for cut/copy/paste operations. You thus have access to
|
||||
both by choosing to use either of the "* or "+ registers.
|
||||
-->
|
||||
|
||||
@@ -1,105 +0,0 @@
|
||||
*hangulin.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
Hangul Support *hangul*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Introduction
|
||||
------------
|
||||
It is to input hangul, the Korean language, with VIM GUI version.
|
||||
If you have a XIM program, you can use another |+xim| feature.
|
||||
Basically, it is for whom has no XIM program.
|
||||
|
||||
Compile
|
||||
-------
|
||||
Next is a basic option. You can add any other configure option. >
|
||||
|
||||
./configure --with-x --enable-multibyte --enable-fontset --enable-hangulinput
|
||||
|
||||
And you should check the feature.h. If |+hangul_input| feature is enabled
|
||||
by configure, you can select more options such as keyboard type, 2 bulsik
|
||||
or 3 bulsik. You can find keywords like next in there. >
|
||||
|
||||
#define HANGUL_DEFAULT_KEYBOARD 2
|
||||
#define ESC_CHG_TO_ENG_MODE
|
||||
/* #define X_LOCALE */
|
||||
/* #define SLOW_XSERVER */
|
||||
|
||||
Environment variables
|
||||
---------------------
|
||||
You should set LANG variable to Korean locale such as ko or ko_KR.euc.
|
||||
If you set LC_ALL variable, it should be set to Korean locale also.
|
||||
|
||||
VIM resource
|
||||
------------
|
||||
You should add nexts to your global vimrc ($HOME/.vimrc). >
|
||||
|
||||
:set fileencoding=korea
|
||||
|
||||
Keyboard
|
||||
--------
|
||||
You can change keyboard type (2 bulsik or 3 bulsik) using VIM_KEYBOARD
|
||||
or HANGUL_KEYBOARD_TYPE environment variables. For sh, just do (2 bulsik): >
|
||||
|
||||
export VIM_KEYBOARD="2"
|
||||
or >
|
||||
export HANGUL_KEYBOARD_TYPE="2"
|
||||
|
||||
If both are set, VIM_KEYBOARD has higher priority.
|
||||
|
||||
Hangul Fonts
|
||||
------------
|
||||
You can set text font using $HOME/.Xdefaults or $HOME/.gvimrc.
|
||||
But to use Hangul, you should set 'guifontset' in your vimrc.
|
||||
|
||||
$HOME/.Xdefaults: >
|
||||
Vim.font: english_font
|
||||
|
||||
! Nexts are for hangul menu with Athena
|
||||
*international: True
|
||||
Vim*fontSet: english_font,hangul_font
|
||||
|
||||
! Nexts are for hangul menu with Motif
|
||||
*international: True
|
||||
Vim*fontList: english_font;hangul_font:
|
||||
|
||||
$HOME/.gvimrc: >
|
||||
set guifontset=english_font,hangul_font
|
||||
|
||||
attention! the , (comma) or ; (semicolon)
|
||||
|
||||
And there should be no ':set guifont'. If it exists, then Gvim ignores
|
||||
':set guifontset'. It means VIM runs without fontset supporting.
|
||||
So, you can see only English. Hangul does not be correctly displayed.
|
||||
|
||||
After 'fontset' feature is enabled, VIM does not allow using 'font'.
|
||||
For example, if you use >
|
||||
:set guifontset=eng_font,your_font
|
||||
in your .gvimrc, then you should do for syntax >
|
||||
:hi Comment guifg=Cyan font=another_eng_font,another_your_font
|
||||
If you just do >
|
||||
:hi Comment font=another_eng_font
|
||||
then you can see a GOOD error message. Be careful!
|
||||
|
||||
hangul_font width should be twice than english_font width.
|
||||
|
||||
Unsupported Feature
|
||||
-------------------
|
||||
Johab font not yet supported. And I don't have any plan.
|
||||
If you really want to use johab font, you can use the
|
||||
hanguldraw.c in gau package.
|
||||
|
||||
Hanja input not yet supported. And I don't have any plan.
|
||||
If you really want to input hanja, just use VIM with hanterm.
|
||||
|
||||
Bug or Comment
|
||||
--------------
|
||||
Send comments, patches and suggestions to:
|
||||
|
||||
Chi-Deok Hwang <hwang@mizi.co.kr>
|
||||
Nam SungHyun <namsh@lge.com>
|
||||
-->
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
*hebrew.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Hebrew Language support (options & mapping) for Vim *hebrew*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
The supporting 'rightleft' functionality was originally created by Avner
|
||||
Lottem:
|
||||
E-mail: alottem@iil.intel.com
|
||||
Phone: +972-4-8307322
|
||||
|
||||
Ron Aaron <ronaharon@yahoo.com> is currently helping support these features.
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
All this is only available when the |+rightleft| feature was enabled at
|
||||
compile time.
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
Hebrew-specific options are 'hkmap', 'hkmapp' 'keymap'=hebrew and 'aleph'.
|
||||
Hebrew-useful options are 'delcombine', 'allowrevins', 'revins', 'rightleft'
|
||||
and 'rightleftcmd'.
|
||||
|
||||
The 'rightleft' mode reverses the display order, so characters are displayed
|
||||
from right to left instead of the usual left to right. This is useful
|
||||
primarily when editing Hebrew or other Middle-Eastern languages.
|
||||
See |rileft.txt| for further details.
|
||||
|
||||
Details
|
||||
--------------
|
||||
+ Options:
|
||||
+ 'rightleft' ('rl') sets window orientation to right-to-left. This means
|
||||
that the logical text 'ABC' will be displayed as 'CBA', and will start
|
||||
drawing at the right edge of the window, not the left edge.
|
||||
+ 'hkmap' ('hk') sets keyboard mapping to Hebrew, in insert/replace modes.
|
||||
+ 'aleph' ('al'), numeric, holds the decimal code of Aleph, for keyboard
|
||||
mapping.
|
||||
+ 'hkmapp' ('hkp') sets keyboard mapping to 'phonetic hebrew'
|
||||
|
||||
NOTE: these three ('hkmap', 'hkmapp' and 'aleph') are obsolete. You should
|
||||
use ":set keymap=hebrewp" instead.
|
||||
|
||||
+ 'delcombine' ('deco'), boolean, if editing UTF-8 encoded Hebrew, allows
|
||||
one to remove the niqud or te`amim by pressing 'x' on a character (with
|
||||
associated niqud).
|
||||
|
||||
+ 'rightleftcmd' ('rlc') makes the command-prompt for searches show up on
|
||||
the right side. It only takes effect if the window is 'rightleft'.
|
||||
|
||||
+ Encoding:
|
||||
+ Under Unix, ISO 8859-8 encoding (Hebrew letters codes: 224-250).
|
||||
+ Under MS DOS, PC encoding (Hebrew letters codes: 128-154).
|
||||
These are defaults, that can be overridden using the 'aleph' option.
|
||||
+ You should prefer using UTF8, as it supports the combining-characters
|
||||
('deco' does nothing if UTF8 encoding is not active).
|
||||
|
||||
+ Vim arguments:
|
||||
+ 'vim -H file' starts editing a Hebrew file, i.e. 'rightleft' and 'hkmap'
|
||||
are set.
|
||||
|
||||
+ Keyboard:
|
||||
+ The 'allowrevins' option enables the CTRL-_ command in Insert mode and
|
||||
in Command-line mode.
|
||||
|
||||
+ CTRL-_ in insert/replace modes toggles 'revins' and 'hkmap' as follows:
|
||||
|
||||
When in rightleft window, 'revins' and 'nohkmap' are toggled, since
|
||||
English will likely be inserted in this case.
|
||||
|
||||
When in norightleft window, 'revins' 'hkmap' are toggled, since Hebrew
|
||||
will likely be inserted in this case.
|
||||
|
||||
CTRL-_ moves the cursor to the end of the typed text.
|
||||
|
||||
+ CTRL-_ in command mode only toggles keyboard mapping (see Bugs below).
|
||||
This setting is independent of 'hkmap' option, which only applies to
|
||||
insert/replace mode.
|
||||
|
||||
Note: On some keyboards, CTRL-_ is mapped to CTRL-?.
|
||||
|
||||
+ Keyboard mapping while 'hkmap' is set (standard Israeli keyboard):
|
||||
|
||||
q w e r t y u i o p
|
||||
/ ' ק ר א ט ו ן ם פ
|
||||
|
||||
a s d f g h j k l ; '
|
||||
ש ד ג כ ע י ח ל ך ף ,
|
||||
|
||||
z x c v b n m , . /
|
||||
ז ס ב ה נ מ צ ת ץ .
|
||||
|
||||
This is also the keymap when 'keymap=hebrew' is set. The advantage of
|
||||
'keymap' is that it works properly when using UTF8, e.g. it inserts the
|
||||
correct characters; 'hkmap' does not. The 'keymap' keyboard can also
|
||||
insert niqud and te`amim. To see what those mappings are,look at the
|
||||
keymap file 'hebrew.vim' etc.
|
||||
|
||||
|
||||
Typing backwards
|
||||
|
||||
If the 'revins' (reverse insert) option is set, inserting happens backwards.
|
||||
This can be used to type Hebrew. When inserting characters the cursor is not
|
||||
moved and the text moves rightwards. A <BS> deletes the character under the
|
||||
cursor. CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
|
||||
and CTRL-U do not stop at the start of insert or end of line, no matter how
|
||||
the 'backspace' option is set.
|
||||
|
||||
There is no reverse replace mode (yet).
|
||||
|
||||
If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown in the
|
||||
status line when reverse Insert mode is active.
|
||||
|
||||
When the 'allowrevins' option is set, reverse Insert mode can be also entered
|
||||
via CTRL-_, which has some extra functionality: First, keyboard mapping is
|
||||
changed according to the window orientation -- if in a left-to-right window,
|
||||
'revins' is used to enter Hebrew text, so the keyboard changes to Hebrew
|
||||
('hkmap' is set); if in a right-to-left window, 'revins' is used to enter
|
||||
English text, so the keyboard changes to English ('hkmap' is reset). Second,
|
||||
when exiting 'revins' via CTRL-_, the cursor moves to the end of the typed
|
||||
text (if possible).
|
||||
|
||||
|
||||
Pasting when in a rightleft window
|
||||
----------------------------------
|
||||
When cutting text with the mouse and pasting it in a rightleft window
|
||||
the text will be reversed, because the characters come from the cut buffer
|
||||
from the left to the right, while inserted in the file from the right to
|
||||
the left. In order to avoid it, toggle 'revins' (by typing CTRL-? or CTRL-_)
|
||||
before pasting.
|
||||
|
||||
|
||||
Hebrew characters and the 'isprint' variable
|
||||
--------------------------------------------
|
||||
Sometimes Hebrew character codes are in the non-printable range defined by
|
||||
the 'isprint' variable. For example in the Linux console, the Hebrew font
|
||||
encoding starts from 128, while the default 'isprint' variable is @,161-255.
|
||||
The result is that all Hebrew characters are displayed as ~x. To solve this
|
||||
problem, set isprint=@,128-255.
|
||||
-->
|
||||
|
||||
@@ -1,189 +0,0 @@
|
||||
*help.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim - main help file
|
||||
|
||||
Jump to a subject: Double-click the left mouse button on a tag between |bars|.
|
||||
|
||||
Get specific help: It is possible to go directly to whatever you want help
|
||||
on, by giving an argument to the ":help" command |:help|.
|
||||
It is possible to further specify the context:
|
||||
*help-context*
|
||||
WHAT PREPEND EXAMPLE ~
|
||||
Normal mode commands (nothing) :help x
|
||||
Visual mode commands v_ :help v_u
|
||||
Insert mode commands i_ :help i_<Esc>
|
||||
Command-line commands : :help :quit
|
||||
Command-line editing c_ :help c_<Del>
|
||||
Vim command arguments - :help -r
|
||||
options ' :help 'textwidth'
|
||||
|
||||
VIM stands for Vi IMproved. Most of VIM was made by Bram Moolenaar, but only
|
||||
through the help of many others. See |credits|. IdeaVIM was written by Rick
|
||||
Maddy.
|
||||
------------------------------------------------------------------------------
|
||||
*doc-file-list* *Q_ct*
|
||||
BASIC:
|
||||
|quickref| Overview of the most common commands you will use
|
||||
|tutor| 30 minutes training course for beginners
|
||||
<!--
|
||||
|copying| About copyrights
|
||||
-->
|
||||
|www| Vim on the World Wide Web
|
||||
|bugs| Where to send bug reports
|
||||
|
||||
USER MANUAL: These files explain how to accomplish an editing task.
|
||||
|
||||
|usr_toc.txt| Table Of Contents
|
||||
|
||||
Getting Started ~
|
||||
|usr_01.txt| About the manuals
|
||||
|usr_02.txt| The first steps in Vim
|
||||
|usr_03.txt| Moving around
|
||||
|usr_04.txt| Making small changes
|
||||
|usr_05.txt| Set your settings
|
||||
|usr_06.txt| Using syntax highlighting
|
||||
|usr_07.txt| Editing more than one file
|
||||
|usr_08.txt| Splitting windows
|
||||
|usr_09.txt| Using the GUI
|
||||
|usr_10.txt| Making big changes
|
||||
|usr_11.txt| Recovering from a crash
|
||||
|usr_12.txt| Clever tricks
|
||||
|
||||
Editing Effectively ~
|
||||
|usr_20.txt| Typing command-line commands quickly
|
||||
|usr_21.txt| Go away and come back
|
||||
|usr_22.txt| Finding the file to edit
|
||||
|usr_23.txt| Editing other files
|
||||
|usr_24.txt| Inserting quickly
|
||||
|usr_25.txt| Editing formatted text
|
||||
|usr_26.txt| Repeating
|
||||
|usr_27.txt| Search commands and patterns
|
||||
|usr_28.txt| Folding
|
||||
|usr_29.txt| Moving through programs
|
||||
|usr_30.txt| Editing programs
|
||||
|usr_31.txt| Exploiting the GUI
|
||||
|
||||
<!--
|
||||
Tuning Vim ~
|
||||
|usr_40.txt| Make new commands
|
||||
|usr_41.txt| Write a Vim script
|
||||
|usr_42.txt| Add new menus
|
||||
|usr_43.txt| Using filetypes
|
||||
|usr_44.txt| Your own syntax highlighted
|
||||
|usr_45.txt| Select your language
|
||||
|
||||
Making Vim Run ~
|
||||
|usr_90.txt| Installing Vim
|
||||
|
||||
-->
|
||||
|
||||
REFERENCE MANUAL: These files explain every detail of Vim.
|
||||
|
||||
General subjects ~
|
||||
|intro.txt| general introduction to Vim; notation used in help files
|
||||
|help.txt| overview and quick reference (this file)
|
||||
|index.txt| alphabetical index of all commands
|
||||
<!--
|
||||
|help-tags| all the tags you can jump to (index of tags)
|
||||
-->
|
||||
|howto.txt| how to do the most common editing tasks
|
||||
|tips.txt| various tips on using Vim
|
||||
|message.txt| (error) messages and explanations
|
||||
|todo.txt| known problems and desired extensions
|
||||
|
||||
Basic editing ~
|
||||
|starting.txt| starting Vim, Vim command arguments, initialisation
|
||||
|editing.txt| editing and writing files
|
||||
|motion.txt| commands for moving around
|
||||
|scroll.txt| scrolling the text in the window
|
||||
|insert.txt| Insert and Replace mode
|
||||
|change.txt| deleting and replacing text
|
||||
|indent.txt| automatic indenting for C and other languages
|
||||
|undo.txt| Undo and Redo
|
||||
|repeat.txt| repeating commands, Vim scripts and debugging
|
||||
|visual.txt| using the Visual mode (selecting a text area)
|
||||
|various.txt| various remaining commands
|
||||
|recover.txt| recovering from a crash
|
||||
|
||||
Advanced editing ~
|
||||
|cmdline.txt| Command-line editing
|
||||
|options.txt| description of all options
|
||||
|pattern.txt| regexp patterns and search commands
|
||||
|map.txt| key mapping and abbreviations
|
||||
|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
|
||||
|syntax.txt| syntax highlighting
|
||||
|diff.txt| working with two or three versions of the same file
|
||||
|autocmd.txt| automatically executing commands on an event
|
||||
|filetype.txt| settings done specifically for a type of file
|
||||
|eval.txt| expression evaluation, conditional commands
|
||||
|fold.txt| hide (fold) ranges of lines
|
||||
|
||||
Special issues ~
|
||||
<!--
|
||||
|remote.txt| using Vim as a server or client
|
||||
|term.txt| using different terminals and mice
|
||||
-->
|
||||
|digraph.txt| list of available digraphs
|
||||
<!--
|
||||
|mbyte.txt| multi-byte text support
|
||||
|mlang.txt| non-English language support
|
||||
|arabic.txt| Arabic language support and editing
|
||||
|farsi.txt| Farsi (Persian) editing
|
||||
|hebrew.txt| Hebrew language support and editing
|
||||
|hangulin.txt| Hangul (Korean) input mode
|
||||
|rileft.txt| right-to-left editing mode
|
||||
-->
|
||||
<!--
|
||||
|
||||
GUI ~
|
||||
|gui.txt| Graphical User Interface (GUI)
|
||||
|gui_w16.txt| Windows 3.1 GUI
|
||||
|gui_w32.txt| Win32 GUI
|
||||
|gui_x11.txt| X11 GUI
|
||||
-->
|
||||
<!--
|
||||
|
||||
Interfaces ~
|
||||
|if_cscop.txt| using cscope with Vim
|
||||
|if_perl.txt| Perl interface
|
||||
|if_pyth.txt| Python interface
|
||||
|if_sniff.txt| SNiFF+ interface
|
||||
|if_tcl.txt| Tcl interface
|
||||
|if_ole.txt| OLE automation interface for Win32
|
||||
|if_ruby.txt| Ruby interface
|
||||
|debugger.txt| Interface with a debugger
|
||||
|workshop.txt| Sun Visual Workshop interface
|
||||
|netbeans.txt| NetBeans External Editor interface
|
||||
|sign.txt| debugging signs
|
||||
-->
|
||||
|
||||
Versions ~
|
||||
|vi_diff.txt| main differences between Vim and Vi
|
||||
|
||||
<!--
|
||||
*sys-file-list*
|
||||
Remarks about specific systems ~
|
||||
|os_390.txt| OS/390 Unix
|
||||
|os_amiga.txt| Amiga
|
||||
|os_beos.txt| BeOS and BeBox
|
||||
|os_dos.txt| MS-DOS and MS-Windows NT/95 common items
|
||||
|os_mac.txt| Macintosh
|
||||
|os_mint.txt| Atari MiNT
|
||||
|os_msdos.txt| MS-DOS (plain DOS and DOS box under Windows)
|
||||
|os_os2.txt| OS/2
|
||||
|os_qnx.txt| QNX
|
||||
|os_risc.txt| RISC-OS
|
||||
|os_unix.txt| Unix
|
||||
|os_vms.txt| VMS
|
||||
|os_win32.txt| MS-Windows 95/98/NT
|
||||
-->
|
||||
<!--
|
||||
|
||||
Standard plugins *standard-plugin-list* ~
|
||||
|pi_netrw.txt| Reading and writing files over a network
|
||||
|pi_gzip.txt| Reading and writing compressed files
|
||||
|pi_expl.txt| File explorer
|
||||
-->
|
||||
|
||||
@@ -1,115 +0,0 @@
|
||||
*howto.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
How to ... *howdoi* *how-do-i* *howto* *how-to*
|
||||
|
||||
<!--
|
||||
|tutor| get started
|
||||
-->
|
||||
|:quit| exit? I'm trapped, help me!
|
||||
<!--
|
||||
|initialization| initialize Vim
|
||||
|vimrc-intro| write a Vim script file (vimrc)
|
||||
|suspend| suspend Vim
|
||||
|usr_11.txt| recover after a crash
|
||||
|07.4| keep a backup of my file when writing over it
|
||||
|
||||
-->
|
||||
|usr_07.txt| edit files
|
||||
<!--
|
||||
|23.4| edit binary files
|
||||
-->
|
||||
|usr_24.txt| insert text
|
||||
|deleting| delete text
|
||||
|usr_04.txt| change text
|
||||
|04.5| copy and move text
|
||||
|usr_25.txt| format text
|
||||
<!--
|
||||
|30.6| format comments
|
||||
|30.2| indent C programs
|
||||
|25.3| automatically set indent
|
||||
|
||||
-->
|
||||
|usr_26.txt| repeat commands
|
||||
|02.5| undo and redo
|
||||
|
||||
|usr_03.txt| move around
|
||||
|word-motions| word motions
|
||||
|left-right-motions| left-right motions
|
||||
|up-down-motions| up-down motions
|
||||
|object-motions| text-object motions
|
||||
|various-motions| various motions
|
||||
|object-select| text-object selection
|
||||
<!--
|
||||
|'whichwrap'| move over line breaks
|
||||
|'virtualedit'| move to where there is no text
|
||||
-->
|
||||
|usr_27.txt| specify pattern for searches
|
||||
|tags-and-searches| do tags and special searches
|
||||
<!--
|
||||
|29.4| search in include'd files used to find
|
||||
variables, functions, or macros
|
||||
-->
|
||||
|K| look up manual for the keyword under cursor
|
||||
|
||||
|03.7| scroll
|
||||
|'sidescroll'| scroll horizontally/sideways
|
||||
|'scrolloff'| set visible context lines
|
||||
|
||||
|mode-switching| change modes
|
||||
|04.4| use Visual mode
|
||||
<!--
|
||||
|'insertmode'| start Vim in Insert mode
|
||||
|
||||
|40.1| map keys
|
||||
|24.7| create abbreviations
|
||||
|
||||
|ins-expandtab| expand a tab to spaces in Insert mode
|
||||
-->
|
||||
|i_CTRL-R| insert contents of a register in Insert mode
|
||||
|24.3| complete words in Insert mode
|
||||
<!--
|
||||
|25.1| break a line before it gets too long
|
||||
|
||||
|20.1| do command-line editing
|
||||
|20.3| do command-line completion
|
||||
|'cmdheight'| increase the height of command-line
|
||||
-->
|
||||
|10.3| specify command-line ranges
|
||||
<!--
|
||||
|40.3| specify commands to be executed automatically
|
||||
before/after reading/writing entering/leaving a
|
||||
buffer/window
|
||||
|
||||
|'autowrite'| write automatically
|
||||
|30.1| speedup edit-compile-edit cycle or compile and fix
|
||||
errors within Vim
|
||||
|
||||
-->
|
||||
|options| set options
|
||||
<!--
|
||||
|auto-setting| set options automatically
|
||||
|term-dependent-settings| set options depending on terminal name
|
||||
|save-settings| save settings
|
||||
|:quote| comment my exrc/vimrc/gvimrc files
|
||||
|'helpheight'| change the default help height
|
||||
|'highlight'| set various highlighting modes
|
||||
|'title'| set the window title
|
||||
|'icon'| set window icon title
|
||||
|'report'| avoid seeing the change messages on every line
|
||||
|'shortmess'| avoid |hit-enter| prompts
|
||||
|
||||
|mouse-using| use mouse with Vim
|
||||
|usr_08.txt| manage multiple windows and buffers
|
||||
|gui.txt| use the gui
|
||||
|
||||
|You can't! (yet)| do dishes using Vim
|
||||
|
||||
|usr_06.txt| switch on syntax highlighting
|
||||
|2html.vim| convert a colored file to HTML
|
||||
|less| use Vim like less or more with syntax highlighting
|
||||
-->
|
||||
|
||||
@@ -1,476 +0,0 @@
|
||||
*if_cscop.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
*cscope* *Cscope*
|
||||
This document explains how to use Vim's cscope interface.
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Cscope is a tool like ctags, but think of it as ctags on steroids since it
|
||||
does a lot more than what ctags provides. In Vim, jumping to a result from
|
||||
a cscope query is just like jumping to any tag; it is saved on the tag stack
|
||||
so that with the right keyboard mappings, you can jump back and forth between
|
||||
functions as you normally would with |tags|.
|
||||
|
||||
1. Cscope introduction |cscope-intro|
|
||||
2. Cscope related commands |cscope-commands|
|
||||
3. Cscope options |cscope-options|
|
||||
4. How to use cscope in Vim |cscope-howtouse|
|
||||
5. Limitations |cscope-limitations|
|
||||
6. Suggested usage |cscope-suggestions|
|
||||
7. Availability & Information |cscope-info|
|
||||
|
||||
This is currently for Unix and Win32 only.
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Cscope introduction *cscope-intro*
|
||||
|
||||
The following text is taken from a version of the cscope man page:
|
||||
|
||||
-----
|
||||
|
||||
Cscope is an interactive screen-oriented tool that helps you:
|
||||
|
||||
Learn how a C program works without endless flipping through a thick
|
||||
listing.
|
||||
|
||||
Locate the section of code to change to fix a bug without having to
|
||||
learn the entire program.
|
||||
|
||||
Examine the effect of a proposed change such as adding a value to an
|
||||
enum variable.
|
||||
|
||||
Verify that a change has been made in all source files such as adding
|
||||
an argument to an existing function.
|
||||
|
||||
Rename a global variable in all source files.
|
||||
|
||||
Change a constant to a preprocessor symbol in selected lines of files.
|
||||
|
||||
It is designed to answer questions like:
|
||||
Where is this symbol used?
|
||||
Where is it defined?
|
||||
Where did this variable get its value?
|
||||
What is this global symbol's definition?
|
||||
Where is this function in the source files?
|
||||
What functions call this function?
|
||||
What functions are called by this function?
|
||||
Where does the message "out of space" come from?
|
||||
Where is this source file in the directory structure?
|
||||
What files include this header file?
|
||||
|
||||
Cscope answers these questions from a symbol database that it builds the
|
||||
first time it is used on the source files. On a subsequent call, cscope
|
||||
rebuilds the database only if a source file has changed or the list of
|
||||
source files is different. When the database is rebuilt the data for the
|
||||
unchanged files is copied from the old database, which makes rebuilding
|
||||
much faster than the initial build.
|
||||
|
||||
-----
|
||||
|
||||
When cscope is normally invoked, you will get a full-screen selection
|
||||
screen allowing you to make a query for one of the above questions.
|
||||
However, once a match is found to your query and you have entered your
|
||||
text editor to edit the source file containing match, you cannot simply
|
||||
jump from tag to tag as you normally would with vi's Ctrl-] or :tag
|
||||
command.
|
||||
|
||||
Vim's cscope interface is done by invoking cscope with its line-oriented
|
||||
interface, and then parsing the output returned from a query. The end
|
||||
result is that cscope query results become just like regular tags, so
|
||||
you can jump to them just like you do with normal tags (Ctrl-] or :tag)
|
||||
and then go back by popping off the tagstack with Ctrl-T. (Please note
|
||||
however, that you don't actually jump to a cscope tag simply by doing
|
||||
Ctrl-] or :tag without remapping these commands or setting an option.
|
||||
See the remaining sections on how the cscope interface works and for
|
||||
suggested use.)
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Cscope related commands *cscope-commands*
|
||||
|
||||
*:cscope* *:cs* *:scs* *:scscope* *E259* *E262* *E561* *E560*
|
||||
All cscope commands are accessed through suboptions to the main cscope
|
||||
command ":cscope". The shortest abbreviation is ":cs". The ":scscope"
|
||||
command does the same and also splits the window (short: "scs").
|
||||
|
||||
The available subcommands are:
|
||||
|
||||
*E563* *E564* *E566* *E568* *E569* *E622* *E623*
|
||||
*E625* *E626* *E609*
|
||||
add : Add a new cscope database/connection.
|
||||
|
||||
USAGE :cs add {file|dir} [pre-path] [flags]
|
||||
|
||||
[pre-path] is the pathname used with the -P command to cscope.
|
||||
|
||||
[flags] are any additional flags you want to pass to cscope.
|
||||
|
||||
EXAMPLES >
|
||||
:cscope add /usr/local/cdb/cscope.out
|
||||
:cscope add /projects/vim/cscope.out /usr/local/vim
|
||||
:cscope add cscope.out /usr/local/vim -C
|
||||
<
|
||||
*cscope-find* *cs-find*
|
||||
*E565* *E567*
|
||||
find : Query cscope. All cscope query options are available
|
||||
except option #5 ("Change this grep pattern").
|
||||
|
||||
USAGE :cs find {querytype} {name}
|
||||
|
||||
{querytype} corresponds to the actual cscope line
|
||||
interface numbers as well as default nvi commands:
|
||||
|
||||
0 or s: Find this C symbol
|
||||
1 or g: Find this definition
|
||||
2 or d: Find functions called by this function
|
||||
3 or c: Find functions calling this function
|
||||
4 or t: Find this text string
|
||||
6 or e: Find this egrep pattern
|
||||
7 or f: Find this file
|
||||
8 or i: Find files #including this file
|
||||
|
||||
EXAMPLES >
|
||||
:cscope find c vim_free
|
||||
:cscope find 3 vim_free
|
||||
<
|
||||
These two examples perform the same query. >
|
||||
|
||||
:cscope find 0 DEFAULT_TERM
|
||||
<
|
||||
Executing this example on the source code for Vim 5.1 produces the
|
||||
following output:
|
||||
|
||||
Cscope tag: DEFAULT_TERM
|
||||
# line filename / context / line
|
||||
1 1009 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"amiga"
|
||||
2 1013 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"win32"
|
||||
3 1017 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"pcterm"
|
||||
4 1021 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"ansi"
|
||||
5 1025 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"vt52"
|
||||
6 1029 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"os2ansi"
|
||||
7 1033 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"ansi"
|
||||
8 1037 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
# undef DEFAULT_TERM
|
||||
9 1038 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"beos-ansi"
|
||||
10 1042 vim-5.1-gtk/src/term.c <<GLOBAL>>
|
||||
#define DEFAULT_TERM (char_u *)"mac-ansi"
|
||||
11 1335 vim-5.1-gtk/src/term.c <<set_termname>>
|
||||
term = DEFAULT_TERM;
|
||||
12 1459 vim-5.1-gtk/src/term.c <<set_termname>>
|
||||
if (STRCMP(term, DEFAULT_TERM))
|
||||
13 1826 vim-5.1-gtk/src/term.c <<termcapinit>>
|
||||
term = DEFAULT_TERM;
|
||||
14 1833 vim-5.1-gtk/src/term.c <<termcapinit>>
|
||||
term = DEFAULT_TERM;
|
||||
15 3635 vim-5.1-gtk/src/term.c <<update_tcap>>
|
||||
p = find_builtin_term(DEFAULT_TERM);
|
||||
Enter nr of choice (<CR> to abort):
|
||||
|
||||
The output shows several pieces of information:
|
||||
1. The tag number (there are 15 in this example).
|
||||
2. The line number where the tag occurs.
|
||||
3. The filename where the tag occurs.
|
||||
4. The context of the tag (e.g., global, or the function name).
|
||||
5. The line from the file itself.
|
||||
|
||||
help : Show a brief synopsis.
|
||||
|
||||
USAGE :cs help
|
||||
|
||||
*E260* *E261*
|
||||
kill : Kill a cscope connection (or kill all cscope connections).
|
||||
|
||||
USAGE :cs kill {num|partial_name}
|
||||
|
||||
To kill a cscope connection, the connection number or a partial
|
||||
name must be specified. The partial name is simply any part of
|
||||
the pathname of the cscope database. Kill a cscope connection
|
||||
using the partial name with caution!
|
||||
|
||||
If the specified connection number is -1, then _ALL_ cscope
|
||||
connections will be killed.
|
||||
|
||||
reset : Reinit all cscope connections.
|
||||
|
||||
USAGE :cs reset
|
||||
|
||||
show : Show cscope connections.
|
||||
|
||||
USAGE :cs show
|
||||
|
||||
*: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
|
||||
search your cscope database(s) for a match, and if one is not found, then
|
||||
your tags file(s) will be searched. The order in which this happens
|
||||
is determined by the value of |csto|. See |cscope-options| for more
|
||||
details.
|
||||
|
||||
|:cstag| performs the equivalent of ":cs find g" on the identifier when
|
||||
searching through the cscope database(s).
|
||||
|
||||
|:cstag| performs the equivalent of |:tjump| on the identifier when searching
|
||||
through your tags file(s).
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. Cscope options *cscope-options*
|
||||
|
||||
Use the |:set| command to set all cscope options. Ideally, you would do
|
||||
this in one of your startup files (e.g., .vimrc). Some cscope related
|
||||
variables are only valid within |.vimrc|. Setting them after vim has
|
||||
started will have no effect!
|
||||
|
||||
*cscopeprg* *csprg*
|
||||
'cscopeprg' specifies the command to execute cscope. The default is
|
||||
"cscope". For example: >
|
||||
:set csprg=/usr/local/bin/cscope
|
||||
<
|
||||
*cscopequickfix* *csqf* *E469*
|
||||
{not available when compiled without the |+quickfix| feature}
|
||||
'cscopequickfix' specifies whether to use quickfix window to show cscope
|
||||
results. This is a list of comma-separated values. Each item consists of
|
||||
|cscope-find| command (s, g, d, c, t, e, f or i) and flag (+, - or 0).
|
||||
'+' indicates that results must be appended to quickfix window,
|
||||
'-' implies previous results clearance, '0' or command absence - don't use
|
||||
quickfix. Search is performed from start until first command occurence.
|
||||
The default value is "" (don't use quickfix anyway). The following value
|
||||
seems to be useful: "s-,c-,d-,i-,t-,e-".
|
||||
|
||||
*cscopetag* *cst*
|
||||
If 'cscopetag' set, the commands ":tag" and CTRL-] as well as "vim -t" will
|
||||
always use |:cstag| instead of the default :tag behavior. Effectively, by
|
||||
setting 'cst', you will always search your cscope databases as well as your
|
||||
tag files. The default is off. Examples: >
|
||||
:set cst
|
||||
:set nocst
|
||||
<
|
||||
*cscopetagorder* *csto*
|
||||
The value of 'csto' determines the order in which |:cstag| performs a search.
|
||||
If 'csto' is set to zero, cscope database(s) are searched first, followed
|
||||
by tag file(s) if cscope did not return any matches. If 'csto' is set to
|
||||
one, tag file(s) are searched before cscope database(s). The default is zero.
|
||||
Examples: >
|
||||
:set csto=0
|
||||
:set csto=1
|
||||
<
|
||||
*cscopeverbose* *csverb*
|
||||
If 'cscopeverbose' is not set (the default), messages will not be printed
|
||||
indicating success or failure when adding a cscope database. Ideally, you
|
||||
should reset this option in your |.vimrc| before adding any cscope databases,
|
||||
and after adding them, set it. From then on, when you add more databases
|
||||
within Vim, you will get a (hopefully) useful message should the database fail
|
||||
to be added. Examples: >
|
||||
:set csverb
|
||||
:set nocsverb
|
||||
<
|
||||
*cscopepathcomp* *cspc*
|
||||
The value of 'cspc' determines how many components of a file's path to
|
||||
display. With the default value of zero the entire path will be displayed.
|
||||
The value one will display only the filename with no path. Other values
|
||||
display that many components. For example: >
|
||||
:set cspc=3
|
||||
will display the last 3 components of the file's path, including the file
|
||||
name itself.
|
||||
|
||||
==============================================================================
|
||||
4. How to use cscope in Vim *cscope-howtouse*
|
||||
|
||||
The first thing you need to do is to build a cscope database for your
|
||||
source files. For the most basic case, simply do "cscope -b". Please
|
||||
refer to the cscope man page for more details.
|
||||
|
||||
Assuming you have a cscope database, you need to "add" the database to Vim.
|
||||
This establishes a cscope "connection" and makes it available for Vim to use.
|
||||
You can do this in your .vimrc file, or you can do it manually after starting
|
||||
vim. For example, to add the cscope database "cscope.out", you would do:
|
||||
|
||||
:cs add cscope.out
|
||||
|
||||
You can double-check the result of this by executing ":cs show". This will
|
||||
produce output which looks like this:
|
||||
|
||||
# pid database name prepend path
|
||||
0 28806 cscope.out <none>
|
||||
|
||||
Note:
|
||||
Because of the Microsoft RTL limitations, Win32 version shows 0 instead
|
||||
of the real pid.
|
||||
|
||||
Once a cscope connection is established, you can make queries to cscope and
|
||||
the results will be printed to you. Queries are made using the command
|
||||
":cs find". For example:
|
||||
|
||||
:cs find g ALIGN_SIZE
|
||||
|
||||
This can get a little cumbersome since one ends up doing a significant
|
||||
amount of typing. Fortunately, there are ways around this by mapping
|
||||
shortcut keys. See |cscope-suggestions| for suggested usage.
|
||||
|
||||
If the results return only one match, you will automatically be taken to it.
|
||||
If there is more than one match, you will be given a selection screen to pick
|
||||
the match you want to go to. After you have jumped to the new location,
|
||||
simply hit Ctrl-T to get back to the previous one.
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. Limitations *cscope-limitations*
|
||||
|
||||
Cscope support for Vim is only available on systems that support these four
|
||||
system calls: fork(), pipe(), execl(), waitpid(). This means it is mostly
|
||||
limited to Unix systems.
|
||||
|
||||
Additionally Cscope support works for Win32. For more information and a
|
||||
cscope version for Win32 see:
|
||||
|
||||
http://iamphet.nm.ru/cscope/index.html
|
||||
|
||||
There are a couple of hard-coded limitations:
|
||||
|
||||
1. The maximum number of cscope connections allowed is 8. Do you
|
||||
really need more?
|
||||
|
||||
2. Doing a |:tjump| when |:cstag| searches the tag files is not
|
||||
configurable (e.g., you can't do a tselect instead).
|
||||
|
||||
==============================================================================
|
||||
6. Suggested usage *cscope-suggestions*
|
||||
|
||||
Put these entries in your .vimrc (adjust the pathname accordingly to your
|
||||
setup): >
|
||||
|
||||
if has("cscope")
|
||||
set csprg=/usr/local/bin/cscope
|
||||
set csto=0
|
||||
set cst
|
||||
set nocsverb
|
||||
" add any database in current directory
|
||||
if filereadable("cscope.out")
|
||||
cs add cscope.out
|
||||
" else add database pointed to by environment
|
||||
elseif $CSCOPE_DB != ""
|
||||
cs add $CSCOPE_DB
|
||||
endif
|
||||
set csverb
|
||||
endif
|
||||
|
||||
By setting 'cscopetag', we have effectively replaced all instances of the :tag
|
||||
command with :cstag. This includes :tag, Ctrl-], and "vim -t". In doing
|
||||
this, the regular tag command not only searches your ctags generated tag
|
||||
files, but your cscope databases as well.
|
||||
|
||||
Some users may want to keep the regular tag behavior and have a different
|
||||
shortcut to access :cstag. For example, one could map Ctrl-_ (underscore)
|
||||
to :cstag with the following command: >
|
||||
|
||||
map <C-_> :cstag <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
A couple of very commonly used cscope queries (using ":cs find") is to
|
||||
find all functions calling a certain function and to find all occurrences
|
||||
of a particular C symbol. To do this, you can use these mappings as an
|
||||
example: >
|
||||
|
||||
map g<C-]> :cs find 3 <C-R>=expand("<cword>")<CR><CR>
|
||||
map g<C-\> :cs find 0 <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
These mappings for Ctrl-] (right bracket) and Ctrl-\ (backslash) allow you to
|
||||
place your cursor over the function name or C symbol and quickly query cscope
|
||||
for any matches.
|
||||
|
||||
Or you may use the following scheme, inspired by Vim/Cscope tutorial from
|
||||
Cscope Home Page (http://cscope.sourceforge.net/): >
|
||||
|
||||
nmap <C-_>s :cs find s <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>g :cs find g <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>c :cs find c <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>t :cs find t <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>e :cs find e <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-_>f :cs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-_>i :cs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-_>d :cs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Using 'CTRL-spacebar' then a search type makes the vim window
|
||||
" split horizontally, with search result displayed in
|
||||
" the new window.
|
||||
|
||||
nmap <C-Space>s :scs find s <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>g :scs find g <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>c :scs find c <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>t :scs find t <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>e :scs find e <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space>f :scs find f <C-R>=expand("<cfile>")<CR><CR>
|
||||
nmap <C-Space>i :scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space>d :scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
" Hitting CTRL-space *twice* before the search type does a vertical
|
||||
" split instead of a horizontal one
|
||||
|
||||
nmap <C-Space><C-Space>s
|
||||
\:vert scs find s <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>g
|
||||
\:vert scs find g <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>c
|
||||
\:vert scs find c <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>t
|
||||
\:vert scs find t <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>e
|
||||
\:vert scs find e <C-R>=expand("<cword>")<CR><CR>
|
||||
nmap <C-Space><C-Space>i
|
||||
\:vert scs find i ^<C-R>=expand("<cfile>")<CR>$<CR>
|
||||
nmap <C-Space><C-Space>d
|
||||
\:vert scs find d <C-R>=expand("<cword>")<CR><CR>
|
||||
|
||||
==============================================================================
|
||||
7. Cscope availability and information *cscope-info*
|
||||
|
||||
If you do not already have cscope (it did not come with your compiler
|
||||
license or OS distribution), then you can download it for free from:
|
||||
http://cscope.sourceforge.net/
|
||||
This is released by SCO under the BSD license.
|
||||
|
||||
If you want a newer version of cscope, you will probably have to buy it.
|
||||
According to the (old) nvi documentation:
|
||||
|
||||
You can buy version 13.3 source with an unrestricted license
|
||||
for $400 from AT&T Software Solutions by calling +1-800-462-8146.
|
||||
|
||||
Also you can download cscope 13.x and mlcscope 14.x (multi-lingual cscope
|
||||
which supports C, C++, Java, lex, yacc, breakpoint listing, Ingres, and SDL)
|
||||
from World-Wide Exptools Open Source packages page:
|
||||
http://www.bell-labs.com/project/wwexptools/packages.html
|
||||
|
||||
In Solaris 2.x, if you have the C compiler license, you will also have
|
||||
cscope. Both are usually located under /opt/SUNWspro/bin
|
||||
|
||||
SGI developers can also get it. Currently a tardist file can be found at:
|
||||
ftp://ftp.openage.com/pub/Sgi/Binaries/Cscope-13_3_tardist.gz
|
||||
https://toolbox.sgi.com/toolbox/utilities/cscope/
|
||||
The second one is for those who have a password for the SGI toolbox.
|
||||
|
||||
There is source to an older version of a cscope clone (called "cs") available
|
||||
on the net. Due to various reasons, this is not supported with Vim.
|
||||
|
||||
The cscope interface/support for Vim was originally written by
|
||||
Andy Kahn <ackahn@netapp.com>. The original structure (as well as a tiny
|
||||
bit of code) was adapted from the cscope interface in nvi. Please report
|
||||
any problems, suggestions, patches, et al., you have for the usage of
|
||||
cscope within Vim to him.
|
||||
*cscope-win32*
|
||||
For a cscope version for Win32 see: http://iamphet.nm.ru/cscope/index.html
|
||||
|
||||
Win32 support was added by Sergey Khorev <khorev@softlab.ru>. Contact him
|
||||
if you have Win32-specific issues.
|
||||
-->
|
||||
|
||||
@@ -1,165 +0,0 @@
|
||||
*if_ole.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
The OLE Interface to Vim *ole-interface*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Activation |ole-activation|
|
||||
2. Methods |ole-methods|
|
||||
3. The "normal" command |ole-normal|
|
||||
4. Registration |ole-registration|
|
||||
5. MS Visual Studio integration |MSVisualStudio|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
OLE is only available when compiled with the |+ole| feature. See
|
||||
src/if_ole.INSTALL.
|
||||
An alternative is using the client-server communication |clientserver|.
|
||||
|
||||
==============================================================================
|
||||
1. Activation *ole-activation*
|
||||
|
||||
Vim acts as an OLE automation server, accessible from any automation client,
|
||||
for example, Visual Basic, Python, or Perl. The Vim application "name" (its
|
||||
"ProgID", in OLE terminology) is "Vim.Application".
|
||||
|
||||
Hence, in order to start a Vim instance (or connect to an already running
|
||||
instance), code similar to the following should be used:
|
||||
|
||||
[Visual Basic] >
|
||||
Dim Vim As Object
|
||||
Set Vim = CreateObject("Vim.Application")
|
||||
|
||||
[Python] >
|
||||
from win32com.client.dynamic import Dispatch
|
||||
vim = Dispatch('Vim.Application')
|
||||
|
||||
[Perl] >
|
||||
use Win32::OLE;
|
||||
$vim = new Win32::OLE 'Vim.Application';
|
||||
|
||||
Vim does not support acting as a "hidden" OLE server, like some other OLE
|
||||
Automation servers. When a client starts up an instance of Vim, that instance
|
||||
is immediately visible. Simply closing the OLE connection to the Vim instance
|
||||
is not enough to shut down the Vim instance - it is necessary to explicitly
|
||||
execute a quit command (for example, :qa!, :wqa).
|
||||
|
||||
==============================================================================
|
||||
2. Methods *ole-methods*
|
||||
|
||||
Vim exposes four methods for use by clients.
|
||||
|
||||
*ole-sendkeys*
|
||||
SendKeys(keys) Execute a series of keys.
|
||||
|
||||
This method takes a single parameter, which is a string of keystrokes. These
|
||||
keystrokes are executed exactly as if they had been types in at the keyboard.
|
||||
Special keys can be given using their <..> names, as for the right hand side
|
||||
of a mapping. Note: Execution of the Ex "normal" command is not supported -
|
||||
see below |ole-normal|.
|
||||
|
||||
Examples (Visual Basic syntax) >
|
||||
Vim.SendKeys "ihello<Esc>"
|
||||
Vim.SendKeys "ma1GV4jy`a"
|
||||
|
||||
These examples assume that Vim starts in Normal mode. To force Normal mode,
|
||||
start the key sequence with CTRL-\ CTRL-N as in >
|
||||
|
||||
Vim.SendKeys "<C-\><C-N>ihello<Esc>"
|
||||
|
||||
CTRL-\ CTRL-N returns Vim to Normal mode, when in Insert or Command-line mode.
|
||||
Note that this doesn't work halfway a Vim command
|
||||
|
||||
*ole-eval*
|
||||
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.
|
||||
|
||||
Examples (Visual Basic syntax) >
|
||||
Line20 = Vim.Eval("getline(20)")
|
||||
Twelve = Vim.Eval("6 + 6") ' Note this is a STRING
|
||||
Font = Vim.Eval("&guifont")
|
||||
<
|
||||
*ole-setforeground*
|
||||
SetForeground() Make the Vim window come to the foreground
|
||||
|
||||
This method takes no arguments. No value is returned.
|
||||
|
||||
Example (Visual Basic syntax) >
|
||||
Vim.SetForeground
|
||||
<
|
||||
|
||||
*ole-gethwnd*
|
||||
GetHwnd() Return the handle of the Vim window.
|
||||
|
||||
This method takes no arguments. It returns the hwnd of the main Vimwindow.
|
||||
You can use this if you are writing something which needs to manipulate the
|
||||
Vim window, or to track it in the z-order, etc.
|
||||
|
||||
Example (Visual Basic syntax) >
|
||||
Vim_Hwnd = Vim.GetHwnd
|
||||
<
|
||||
|
||||
==============================================================================
|
||||
3. The "normal" command *ole-normal*
|
||||
|
||||
Due to the way Vim processes OLE Automation commands, combined with the method
|
||||
of implementation of the ex command :normal, it is not possible to execute the
|
||||
:normal command via OLE automation. Any attempt to do so will fail, probably
|
||||
harmlessly, although possibly in unpredictable ways.
|
||||
|
||||
There is currently no practical way to trap this situation, and users must
|
||||
simply be aware of the limitation.
|
||||
==============================================================================
|
||||
4. Registration *ole-registration* *E243*
|
||||
|
||||
Before Vim will act as an OLE server, it must be registered in the system
|
||||
registry. In order to do this, Vim should be run with a single parameter of
|
||||
"-register".
|
||||
*-register* >
|
||||
gvim -register
|
||||
|
||||
If gvim with OLE support is run and notices that no Vim OLE server has been
|
||||
registered, it will present a dialog and offers you the choice to register by
|
||||
clicking "Yes".
|
||||
|
||||
In some situations registering is not possible. This happens when the
|
||||
registry is not writable. If you run into this problem you need to run gvim
|
||||
as "Administrator".
|
||||
|
||||
Once vim is registered, the application path is stored in the registry. Before
|
||||
moving, deleting, or upgrading Vim, the registry entries should be removed
|
||||
using the "-unregister" switch.
|
||||
*-unregister* >
|
||||
gvim -unregister
|
||||
|
||||
The OLE mechanism will use the first registered Vim it finds. If a Vim is
|
||||
already running, this one will be used. If you want to have (several) Vim
|
||||
sessions open that should not react to OLE commands, use the non-OLE version,
|
||||
and put it in a different directory. The OLE version should then be put in a
|
||||
directory that is not in your normal path, so that typing "gvim" will start
|
||||
the non-OLE version.
|
||||
|
||||
*-silent*
|
||||
To avoid the message box that pops up to report the result, prepend "-silent":
|
||||
>
|
||||
gvim -silent -register
|
||||
gvim -silent -unregister
|
||||
|
||||
==============================================================================
|
||||
5. MS Visual Studio integration *MSVisualStudio* *VisVim*
|
||||
|
||||
The OLE version can be used to run Vim as the editor in Microsoft Visual
|
||||
Studio. This is called "VisVim". It is included in the archive that contains
|
||||
the OLE version. The documentation can be found in the VisVim directory, the
|
||||
README.txt file.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,257 +0,0 @@
|
||||
*if_perl.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
Perl and Vim *perl* *Perl*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Editing Perl files |perl-editing|
|
||||
2. Compiling VIM with Perl interface |perl-compiling|
|
||||
3. Using the Perl interface |perl-using|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
The Perl interface only works when Vim was compiled with the |+perl| feature.
|
||||
|
||||
==============================================================================
|
||||
1. Editing Perl files *perl-editing*
|
||||
|
||||
Vim syntax highlighting supports Perl and POD files. Vim assumes a file is
|
||||
Perl code if the filename has a .pl or .pm suffix. Vim also examines the first
|
||||
line of a file, regardless of the filename suffix, to check if a file is a
|
||||
Perl script (see scripts.vim in Vim's syntax directory). Vim assumes a file
|
||||
is POD text if the filename has a .POD suffix.
|
||||
|
||||
To use tags with Perl, you need a recent version of Exuberant ctags. Look
|
||||
here:
|
||||
http://ctags.sourceforge.net
|
||||
|
||||
Alternatively, you can use the Perl script pltags.pl, which is shipped with
|
||||
Vim in the $VIMRUNTIME/tools directory. This script has currently more
|
||||
features than Exuberant ctags' Perl support.
|
||||
|
||||
==============================================================================
|
||||
2. Compiling VIM with Perl interface *perl-compiling*
|
||||
|
||||
To compile Vim with Perl interface, you need Perl 5.004 (or later). Perl must
|
||||
be installed before you compile Vim. Vim's Perl interface does NOT work with
|
||||
the 5.003 version that has been officially released! It will probably work
|
||||
with Perl 5.003_05 and later.
|
||||
|
||||
The Perl patches for Vim were made by:
|
||||
Sven Verdoolaege <skimo@breughel.ufsia.ac.be>
|
||||
Matt Gerassimof
|
||||
|
||||
Perl for MS-Windows can be found at:
|
||||
http://www.perl.com/CPAN-local/ports/nt/Standard/x86/
|
||||
|
||||
==============================================================================
|
||||
3. Using the Perl interface *perl-using*
|
||||
|
||||
*:perl* *:pe*
|
||||
:pe[rl] {cmd} Execute Perl command {cmd}. The current package
|
||||
is "main".
|
||||
|
||||
:pe[rl] << {endpattern}
|
||||
{script}
|
||||
{endpattern}
|
||||
Execute Perl script {script}.
|
||||
{endpattern} must NOT be preceded by any white space.
|
||||
If {endpattern} is omitted, it defaults to a dot '.'
|
||||
like for the |:append| and |:insert| commands. This
|
||||
form of the |:perl| command is mainly useful for
|
||||
including perl code in vim scripts.
|
||||
Note: This command doesn't work when the Perl feature
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
|
||||
Example vim script: >
|
||||
|
||||
function! WhitePearl()
|
||||
perl << EOF
|
||||
VIM::Msg("pearls are nice for necklaces");
|
||||
VIM::Msg("rubys for rings");
|
||||
VIM::Msg("pythons for bags");
|
||||
VIM::Msg("tcls????");
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
|
||||
*:perldo* *:perld*
|
||||
:[range]perld[o] {cmd} Execute Perl command {cmd} for each line in the
|
||||
[range], with $_ being set to the text of each line in
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
the text, but note that it is not possible to add or
|
||||
delete lines using this command.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
|
||||
Here are some things you can try: >
|
||||
|
||||
:perl $a=1
|
||||
:perldo $_ = reverse($_);1
|
||||
:perl VIM::Msg("hello")
|
||||
:perl $line = $curbuf->Get(42)
|
||||
<
|
||||
*E299*
|
||||
Executing Perl commands in the |sandbox| is limited. ":perldo" will not be
|
||||
possible at all. ":perl" will be evaluated in the Safe environment, if
|
||||
possible.
|
||||
|
||||
|
||||
*perl-overview*
|
||||
Here is an overview of the functions that are available to Perl: >
|
||||
|
||||
:perl VIM::Msg("Text") # displays a message
|
||||
:perl VIM::Msg("Error", "ErrorMsg") # displays an error message
|
||||
:perl VIM::Msg("remark", "Comment") # displays a highlighted message
|
||||
:perl VIM::SetOption("ai") # sets a vim option
|
||||
:perl $nbuf = VIM::Buffers() # returns the number of buffers
|
||||
:perl @buflist = VIM::Buffers() # returns array of all buffers
|
||||
:perl $mybuf = (VIM::Buffers('qq.c'))[0] # returns buffer object for 'qq.c'
|
||||
:perl @winlist = VIM::Windows() # returns array of all windows
|
||||
:perl $nwin = VIM::Windows() # returns the number of windows
|
||||
:perl ($success, $v) = VIM::Eval('&path') # $v: option 'path', $success: 1
|
||||
:perl ($success, $v) = VIM::Eval('&xyz') # $v: '' and $success: 0
|
||||
:perl $v = VIM::Eval('expand("<cfile>")') # expands <cfile>
|
||||
:perl $curwin->SetHeight(10) # sets the window height
|
||||
:perl @pos = $curwin->Cursor() # returns (row, col) array
|
||||
:perl @pos = (10, 10)
|
||||
:perl $curwin->Cursor(@pos) # sets cursor to @pos
|
||||
:perl $curwin->Cursor(10,10) # sets cursor to row 10 col 10
|
||||
:perl $mybuf = $curwin->Buffer() # returns the buffer object for window
|
||||
:perl $curbuf->Name() # returns buffer name
|
||||
:perl $curbuf->Number() # returns buffer number
|
||||
:perl $curbuf->Count() # returns the number of lines
|
||||
:perl $l = $curbuf->Get(10) # returns line 10
|
||||
:perl @l = $curbuf->Get(1 .. 5) # returns lines 1 through 5
|
||||
:perl $curbuf->Delete(10) # deletes line 10
|
||||
:perl $curbuf->Delete(10, 20) # delete lines 10 through 20
|
||||
:perl $curbuf->Append(10, "Line") # appends a line
|
||||
:perl $curbuf->Append(10, "Line1", "Line2", "Line3") # appends 3 lines
|
||||
:perl @l = ("L1", "L2", "L3")
|
||||
:perl $curbuf->Append(10, @l) # appends L1, L2 and L3
|
||||
:perl $curbuf->Set(10, "Line") # replaces line 10
|
||||
:perl $curbuf->Set(10, "Line1", "Line2") # replaces lines 10 and 11
|
||||
:perl $curbuf->Set(10, @l) # replaces 3 lines
|
||||
<
|
||||
*perl-Msg*
|
||||
VIM::Msg({msg}, {group}?)
|
||||
Displays the message {msg}. The optional {group}
|
||||
argument specifies a highlight group for Vim to use
|
||||
for the message.
|
||||
|
||||
*perl-SetOption*
|
||||
VIM::SetOption({arg}) Sets a vim option. {arg} can be any argument that the
|
||||
":set" command accepts. Note that this means that no
|
||||
spaces are allowed in the argument! See |:set|.
|
||||
|
||||
*perl-Buffers*
|
||||
VIM::Buffers([{bn}...]) With no arguments, returns a list of all the buffers
|
||||
in an array context or returns the number of buffers
|
||||
in a scalar context. For a list of buffer names or
|
||||
numbers {bn}, returns a list of the buffers matching
|
||||
{bn}, using the same rules as Vim's internal
|
||||
|bufname()| function.
|
||||
|
||||
*perl-Windows*
|
||||
VIM::Windows([{wn}...]) With no arguments, returns a list of all the windows
|
||||
in an array context or returns the number of windows
|
||||
in a scalar context. For a list of window numbers
|
||||
{wn}, returns a list of the windows with those
|
||||
numbers.
|
||||
|
||||
*perl-DoCommand*
|
||||
VIM::DoCommand({cmd}) Executes Ex command {cmd}.
|
||||
|
||||
*perl-Eval*
|
||||
VIM::Eval({expr}) Evaluates {expr} and returns (success, val).
|
||||
success=1 indicates that val contains the value of
|
||||
{expr}; success=0 indicates a failure to evaluate
|
||||
the expression. '@x' returns the contents of register
|
||||
x, '&x' returns the value of option x, 'x' returns the
|
||||
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}.
|
||||
|
||||
*perl-SetHeight*
|
||||
Window->SetHeight({height})
|
||||
Sets the Window height to {height}, within screen
|
||||
limits.
|
||||
|
||||
*perl-GetCursor*
|
||||
Window->Cursor({row}?, {col}?)
|
||||
With no arguments, returns a (row, col) array for the
|
||||
current cursor position in the Window. With {row} and
|
||||
{col} arguments, sets the Window's cursor position to
|
||||
{row} and {col}. Note that {col} is numbered from 0,
|
||||
Perl-fashion, and thus is one less than the value in
|
||||
Vim's ruler.
|
||||
|
||||
Window->Buffer() *perl-Buffer*
|
||||
Returns the Buffer object corresponding to the given
|
||||
Window.
|
||||
|
||||
*perl-Name*
|
||||
Buffer->Name() Returns the filename for the Buffer.
|
||||
|
||||
*perl-Number*
|
||||
Buffer->Number() Returns the number of the Buffer.
|
||||
|
||||
*perl-Count*
|
||||
Buffer->Count() Returns the number of lines in the Buffer.
|
||||
|
||||
*perl-Get*
|
||||
Buffer->Get({lnum}, {lnum}?, ...)
|
||||
Returns a text string of line {lnum} in the Buffer
|
||||
for each {lnum} specified. An array can be passed
|
||||
with a list of {lnum}'s specified.
|
||||
|
||||
*perl-Delete*
|
||||
Buffer->Delete({lnum}, {lnum}?)
|
||||
Deletes line {lnum} in the Buffer. With the second
|
||||
{lnum}, deletes the range of lines from the first
|
||||
{lnum} to the second {lnum}.
|
||||
|
||||
*perl-Append*
|
||||
Buffer->Append({lnum}, {line}, {line}?, ...)
|
||||
Appends each {line} string after Buffer line {lnum}.
|
||||
The list of {line}s can be an array.
|
||||
|
||||
*perl-Set*
|
||||
Buffer->Set({lnum}, {line}, {line}?, ...)
|
||||
Replaces one or more Buffer lines with specified
|
||||
{lines}s, starting at Buffer line {lnum}. The list of
|
||||
{line}s can be an array. If the arguments are
|
||||
invalid, replacement does not occur.
|
||||
|
||||
$main::curwin
|
||||
The current window object.
|
||||
|
||||
$main::curbuf
|
||||
The current buffer object.
|
||||
|
||||
|
||||
*script-here*
|
||||
When using a script language in-line, you might want to skip this when the
|
||||
language isn't supported. But this mechanism doesn't work: >
|
||||
if has('perl')
|
||||
perl << EOF
|
||||
this will NOT work!
|
||||
EOF
|
||||
endif
|
||||
Instead, put the Perl/Python/Ruby/etc. command in a function and call that
|
||||
function: >
|
||||
if has('perl')
|
||||
function DefPerl()
|
||||
perl << EOF
|
||||
this works
|
||||
EOF
|
||||
endfunction
|
||||
call DefPerl()
|
||||
endif
|
||||
Note that "EOF" must be at the start of the line.
|
||||
-->
|
||||
|
||||
@@ -1,272 +0,0 @@
|
||||
*if_pyth.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
The Python Interface to Vim *python* *Python*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Commands |python-commands|
|
||||
2. The vim module |python-vim|
|
||||
3. Buffer objects |python-buffer|
|
||||
4. Range objects |python-range|
|
||||
5. Window objects |python-window|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
The Python interface is available only when Vim was compiled with the
|
||||
|+python| feature.
|
||||
|
||||
==============================================================================
|
||||
1. Commands *python-commands*
|
||||
|
||||
*:python* *:py* *E205* *E263* *E264*
|
||||
:[range]py[thon] {stmt}
|
||||
Execute Python statement {stmt}.
|
||||
|
||||
:[range]py[thon] << {endmarker}
|
||||
{script}
|
||||
{endmarker}
|
||||
Execute Python script {script}.
|
||||
Note: This command doesn't work when the Python
|
||||
feature wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||
omitted from after the "<<", a dot '.' must be used after {script}, like
|
||||
for the |:append| and |:insert| commands.
|
||||
This form of the |:python| command is mainly useful for including python code
|
||||
in Vim scripts.
|
||||
|
||||
Example: >
|
||||
function! IcecreamInitialize()
|
||||
python << EOF
|
||||
class StrawberryIcecream:
|
||||
def __call__(self):
|
||||
print 'EAT ME'
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
Note: Python is very sensitive to the indenting. Also make sure the "class"
|
||||
line and "EOF" do not have any indent.
|
||||
|
||||
*:pyfile* *:pyf*
|
||||
:[range]pyf[ile] {file} Execute the Python script in {file}.
|
||||
|
||||
Both of these commands do essentially the same thing - they execute a piece of
|
||||
Python code, with the "current range" |python-range| set to the given line
|
||||
range.
|
||||
|
||||
In the case of :python, the code to execute is in the command-line.
|
||||
In the case of :pyfile, the code to execute is the contents of the given file.
|
||||
|
||||
Python commands cannot be used in the |sandbox|.
|
||||
|
||||
Here are some examples *python-examples* >
|
||||
|
||||
:python from vim import *
|
||||
:python from string import upper
|
||||
:python current.line = upper(current.line)
|
||||
:python print "Hello"
|
||||
:python str = current.buffer[42]
|
||||
|
||||
(Note that changes - like the imports - persist from one command to the next,
|
||||
just like in the Python interpreter.)
|
||||
|
||||
==============================================================================
|
||||
2. The vim module *python-vim*
|
||||
|
||||
Python code gets all of its access to vim (with one exception - see
|
||||
|python-output| below) via the "vim" module. The vim module implements two
|
||||
methods, three constants, and one error object.
|
||||
|
||||
Overview >
|
||||
print "Hello" # displays a message
|
||||
vim.command(cmd) # execute an ex command
|
||||
w = vim.windows[n] # gets window "n"
|
||||
cw = vim.current.window # gets the current window
|
||||
b = vim.buffers[n] # gets buffer "n"
|
||||
cb = vim.current.buffer # gets the current buffer
|
||||
w.height = lines # sets the window height
|
||||
w.cursor = (row, col) # sets the window cursor position
|
||||
pos = w.cursor # gets a tuple (row, col)
|
||||
name = b.name # gets the buffer file name
|
||||
line = b[n] # gets a line from the buffer
|
||||
lines = b[n:m] # gets a list of lines
|
||||
num = len(b) # gets the number of lines
|
||||
b[n] = str # sets a line in the buffer
|
||||
b[n:m] = [str1, str2, str3] # sets a number of lines at once
|
||||
del b[n] # deletes a line
|
||||
del b[n:m] # deletes a number of lines
|
||||
|
||||
Methods
|
||||
vim.command(str) *python-command*
|
||||
Executes the vim (ex-mode) command str. Returns None.
|
||||
Examples: >
|
||||
vim.command("set tw=72")
|
||||
vim.command("%s/aaa/bbb/g")
|
||||
< The following definition executes Normal mode commands: >
|
||||
def normal(str):
|
||||
vim.command("normal "+str)
|
||||
# Note the use of single quotes to delimit a string containing
|
||||
# double quotes
|
||||
normal('"a2dd"aP')
|
||||
<
|
||||
vim.eval(str) *python-eval*
|
||||
Evaluates the expression str using the vim internal expression
|
||||
evaluator (see |expression|). Returns the expression result as a
|
||||
string.
|
||||
Examples: >
|
||||
text_width = vim.eval("&tw")
|
||||
str = vim.eval("12+12") # NB result is a string! Use
|
||||
# string.atoi() to convert to
|
||||
# a number.
|
||||
|
||||
Error object
|
||||
vim.error *python-error*
|
||||
Upon encountering a Vim error, Python raises an exception of type
|
||||
vim.error.
|
||||
Example: >
|
||||
try:
|
||||
vim.command("put a")
|
||||
except vim.error:
|
||||
# nothing in register a
|
||||
|
||||
Constants
|
||||
Note that these are not actually constants - you could reassign them.
|
||||
But this is silly, as you would then lose access to the vim objects
|
||||
to which the variables referred.
|
||||
|
||||
vim.buffers *python-buffers*
|
||||
A sequence object providing access to the list of vim buffers. The
|
||||
object supports the following operations: >
|
||||
b = vim.buffers[i] # Indexing (read-only)
|
||||
b in vim.buffers # Membership test
|
||||
n = len(vim.buffers) # Number of elements
|
||||
for b in vim.buffers: # Sequential access
|
||||
<
|
||||
vim.windows *python-windows*
|
||||
A sequence object providing access to the list of vim windows. The
|
||||
object supports the following operations: >
|
||||
w = vim.windows[i] # Indexing (read-only)
|
||||
w in vim.windows # Membership test
|
||||
n = len(vim.windows) # Number of elements
|
||||
for w in vim.windows: # Sequential access
|
||||
<
|
||||
vim.current *python-current*
|
||||
An object providing access (via specific attributes) to various
|
||||
"current" objects available in vim:
|
||||
vim.current.line The current line (RW) String
|
||||
vim.current.buffer The current buffer (RO) Buffer
|
||||
vim.current.window The current window (RO) Window
|
||||
vim.current.range The current line range (RO) Range
|
||||
|
||||
The last case deserves a little explanation. When the :python or
|
||||
:pyfile command specifies a range, this range of lines becomes the
|
||||
"current range". A range is a bit like a buffer, but with all access
|
||||
restricted to a subset of lines. See |python-range| for more details.
|
||||
|
||||
Output from Python *python-output*
|
||||
Vim displays all Python code output in the Vim message area. Normal
|
||||
output appears as information messages, and error output appears as
|
||||
error messages.
|
||||
|
||||
In implementation terms, this means that all output to sys.stdout
|
||||
(including the output from print statements) appears as information
|
||||
messages, and all output to sys.stderr (including error tracebacks)
|
||||
appears as error messages.
|
||||
|
||||
*python-input*
|
||||
Input (via sys.stdin, including input() and raw_input()) is not
|
||||
supported, and may cause the program to crash. This should probably be
|
||||
fixed.
|
||||
|
||||
==============================================================================
|
||||
3. Buffer objects *python-buffer*
|
||||
|
||||
Buffer objects represent vim buffers. You can obtain them in a number of ways:
|
||||
- via vim.current.buffer (|python-current|)
|
||||
- from indexing vim.buffers (|python-buffers|)
|
||||
- from the "buffer" attribute of a window (|python-window|)
|
||||
|
||||
Buffer objects have one read-only attribute - name - the full file name for
|
||||
the buffer. They also have three methods (append, mark, and range; see below).
|
||||
|
||||
You can also treat buffer objects as sequence objects. In this context, they
|
||||
act as if they were lists (yes, they are mutable) of strings, with each
|
||||
element being a line of the buffer. All of the usual sequence operations,
|
||||
including indexing, index assignment, slicing and slice assignment, work as
|
||||
you would expect. Note that the result of indexing (slicing) a buffer is a
|
||||
string (list of strings). This has one unusual consequence - b[:] is different
|
||||
from b. In particular, "b[:] = None" deletes the whole of the buffer, whereas
|
||||
"b = None" merely updates the variable b, with no effect on the buffer.
|
||||
|
||||
Buffer indexes start at zero, as is normal in Python. This differs from vim
|
||||
line numbers, which start from 1. This is particularly relevant when dealing
|
||||
with marks (see below) which use vim line numbers.
|
||||
|
||||
The buffer object methods are:
|
||||
b.append(str) Append a line to the buffer
|
||||
b.append(list) Append a list of lines to the buffer
|
||||
Note that the option of supplying a list of strings to
|
||||
the append method differs from the equivalent method
|
||||
for Python's built-in list objects.
|
||||
b.mark(name) Return a tuple (row,col) representing the position
|
||||
of the named mark (can also get the []"<> marks)
|
||||
b.range(s,e) Return a range object (see |python-range|) which
|
||||
represents the part of the given buffer between line
|
||||
numbers s and e (inclusive).
|
||||
|
||||
Examples (assume b is the current buffer) >
|
||||
print b.name # write the buffer file name
|
||||
b[0] = "hello!!!" # replace the top line
|
||||
b[:] = None # delete the whole buffer
|
||||
del b[:] # delete the whole buffer (same as above)
|
||||
b[0:0] = [ "a line" ] # add a line at the top
|
||||
del b[2] # delete a line (the third)
|
||||
b.append("bottom") # add a line at the bottom
|
||||
n = len(b) # number of lines
|
||||
(row,col) = b.mark('a') # named mark
|
||||
r = b.range(1,5) # a sub-range of the buffer
|
||||
|
||||
==============================================================================
|
||||
4. Range objects *python-range*
|
||||
|
||||
Range objects represent a part of a vim buffer. You can obtain them in a
|
||||
number of ways:
|
||||
- via vim.current.range (|python-current|)
|
||||
- from a buffer's range() method (|python-buffer|)
|
||||
|
||||
A range object is almost identical in operation to a buffer object. However,
|
||||
all operations are restricted to the lines within the range (this line range
|
||||
can, of course, change as a result of slice assignments, line deletions, or
|
||||
the range.append() method).
|
||||
|
||||
Unlike buffers, ranges do not have a "name" attribute, nor do they have mark()
|
||||
or range() methods. They do have an append() method, however, which adds
|
||||
line(s) to the end of the range.
|
||||
|
||||
==============================================================================
|
||||
5. Window objects *python-window*
|
||||
|
||||
Window objects represent vim windows. You can obtain them in a number of ways:
|
||||
- via vim.current.window (|python-current|)
|
||||
- from indexing vim.windows (|python-windows|)
|
||||
|
||||
You can manipulate window objects only through their attributes. They have no
|
||||
methods, and no sequence or other interface.
|
||||
|
||||
Window attributes are:
|
||||
buffer (read-only) The buffer displayed in this window
|
||||
cursor (read-write) The current cursor position in the window
|
||||
This is a tuple, (row,col).
|
||||
height (read-write) The window height, in rows
|
||||
width (read-write) The window width, in columns
|
||||
The height attribute is writable only if the screen is split horizontally.
|
||||
The width attribute is writable only if the screen is split vertically.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
*if_ruby.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
The Ruby Interface to Vim *ruby* *Ruby*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
|
||||
1. Commands |ruby-commands|
|
||||
2. The VIM module |ruby-vim|
|
||||
3. VIM::Buffer objects |ruby-buffer|
|
||||
4. VIM::Window objects |ruby-window|
|
||||
5. Global variables |ruby-globals|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
*E266* *E267* *E268* *E269* *E270* *E271* *E272* *E273*
|
||||
|
||||
The Ruby interface only works when Vim was compiled with the |+ruby| feature.
|
||||
|
||||
For MS-Windows you might find a Ruby library here:
|
||||
|
||||
http://www.dm4lab.to/~usa/ruby_en.html
|
||||
|
||||
==============================================================================
|
||||
1. Commands *ruby-commands*
|
||||
|
||||
*:ruby* *:rub*
|
||||
:rub[y] {cmd} Execute Ruby command {cmd}.
|
||||
|
||||
:rub[y] << {endpattern}
|
||||
{script}
|
||||
{endpattern}
|
||||
Execute Ruby script {script}.
|
||||
{endpattern} must NOT be preceded by any white space.
|
||||
If {endpattern} is omitted, it defaults to a dot '.'
|
||||
like for the |:append| and |:insert| commands. This
|
||||
form of the |:ruby| command is mainly useful for
|
||||
including ruby code in vim scripts.
|
||||
Note: This command doesn't work when the Ruby feature
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
Example Vim script: >
|
||||
|
||||
function! RedGem()
|
||||
ruby << EOF
|
||||
class Garnet
|
||||
def initialize(s)
|
||||
@buffer = VIM::Buffer.current
|
||||
vimputs(s)
|
||||
end
|
||||
def vimputs(s)
|
||||
@buffer.append(@buffer.count,s)
|
||||
end
|
||||
end
|
||||
gem = Garnet.new("pretty")
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
|
||||
*:rubydo* *:rubyd* *E265*
|
||||
:[range]rubyd[o] {cmd} Evaluate Ruby command {cmd} for each line in the
|
||||
[range], with $_ being set to the text of each line in
|
||||
turn, without a trailing <EOL>. Setting $_ will change
|
||||
the text, but note that it is not possible to add or
|
||||
delete lines using this command.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
|
||||
*:rubyfile* *:rubyf*
|
||||
:rubyf[ile] {file} Execute the Ruby script in {file}. This is the same as
|
||||
":ruby load 'file'", but allows file name completion.
|
||||
|
||||
Executing Ruby commands is not possible in the |sandbox|.
|
||||
|
||||
==============================================================================
|
||||
2. The VIM module *ruby-vim*
|
||||
|
||||
Ruby code gets all of its access to vim via the "VIM" module.
|
||||
|
||||
Overview >
|
||||
print "Hello" # displays a message
|
||||
VIM.command(cmd) # execute an ex command
|
||||
num = VIM::Window.count # gets the number of windows
|
||||
w = VIM::Window[n] # gets window "n"
|
||||
cw = VIM::Window.current # gets the current window
|
||||
num = VIM::Buffer.count # gets the number of buffers
|
||||
b = VIM::Buffer[n] # gets buffer "n"
|
||||
cb = VIM::Buffer.current # gets the current buffer
|
||||
w.height = lines # sets the window height
|
||||
w.cursor = [row, col] # sets the window cursor position
|
||||
pos = w.cursor # gets an array [row, col]
|
||||
name = b.name # gets the buffer file name
|
||||
line = b[n] # gets a line from the buffer
|
||||
num = b.count # gets the number of lines
|
||||
b[n] = str # sets a line in the buffer
|
||||
b.delete(n) # deletes a line
|
||||
b.append(n, str) # appends a line after n
|
||||
<
|
||||
|
||||
Module Functions:
|
||||
|
||||
*ruby-message*
|
||||
VIM::message({msg})
|
||||
Displays the message {msg}.
|
||||
|
||||
*ruby-set_option*
|
||||
VIM::set_option({arg})
|
||||
Sets a vim option. {arg} can be any argument that the ":set" command
|
||||
accepts. Note that this means that no spaces are allowed in the
|
||||
argument! See |:set|.
|
||||
|
||||
*ruby-command*
|
||||
VIM::command({cmd})
|
||||
Executes Ex command {cmd}.
|
||||
|
||||
*ruby-evaluate*
|
||||
VIM::evaluate({expr})
|
||||
Evaluates {expr} using the vim internal expression evaluator (see
|
||||
|expression|). Returns the expression result as a string.
|
||||
|
||||
==============================================================================
|
||||
3. VIM::Buffer objects *ruby-buffer*
|
||||
|
||||
VIM::Buffer objects represent vim buffers.
|
||||
|
||||
Class Methods:
|
||||
|
||||
current Returns the current buffer object.
|
||||
count Returns the number of buffers.
|
||||
self[{n}] Returns the buffer object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
|
||||
name Returns the name of the buffer.
|
||||
number Returns the number of the buffer.
|
||||
count Returns the number of lines.
|
||||
length Returns the number of lines.
|
||||
self[{n}] Returns a line from the buffer. {n} is the line number.
|
||||
self[{n}] = {str}
|
||||
Sets a line in the buffer. {n} is the line number.
|
||||
delete({n}) Deletes a line from the buffer. {n} is the line number.
|
||||
append({n}, {str})
|
||||
Appends a line after the line {n}.
|
||||
|
||||
==============================================================================
|
||||
4. VIM::Window objects *ruby-window*
|
||||
|
||||
VIM::Window objects represent vim windows.
|
||||
|
||||
Class Methods:
|
||||
|
||||
current Returns the current window object.
|
||||
count Returns the number of windows.
|
||||
self[{n}] Returns the window object for the number {n}. The first number
|
||||
is 0.
|
||||
|
||||
Methods:
|
||||
|
||||
buffer Returns the buffer displayed in the window.
|
||||
height Returns the height of the window.
|
||||
height = {n} Sets the window height to {n}.
|
||||
cursor Returns a [row, col] array for the cursor position.
|
||||
cursor = [{row}, {col}]
|
||||
Sets the cursor position to {row} and {col}.
|
||||
|
||||
==============================================================================
|
||||
4. Global variables *ruby-globals*
|
||||
|
||||
There are two global variables.
|
||||
|
||||
$curwin The current window object.
|
||||
$curbuf The current buffer object.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,95 +0,0 @@
|
||||
*if_sniff.txt* For IdeaVim version @VERSON@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
SNiFF+ and Vim *sniff*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Introduction |sniff-intro|
|
||||
2. Commands |sniff-commands|
|
||||
3. Compiling Vim with SNiFF+ interface |sniff-compiling|
|
||||
|
||||
{Vi does not have any of these commands} *E275* *E274* *E276* *E278* *E279*
|
||||
|
||||
The SNiFF+ interface only works, when Vim was compiled with the |+sniff|
|
||||
feature.
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sniff-intro*
|
||||
|
||||
The following features for the use with SNiFF+ are available:
|
||||
|
||||
* Vim can be used for all editing requests
|
||||
* SNiFF+ recognizes and updates all browsers when a file is saved in Vim
|
||||
* SNiFF+ commands can be issued directly from Vim
|
||||
|
||||
How to use Vim with SNiFF+
|
||||
1. Make sure SNiFF+ is running.
|
||||
2. In the Editor view of the Preferences dialog set the Field named
|
||||
'External Editor' to 'Emacs/Vim'.
|
||||
4. Start Vim
|
||||
5. Connect to SNiFF+ (:sniff connect)
|
||||
|
||||
Once a connection is established, SNiFF+ uses Vim for all requests to show or
|
||||
edit source code. On the other hand, you can send queries to SNiFF+ with the
|
||||
:sniff command.
|
||||
|
||||
==============================================================================
|
||||
2. Commands *sniff-commands*
|
||||
|
||||
*:sniff* *:sni*
|
||||
:sni[ff] request [symbol] Send request to sniff with optional symbol.
|
||||
:sni[ff] Display all possible requests and the connection
|
||||
status
|
||||
|
||||
Most requests require a symbol (identifier) as parameter. If it is omitted,
|
||||
Vim will use the current word under the cursor.
|
||||
The available requests are listed below:
|
||||
|
||||
request mapping description
|
||||
-------------------------------------------------------------------------------
|
||||
connect sc Establish connection with SNiFF+.
|
||||
Make sure SNiFF+ is prepared for this in the
|
||||
Preferences
|
||||
disconnect sq Disconnect from SNiFF+. You can reconnect any
|
||||
time with :sniff connect (or 'sc')
|
||||
toggle st Toggle between implementation
|
||||
and definition file
|
||||
find-symbol sf Load the symbol into a Symbol Browser
|
||||
browse-class sb Loads the class into a Class Browser
|
||||
superclass ss Edit superclass of symbol
|
||||
overridden so Edit overridden method of symbol
|
||||
retrieve-file srf Retrieve symbol in current file
|
||||
retrieve-project srp Retrieve symbol in current project
|
||||
retrieve-all-projects srP Retrieve symbol in all projects
|
||||
retrieve-next sR Retrieve symbol using current Retriever
|
||||
settings
|
||||
goto-symbol sg Goto definition or implementation of symbol
|
||||
hierarchy sh Load symbol into the Hierarchy Browser
|
||||
restr-hier sH same as above but show only related classes
|
||||
xref-to sxt Start a refers-to query on symbol and
|
||||
load the results into the Cross Referencer
|
||||
xref-by sxb Start a referred-by query on symbol
|
||||
xref-has sxh Start a refers-to components query on symbol
|
||||
xref-used-by sxu Start a referred-by as component query on
|
||||
symbol
|
||||
show-docu sd Show documentation of symbol
|
||||
gen-docu sD Generate documentation of symbol
|
||||
|
||||
The mappings are defined in a file 'sniff.vim', which is part of every SNiFF+
|
||||
product ($SNIFF_DIR/config/sniff.vim). This file is sourced whenever Vim
|
||||
connects to SNiFF+.
|
||||
|
||||
==============================================================================
|
||||
3. Compiling Vim with SNiFF+ interface *sniff-compiling*
|
||||
|
||||
To compile Vim with SNiFF+ support, you need two source files of the extra
|
||||
archive: if_sniff.c and if_sniff.h.
|
||||
On Unix: Edit the Makefile and uncomment the line "--enable-sniff". Or run
|
||||
configure manually with this argument.
|
||||
On NT: Specify SNIFF=yes with your make command.
|
||||
-->
|
||||
|
||||
@@ -1,514 +0,0 @@
|
||||
*if_tcl.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
The Tcl Interface to Vim *tcl* *Tcl* *TCL*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Commands |tcl-ex-commands|
|
||||
2. Tcl commands |tcl-commands|
|
||||
3. Tcl variables |tcl-variables|
|
||||
4. Tcl window commands |tcl-window-cmds|
|
||||
5. Tcl buffer commands |tcl-buffer-cmds|
|
||||
6. Miscellaneous; Output from Tcl |tcl-misc| |tcl-output|
|
||||
7. Known bugs & problems |tcl-bugs|
|
||||
8. Examples |tcl-examples|
|
||||
|
||||
{Vi does not have any of these commands} *E280* *E281*
|
||||
|
||||
The Tcl interface only works when Vim was compiled with the |+tcl| feature.
|
||||
|
||||
WARNING: There are probably still some bugs. Please send bug reports,
|
||||
comments, ideas etc to <Ingo.Wilken@informatik.uni-oldenburg.de>
|
||||
|
||||
==============================================================================
|
||||
1. Commands *tcl-ex-commands* *E571* *E572*
|
||||
|
||||
*:tcl* *:tc*
|
||||
:tc[l] {cmd} Execute Tcl command {cmd}.
|
||||
|
||||
:[range]tc[l] << {endmarker}
|
||||
{script}
|
||||
{endmarker}
|
||||
Execute Tcl script {script}.
|
||||
Note: This command doesn't work when the Tcl feature
|
||||
wasn't compiled in. To avoid errors, see
|
||||
|script-here|.
|
||||
|
||||
{endmarker} must NOT be preceded by any white space. If {endmarker} is
|
||||
omitted from after the "<<", a dot '.' must be used after {script}, like for
|
||||
the |:append| and |:insert| commands.
|
||||
This form of the |:tcl| command is mainly useful for including tcl code in Vim
|
||||
scripts.
|
||||
|
||||
Example: >
|
||||
function! DefineDate()
|
||||
tcl << EOF
|
||||
proc date {} {
|
||||
return [clock format [clock seconds]]
|
||||
}
|
||||
EOF
|
||||
endfunction
|
||||
<
|
||||
|
||||
*:tcldo* *:tcld*
|
||||
:[range]tcld[o] {cmd} Execute Tcl command {cmd} for each line in [range]
|
||||
with the variable "line" being set to the text of each
|
||||
line in turn, and "lnum" to the line number. Setting
|
||||
"line" will change the text, but note that it is not
|
||||
possible to add or delete lines using this command.
|
||||
If {cmd} returns an error, the command is interrupted.
|
||||
The default for [range] is the whole file: "1,$".
|
||||
See |tcl-var-line| and |tcl-var-lnum|.
|
||||
|
||||
*:tclfile* *:tclf*
|
||||
:tclf[ile] {file} Execute the Tcl script in {file}. This is the same as
|
||||
":tcl source {file}", but allows file name completion.
|
||||
|
||||
|
||||
Note that Tcl objects (like variables) persist from one command to the next,
|
||||
just as in the Tcl shell.
|
||||
|
||||
Executing Tcl commands is not possible in the |sandbox|.
|
||||
|
||||
==============================================================================
|
||||
2. Tcl commands *tcl-commands*
|
||||
|
||||
Tcl code gets all of its access to vim via commands in the "::vim" namespace.
|
||||
The following commands are implemented: >
|
||||
|
||||
::vim::beep # Guess.
|
||||
::vim::buffer {n} # Create Tcl command for one buffer.
|
||||
::vim::buffer list # Create Tcl commands for all buffers.
|
||||
::vim::command [-quiet] {cmd} # Execute an ex command.
|
||||
::vim::expr {expr} # Use Vim's expression evaluator.
|
||||
::vim::option {opt} # Get vim option.
|
||||
::vim::option {opt} {val} # Set vim option.
|
||||
::vim::window list # Create Tcl commands for all windows.
|
||||
|
||||
Commands:
|
||||
::vim::beep *tcl-beep*
|
||||
Honk. Does not return a result.
|
||||
|
||||
::vim::buffer {n} *tcl-buffer*
|
||||
::vim::buffer exists {n}
|
||||
::vim::buffer list
|
||||
Provides access to vim buffers. With an integer argument, creates a
|
||||
buffer command (see |tcl-buffer-cmds|) for the buffer with that
|
||||
number, and returns its name as the result. Invalid buffer numbers
|
||||
result in a standard Tcl error. To test for valid buffer numbers,
|
||||
vim's internal functions can be used: >
|
||||
set nbufs [::vim::expr bufnr("$")]
|
||||
set isvalid [::vim::expr "bufexists($n)"]
|
||||
< The "list" option creates a buffer command for each valid buffer, and
|
||||
returns a list of the command names as the result.
|
||||
Example: >
|
||||
set bufs [::vim::buffer list]
|
||||
foreach b $bufs { $b append end "The End!" }
|
||||
< The "exists" option checks if a buffer with the given number exists.
|
||||
Example: >
|
||||
if { [::vim::buffer exists $n] } { ::vim::command ":e #$n" }
|
||||
< This command might be replaced by a variable in future versions.
|
||||
See also |tcl-var-current| for the current buffer.
|
||||
|
||||
::vim::command {cmd} *tcl-command*
|
||||
::vim::command -quiet {cmd}
|
||||
Execute the vim (ex-mode) command {cmd}. Any ex command that affects
|
||||
a buffer or window uses the current buffer/current window. Does not
|
||||
return a result other than a standard Tcl error code. After this
|
||||
command is completed, the "::vim::current" variable is updated.
|
||||
The "-quiet" flag suppresses any error messages from vim.
|
||||
Examples: >
|
||||
::vim::command "set ts=8"
|
||||
::vim::command "%s/foo/bar/g"
|
||||
< To execute normal-mode commands, use "normal" (see |:normal|): >
|
||||
set cmd "jj"
|
||||
::vim::command "normal $cmd"
|
||||
< See also |tcl-window-command| and |tcl-buffer-command|.
|
||||
|
||||
::vim::expr {expr} *tcl-expr*
|
||||
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.
|
||||
Examples: >
|
||||
set perl_available [::vim::expr has("perl")]
|
||||
< See also |tcl-window-expr| and |tcl-buffer-expr|.
|
||||
|
||||
::vim::option {opt} *tcl-option*
|
||||
::vim::option {opt} {value}
|
||||
Without second argument, queries the value of a vim option. With this
|
||||
argument, sets the vim option to {value}, and returns the previous
|
||||
value as the result. Any options that are marked as 'local to buffer'
|
||||
or 'local to window' affect the current buffer/current window. The
|
||||
global value is not changed, use the ":set" command for that. For
|
||||
boolean options, {value} should be "0" or "1", or any of the keywords
|
||||
"on", "off" or "toggle". See |option-summary| for a list of options.
|
||||
Example: >
|
||||
::vim::option ts 8
|
||||
< See also |tcl-window-option| and |tcl-buffer-option|.
|
||||
|
||||
::vim::window {option} *tcl-window*
|
||||
Provides access to vim windows. Currently only the "list" option is
|
||||
implemented. This creates a window command (see |tcl-window-cmds|) for
|
||||
each window, and returns a list of the command names as the result.
|
||||
Example: >
|
||||
set wins [::vim::window list]
|
||||
foreach w $wins { $w height 4 }
|
||||
< This command might be replaced by a variable in future versions.
|
||||
See also |tcl-var-current| for the current window.
|
||||
|
||||
==============================================================================
|
||||
3. Tcl variables *tcl-variables*
|
||||
|
||||
The ::vim namespace contains a few variables. These are created when the Tcl
|
||||
interpreter is called from vim and set to current values. >
|
||||
|
||||
::vim::current # array containing "current" objects
|
||||
::vim::lbase # number of first line
|
||||
::vim::range # array containing current range numbers
|
||||
line # current line as a string (:tcldo only)
|
||||
lnum # current line number (:tcldo only)
|
||||
|
||||
Variables:
|
||||
::vim::current *tcl-var-current*
|
||||
This is an array providing access to various "current" objects
|
||||
available in vim. The contents of this array are updated after
|
||||
"::vim::command" is called, as this might change vim's current
|
||||
settings (e.g., by deleting the current buffer).
|
||||
The "buffer" element contains the name of the buffer command for the
|
||||
current buffer. This can be used directly to invoke buffer commands
|
||||
(see |tcl-buffer-cmds|). This element is read-only.
|
||||
Example: >
|
||||
$::vim::current(buffer) insert begin "Hello world"
|
||||
< The "window" element contains the name of the window command for the
|
||||
current window. This can be used directly to invoke window commands
|
||||
(see |tcl-window-cmds|). This element is read-only.
|
||||
Example: >
|
||||
$::vim::current(window) height 10
|
||||
<
|
||||
::vim::lbase *tcl-var-lbase*
|
||||
This variable controls how Tcl treats line numbers. If it is set to
|
||||
'1', then lines and columns start at 1. This way, line numbers from
|
||||
Tcl commands and vim expressions are compatible. If this variable is
|
||||
set to '0', then line numbers and columns start at 0 in Tcl. This is
|
||||
useful if you want to treat a buffer as a Tcl list or a line as a Tcl
|
||||
string and use standard Tcl commands that return an index ("lsort" or
|
||||
"string first", for example). The default value is '1'. Currently,
|
||||
any non-zero values is treated as '1', but your scripts should not
|
||||
rely on this. See also |tcl-linenumbers|.
|
||||
|
||||
::vim::range *tcl-var-range*
|
||||
This is an array with three elements, "start", "begin" end "end". It
|
||||
contains the line numbers of the start and end row of the current
|
||||
range. "begin" is the same as "start". This variable is read-only.
|
||||
See |tcl-examples|.
|
||||
|
||||
line *tcl-var-line*
|
||||
lnum *tcl-var-lnum*
|
||||
These global variables are only available if the ":tcldo" ex command
|
||||
is being executed. They contain the text and line number of the
|
||||
current line. When the Tcl command invoked by ":tcldo" is completed,
|
||||
the current line is set to the contents of the "line" variable, unless
|
||||
the variable was unset by the Tcl command. The "lnum" variable is
|
||||
read-only. These variables are not in the "::vim" namespace so they
|
||||
can be used in ":tcldo" without much typing (this might be changed in
|
||||
future versions). See also |tcl-linenumbers|.
|
||||
|
||||
==============================================================================
|
||||
4. Tcl window commands *tcl-window-cmds*
|
||||
|
||||
Window commands represent vim windows. They are created by several commands:
|
||||
::vim::window list |tcl-window|
|
||||
"windows" option of a buffer command |tcl-buffer-windows|
|
||||
The ::vim::current(window) variable contains the name of the window command
|
||||
for the current window. A window command is automatically deleted when the
|
||||
corresponding vim window is closed.
|
||||
|
||||
Lets assume the name of the window command is stored in the Tcl variable "win",
|
||||
i.e. "$win" calls the command. The following options are available: >
|
||||
|
||||
$win buffer # Create Tcl command for window's buffer.
|
||||
$win command {cmd} # Execute ex command in windows context.
|
||||
$win cursor # Get current cursor position.
|
||||
$win cursor {var} # Set cursor position from array variable.
|
||||
$win cursor {row} {col} # Set cursor position.
|
||||
$win delcmd {cmd} # Call Tcl command when window is closed.
|
||||
$win expr {expr} # Evaluate vim expression in windows context.
|
||||
$win height # Report the window's height.
|
||||
$win height {n} # Set the window's height.
|
||||
$win option {opt} [val] # Get/Set vim option in windows context.
|
||||
|
||||
Options:
|
||||
$win buffer *tcl-window-buffer*
|
||||
Creates a Tcl command for the window's buffer, and returns its name as
|
||||
the result. The name should be stored in a variable: >
|
||||
set buf [$win buffer]
|
||||
< $buf is now a valid Tcl command. See |tcl-buffer-cmds| for the
|
||||
available options.
|
||||
|
||||
$win cursor *tcl-window-cursor*
|
||||
$win cursor {var}
|
||||
$win cursor {row} {col}
|
||||
Without argument, reports the current cursor position as a string.
|
||||
This can be converted to a Tcl array variable: >
|
||||
array set here [$win cursor]
|
||||
< "here(row)" and "here(column)" now contain the cursor position.
|
||||
With a single argument, the argument is interpreted as the name of a
|
||||
Tcl array variable, which must contain two elements "row" and "column".
|
||||
These are used to set the cursor to the new position: >
|
||||
$win cursor here ;# not $here !
|
||||
< With two arguments, sets the cursor to the specified row and colum: >
|
||||
$win cursor $here(row) $here(column)
|
||||
< Invalid positions result in a standard Tcl error, which can be caught
|
||||
with "catch". The row and column values depend on the "::vim::lbase"
|
||||
variable. See |tcl-var-lbase|.
|
||||
|
||||
$win delcmd {cmd} *tcl-window-delcmd*
|
||||
Registers the Tcl command {cmd} as a deletion callback for the window.
|
||||
This command is executed (in the global scope) just before the window
|
||||
is closed. Complex commands should be build with "list": >
|
||||
$win delcmd [list puts vimerr "window deleted"]
|
||||
< See also |tcl-buffer-delcmd|.
|
||||
|
||||
$win height *tcl-window-height*
|
||||
$win height {n}
|
||||
Without argument, reports the window's current height. With an
|
||||
argument, tries to set the window's height to {n}, then reports the
|
||||
new height (which might be different from {n}).
|
||||
|
||||
$win command [-quiet] {cmd} *tcl-window-command*
|
||||
$win expr {expr} *tcl-window-expr*
|
||||
$win option {opt} [val] *tcl-window-option*
|
||||
These are similar to "::vim::command" etc., except that everything is
|
||||
done in the context of the window represented by $win, instead of the
|
||||
current window. For example, setting an option that is marked 'local
|
||||
to window' affects the window $win. Anything that affects or queries
|
||||
a buffer uses the buffer displayed in this window (i.e. the buffer
|
||||
that is represented by "$win buffer"). See |tcl-command|, |tcl-expr|
|
||||
and |tcl-option| for more information.
|
||||
Example: >
|
||||
$win option number on
|
||||
|
||||
==============================================================================
|
||||
5. Tcl buffer commands *tcl-buffer-cmds*
|
||||
|
||||
Buffer commands represent vim buffers. They are created by several commands:
|
||||
::vim::buffer {N} |tcl-buffer|
|
||||
::vim::buffer list |tcl-buffer|
|
||||
"buffer" option of a window command |tcl-window-buffer|
|
||||
The ::vim::current(buffer) variable contains the name of the buffer command
|
||||
for the current buffer. A buffer command is automatically deleted when the
|
||||
corresponding vim buffer is destroyed. Whenever the buffer's contents are
|
||||
changed, all marks in the buffer are automatically adjusted. Any changes to
|
||||
the buffer's contents made by Tcl commands can be undone with the "undo" vim
|
||||
command (see |undo|).
|
||||
|
||||
Lets assume the name of the buffer command is stored in the Tcl variable "buf",
|
||||
i.e. "$buf" calls the command. The following options are available: >
|
||||
|
||||
$buf append {n} {str} # Append a line to buffer, after line {n}.
|
||||
$buf command {cmd} # Execute ex command in buffers context.
|
||||
$buf count # Report number of lines in buffer.
|
||||
$buf delcmd {cmd} # Call Tcl command when buffer is deleted.
|
||||
$buf delete {n} # Delete a single line.
|
||||
$buf delete {n} {m} # Delete several lines.
|
||||
$buf expr {expr} # Evaluate vim expression in buffers context.
|
||||
$buf get {n} # Get a single line as a string.
|
||||
$buf get {n} {m} # Get several lines as a list.
|
||||
$buf insert {n} {str} # Insert a line in buffer, as line {n}.
|
||||
$buf last # Report line number of last line in buffer.
|
||||
$buf mark {mark} # Report position of buffer mark.
|
||||
$buf name # Report name of file in buffer.
|
||||
$buf number # Report number of this buffer.
|
||||
$buf option {opt} [val] # Get/Set vim option in buffers context.
|
||||
$buf set {n} {text} # Replace a single line.
|
||||
$buf set {n} {m} {list} # Replace several lines.
|
||||
$buf windows # Create Tcl commands for buffer's windows.
|
||||
<
|
||||
*tcl-linenumbers*
|
||||
Most buffer commands take line numbers as arguments. How Tcl treats these
|
||||
numbers depends on the "::vim::lbase" variable (see |tcl-var-lbase|). Instead
|
||||
of line numbers, several keywords can be also used: "top", "start", "begin",
|
||||
"first", "bottom", "end" and "last".
|
||||
|
||||
Options:
|
||||
$buf append {n} {str} *tcl-buffer-append*
|
||||
$buf insert {n} {str} *tcl-buffer-insert*
|
||||
Add a line to the buffer. With the "insert" option, the string
|
||||
becomes the new line {n}, with "append" it is inserted after line {n}.
|
||||
Example: >
|
||||
$buf insert top "This is the beginning."
|
||||
$buf append end "This is the end."
|
||||
< To add a list of lines to the buffer, use a loop: >
|
||||
foreach line $list { $buf append $num $line ; incr num }
|
||||
<
|
||||
$buf count *tcl-buffer-count*
|
||||
Reports the total number of lines in the buffer.
|
||||
|
||||
$buf delcmd {cmd} *tcl-buffer-delcmd*
|
||||
Registers the Tcl command {cmd} as a deletion callback for the buffer.
|
||||
This command is executed (in the global scope) just before the buffer
|
||||
is deleted. Complex commands should be build with "list": >
|
||||
$buf delcmd [list puts vimerr "buffer [$buf number] gone"]
|
||||
< See also |tcl-window-delcmd|.
|
||||
|
||||
$buf delete {n} *tcl-buffer-delete*
|
||||
$buf delete {n} {m}
|
||||
Deletes line {n} or lines {n} through {m} from the buffer.
|
||||
This example deletes everything except the last line: >
|
||||
$buf delete first [expr [$buf last] - 1]
|
||||
<
|
||||
$buf get {n} *tcl-buffer-get*
|
||||
$buf get {n} {m}
|
||||
Gets one or more lines from the buffer. For a single line, the result
|
||||
is a string; for several lines, a list of strings.
|
||||
Example: >
|
||||
set topline [$buf get top]
|
||||
<
|
||||
$buf last *tcl-buffer-last*
|
||||
Reports the line number of the last line. This value depends on the
|
||||
"::vim::lbase" variable. See |tcl-var-lbase|.
|
||||
|
||||
$buf mark {mark} *tcl-buffer-mark*
|
||||
Reports the position of the named mark as a string, similar to the
|
||||
cursor position of the "cursor" option of a window command (see
|
||||
|tcl-window-cursor|). This can be converted to a Tcl array variable: >
|
||||
array set mpos [$buf mark "a"]
|
||||
< "mpos(column)" and "mpos(row)" now contain the position of the mark.
|
||||
If the mark is not set, a standard Tcl error results.
|
||||
|
||||
$buf name
|
||||
Reports the name of the file in the buffer. For a buffer without a
|
||||
file, this is an empty string.
|
||||
|
||||
$buf number
|
||||
Reports the number of this buffer. See |:buffers|.
|
||||
This example deletes a buffer from vim: >
|
||||
::vim::command "bdelete [$buf number]"
|
||||
<
|
||||
$buf set {n} {string} *tcl-buffer-set*
|
||||
$buf set {n} {m} {list}
|
||||
Replace one or several lines in the buffer. If the list contains more
|
||||
elements than there are lines to replace, they are inserted into the
|
||||
buffer. If the list contains fewer elements, any unreplaced line is
|
||||
deleted from the buffer.
|
||||
|
||||
$buf windows *tcl-buffer-windows*
|
||||
Creates a window command for each window that displays this buffer, and
|
||||
returns a list of the command names as the result.
|
||||
Example: >
|
||||
set winlist [$buf windows]
|
||||
foreach win $winlist { $win height 4 }
|
||||
< See |tcl-window-cmds| for the available options.
|
||||
|
||||
$buf command [-quiet] {cmd} *tcl-buffer-command*
|
||||
$buf expr {exr} *tcl-buffer-expr*
|
||||
$buf option {opt} [val] *tcl-buffer-option*
|
||||
These are similar to "::vim::command" etc., except that everything is
|
||||
done in the context of the buffer represented by $buf, instead of the
|
||||
current buffer. For example, setting an option that is marked 'local
|
||||
to buffer' affects the buffer $buf. Anything that affects or queries
|
||||
a window uses the first window in vim's window list that displays this
|
||||
buffer (i.e. the first entry in the list returned by "$buf windows").
|
||||
See |tcl-command|, |tcl-expr| and |tcl-option| for more information.
|
||||
Example: >
|
||||
if { [$buf option modified] } { $buf command "w" }
|
||||
|
||||
==============================================================================
|
||||
6. Miscellaneous; Output from Tcl *tcl-misc* *tcl-output*
|
||||
|
||||
The standard Tcl commands "exit" and "catch" are replaced by custom versions.
|
||||
"exit" terminates the current Tcl script and returns to vim, which deletes the
|
||||
Tcl interpreter. Another call to ":tcl" then creates a new Tcl interpreter.
|
||||
"exit" does NOT terminate vim! "catch" works as before, except that it does
|
||||
not prevent script termination from "exit". An exit code != 0 causes the ex
|
||||
command that invoked the Tcl script to return an error.
|
||||
|
||||
Two new I/O streams are available in Tcl, "vimout" and "vimerr". All output
|
||||
directed to them is displayed in the vim message area, as information messages
|
||||
and error messages, respectively. The standard Tcl output streams stdout and
|
||||
stderr are mapped to vimout and vimerr, so that a normal "puts" command can be
|
||||
used to display messages in vim.
|
||||
|
||||
==============================================================================
|
||||
7. Known bugs & problems *tcl-bugs*
|
||||
|
||||
Calling one of the Tcl ex commands from inside Tcl (via "::vim::command") may
|
||||
have unexpected side effects. The command creates a new interpreter, which
|
||||
has the same abilities as the standard interpreter - making "::vim::command"
|
||||
available in a safe child interpreter therefore makes the child unsafe. (It
|
||||
would be trivial to block nested :tcl* calls or ensure that such calls from a
|
||||
safe interpreter create only new safe interpreters, but quite pointless -
|
||||
depending on vim's configuration, "::vim::command" may execute arbitrary code
|
||||
in any number of other scripting languages.) A call to "exit" within this new
|
||||
interpreter does not affect the old interpreter; it only terminates the new
|
||||
interpreter, then script processing continues normally in the old interpreter.
|
||||
|
||||
Input from stdin is currently not supported.
|
||||
|
||||
==============================================================================
|
||||
8. Examples: *tcl-examples*
|
||||
|
||||
Here are a few small (and maybe useful) Tcl scripts.
|
||||
|
||||
This script sorts the lines of the entire buffer (assume it contains a list
|
||||
of names or something similar):
|
||||
set buf $::vim::current(buffer)
|
||||
set lines [$buf get top bottom]
|
||||
set lines [lsort -dictionary $lines]
|
||||
$buf set top bottom $lines
|
||||
|
||||
This script reverses the lines in the buffer. Note the use of "::vim::lbase"
|
||||
and "$buf last" to work with any line number setting.
|
||||
set buf $::vim::current(buffer)
|
||||
set t $::vim::lbase
|
||||
set b [$buf last]
|
||||
while { $t < $b } {
|
||||
set tl [$buf get $t]
|
||||
set bl [$buf get $b]
|
||||
$buf set $t $bl
|
||||
$buf set $b $tl
|
||||
incr t
|
||||
incr b -1
|
||||
}
|
||||
|
||||
This script adds a consecutive number to each line in the current range:
|
||||
set buf $::vim::current(buffer)
|
||||
set i $::vim::range(start)
|
||||
set n 1
|
||||
while { $i <= $::vim::range(end) } {
|
||||
set line [$buf get $i]
|
||||
$buf set $i "$n\t$line"
|
||||
incr i ; incr n
|
||||
}
|
||||
|
||||
The same can also be done quickly with two ex commands, using ":tcldo":
|
||||
:tcl set n 1
|
||||
:[range]tcldo set line "$n\t$line" ; incr n
|
||||
|
||||
This procedure runs an ex command on each buffer (idea stolen from Ron Aaron):
|
||||
proc eachbuf { cmd } {
|
||||
foreach b [::vim::buffer list] {
|
||||
$b command $cmd
|
||||
}
|
||||
}
|
||||
Use it like this:
|
||||
:tcl eachbuf %s/foo/bar/g
|
||||
Be careful with Tcl's string and backslash substitution, tough. If in doubt,
|
||||
surround the ex command with curly braces.
|
||||
|
||||
|
||||
If you want to add some Tcl procedures permanently to vim, just place them in
|
||||
a file (e.g. "~/.vimrc.tcl" on Unix machines), and add these lines to your
|
||||
startup file (usually "~/.vimrc" on Unix):
|
||||
if has("tcl")
|
||||
tclfile ~/.vimrc.tcl
|
||||
endif
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,484 +0,0 @@
|
||||
*indent.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
This file is about indenting C programs and other files.
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
|
||||
Indenting is handled as expected by the IDE.
|
||||
<!--
|
||||
1. Indenting C programs |C-indenting|
|
||||
2. Indenting by expression |indent-expression|
|
||||
|
||||
==============================================================================
|
||||
1. Indenting C programs *C-indenting*
|
||||
|
||||
The basics for C indenting are explained in section |30.2| of the user manual.
|
||||
|
||||
Vim has options for automatically indenting C program files. These options
|
||||
affect only the indent and do not perform other formatting. For comment
|
||||
formatting, see |format-comments|.
|
||||
|
||||
Note that this will not work when the |+smartindent| or |+cindent| features
|
||||
have been disabled at compile time.
|
||||
|
||||
There are in fact four methods available for indentation:
|
||||
'autoindent' uses the indent from the previous line.
|
||||
'smartindent' is like 'autoindent' but also recognizes some C syntax to
|
||||
increase/reduce the indent where appropriate.
|
||||
'cindent' Works more cleverly than the other two and is configurable to
|
||||
different indenting styles.
|
||||
'indentexpr' The most flexible of all: Evaluates an expression to compute
|
||||
the indent of a line. When non-empty this method overrides
|
||||
the other ones. See |indent-expression|.
|
||||
The rest of this section describes the 'cindent' option.
|
||||
|
||||
Note that 'cindent' indenting does not work for every code scenario. Vim
|
||||
is not a C compiler: it does not recognize all syntax.
|
||||
|
||||
These four options control C program indenting:
|
||||
'cindent' Enables Vim to perform C program indenting automatically.
|
||||
'cinkeys' Specifies which keys trigger reindenting in insert mode.
|
||||
'cinoptions' Sets your preferred indent style.
|
||||
'cinwords' Defines keywords that start an extra indent in the next line.
|
||||
|
||||
If 'lisp' is not on and 'equalprg' is empty, the "=" operator indents using
|
||||
Vim's built-in algorithm rather than calling an external program.
|
||||
|
||||
See |autocommand| for how to set the 'cindent' option automatically for C code
|
||||
files and reset it for others.
|
||||
|
||||
*cinkeys-format* *indentkeys-format*
|
||||
The 'cinkeys' option is a string that controls Vim's indenting in response to
|
||||
typing certain characters or commands in certain contexts. Note that this not
|
||||
only triggers C-indenting. When 'indentexpr' is not empty 'indentkeys' is
|
||||
used instead. The format of 'cinkeys' and 'indentkeys' is equal.
|
||||
|
||||
The default is "0{,0},0),:,0#,!^F,o,O,e" which specifies that indenting occurs
|
||||
as follows:
|
||||
|
||||
"0{" if you type '{' as the first character in a line
|
||||
"0}" if you type '}' as the first character in a line
|
||||
"0)" if you type ')' as the first character in a line
|
||||
":" if you type ':' after a label or case statement
|
||||
"0#" if you type '#' as the first character in a line
|
||||
"!^F" if you type CTRL-F (which is not inserted)
|
||||
"o" if you type a <CR> anywhere or use the "o" command (not in
|
||||
insert mode!)
|
||||
"O" if you use the "O" command (not in insert mode!)
|
||||
"e" if you type the second 'e' for an "else" at the start of a
|
||||
line
|
||||
|
||||
Characters that can precede each key:
|
||||
! When a '!' precedes the key, Vim will not insert the key but will
|
||||
instead reindent the current line. This allows you to define a
|
||||
command key for reindenting the current line. CTRL-F is the default
|
||||
key for this. Be careful if you define CTRL-I for this because CTRL-I
|
||||
is the ASCII code for <Tab>.
|
||||
* When a '*' precedes the key, Vim will reindent the line before
|
||||
inserting the key. If 'cinkeys' contains "*<Return>", Vim reindents
|
||||
the current line before opening a new line.
|
||||
0 When a zero precedes the key (but appears after '!' or '*') Vim will
|
||||
reindent the line only if the key is the first character you type in
|
||||
the line. When used before "=" Vim will only reindent the line if
|
||||
there is only white space before the word.
|
||||
|
||||
When neither '!' nor '*' precedes the key, Vim reindents the line after you
|
||||
type the key. So ';' sets the indentation of a line which includes the ';'.
|
||||
|
||||
Special key names:
|
||||
<> Angle brackets mean spelled-out names of keys. For example: "<Up>",
|
||||
"<Ins>" (see |key-notation|).
|
||||
^ Letters preceded by a caret (^) are control characters. For example:
|
||||
"^F" is CTRL-F.
|
||||
o Reindent a line when you use the "o" command or when Vim opens a new
|
||||
line below the current one (e.g., when you type <Enter> in insert
|
||||
mode).
|
||||
O Reindent a line when you use the "O" command.
|
||||
e Reindent a line that starts with "else" when you type the second 'e'.
|
||||
: Reindent a line when a ':' is typed which is after a label or case
|
||||
statement. Don't reindent for a ":" in "class::method" for C++. To
|
||||
Reindent for any ":", use "<:>".
|
||||
=word Reindent when typing the last character of "word". "word" may
|
||||
actually be part of another word. Thus "=end" would cause reindenting
|
||||
when typing the "d" in "endif" or "endwhile". But not when typing
|
||||
"bend". Also reindent when completion produces a word that starts
|
||||
with "word". "0=word" reindents when there is only white space before
|
||||
the word.
|
||||
=~word Like =word, but ignore case.
|
||||
|
||||
If you really want to reindent when you type 'o', 'O', 'e', '0', '<', '>',
|
||||
'*', ':' or '!', use "<o>", "<O>", "<e>", "<0>", "<<>", "<>>", "<*>", "<:>" or
|
||||
"<!>", respectively, for those keys.
|
||||
|
||||
For an emacs-style indent mode where lines aren't indented every time you
|
||||
press Enter but only if you press Tab, I suggest:
|
||||
:set cinkeys=0{,0},:,0#,!<Tab>,!^F
|
||||
You might also want to switch off 'autoindent' then.
|
||||
|
||||
Note: If you change the current line's indentation manually, Vim ignores the
|
||||
cindent settings for that line. This prevents vim from reindenting after you
|
||||
have changed the indent by typing <BS>, <Tab>, or <Space> in the indent or
|
||||
used CTRL-T or CTRL-D.
|
||||
|
||||
*cinoptions-values*
|
||||
The 'cinoptions' option sets how Vim performs indentation. In the list below,
|
||||
"N" represents a number of your choice (the number can be negative). When
|
||||
there is an 's' after the number, Vim multiplies the number by 'shiftwidth':
|
||||
"1s" is 'shiftwidth', "2s" is two times 'shiftwidth', etc. You can use a
|
||||
decimal point, too: "-0.5s" is minus half a 'shiftwidth'. The examples below
|
||||
assume a 'shiftwidth' of 4.
|
||||
|
||||
>N Amount added for "normal" indent. Used after a line that should
|
||||
increase the indent (lines starting with "if", an opening brace,
|
||||
etc.). (default 'shiftwidth').
|
||||
|
||||
cino= cino=>2 cino=>2s >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
<
|
||||
eN Add N to the prevailing indent inside a set of braces if the
|
||||
opening brace at the End of the line (more precise: is not the
|
||||
first character in a line). This is useful if you want a
|
||||
different indent when the '{' is at the start of the line from
|
||||
when '{' is at the end of the line. (default 0).
|
||||
|
||||
cino= cino=e2 cino=e-2 >
|
||||
if (cond) { if (cond) { if (cond) {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
else else else
|
||||
{ { {
|
||||
bar; bar; bar;
|
||||
} } }
|
||||
<
|
||||
nN Add N to the prevailing indent for a statement after an "if",
|
||||
"while", etc., if it is NOT inside a set of braces. This is
|
||||
useful if you want a different indent when there is no '{'
|
||||
before the statement from when there is a '{' before it.
|
||||
(default 0).
|
||||
|
||||
cino= cino=n2 cino=n-2 >
|
||||
if (cond) if (cond) if (cond)
|
||||
foo; foo; foo;
|
||||
else else else
|
||||
{ { {
|
||||
bar; bar; bar;
|
||||
} } }
|
||||
<
|
||||
fN Place the first opening brace of a function or other block in
|
||||
column N. This applies only for an opening brace that is not
|
||||
inside other braces and is at the start of the line. What comes
|
||||
after the brace is put relative to this brace. (default 0).
|
||||
|
||||
cino= cino=f.5s cino=f1s >
|
||||
func() func() func()
|
||||
{ { {
|
||||
int foo; int foo; int foo;
|
||||
<
|
||||
{N Place opening braces N characters from the prevailing indent.
|
||||
This applies only for opening braces that are inside other
|
||||
braces. (default 0).
|
||||
|
||||
cino= cino={.5s cino={1s >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
<
|
||||
}N Place closing braces N characters from the matching opening
|
||||
brace. (default 0).
|
||||
|
||||
cino= cino={2,}-0.5s cino=}2 >
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
foo; foo; foo;
|
||||
} } }
|
||||
<
|
||||
^N Add N to the prevailing indent inside a set of braces if the
|
||||
opening brace is in column 0. This can specify a different
|
||||
indent for whole of a function (some may like to set it to a
|
||||
negative number). (default 0).
|
||||
|
||||
cino= cino=^-2 cino=^-s >
|
||||
func() func() func()
|
||||
{ { {
|
||||
if (cond) if (cond) if (cond)
|
||||
{ { {
|
||||
a = b; a = b; a = b;
|
||||
} } }
|
||||
} } }
|
||||
<
|
||||
:N Place case labels N characters from the indent of the switch().
|
||||
(default 'shiftwidth').
|
||||
|
||||
cino= cino=:0 >
|
||||
switch (x) switch(x)
|
||||
{ {
|
||||
case 1: case 1:
|
||||
a = b; a = b;
|
||||
default: default:
|
||||
} }
|
||||
<
|
||||
=N Place statements occurring after a case label N characters from
|
||||
the indent of the label. (default 'shiftwidth').
|
||||
|
||||
cino= cino==10 >
|
||||
case 11: case 11: a = a + 1;
|
||||
a = a + 1; b = b + 1;
|
||||
<
|
||||
lN If N != 0 Vim will align with a case label instead of the
|
||||
statement after it.
|
||||
|
||||
cino= cino=l1 >
|
||||
switch (a) { switch (a) {
|
||||
case 1: { case 1: {
|
||||
break; break;
|
||||
} }
|
||||
<
|
||||
gN Place C++ scope declarations N characters from the indent of the
|
||||
block they are in. (default 'shiftwidth'). A scope declaration
|
||||
can be "public:", "protected:" or "private:".
|
||||
|
||||
cino= cino=g0 >
|
||||
{ {
|
||||
public: public:
|
||||
a = b; a = b;
|
||||
private: private:
|
||||
} }
|
||||
<
|
||||
hN Place statements occurring after a C++ scope declaration N
|
||||
characters from the indent of the label. (default
|
||||
'shiftwidth').
|
||||
|
||||
cino= cino=h10 >
|
||||
public: public: a = a + 1;
|
||||
a = a + 1; b = b + 1;
|
||||
<
|
||||
pN Parameter declarations for K&R-style function declarations will
|
||||
be indented N characters from the margin. (default
|
||||
'shiftwidth').
|
||||
|
||||
cino= cino=p0 cino=p2s >
|
||||
func(a, b) func(a, b) func(a, b)
|
||||
int a; int a; int a;
|
||||
char b; char b; char b;
|
||||
<
|
||||
tN Indent a function return type declaration N characters from the
|
||||
margin. (default 'shiftwidth').
|
||||
|
||||
cino= cino=t0 cino=t7 >
|
||||
int int int
|
||||
func() func() func()
|
||||
<
|
||||
+N Indent a continuation line (a line that spills onto the next) N
|
||||
additional characters. (default 'shiftwidth').
|
||||
|
||||
cino= cino=+10 >
|
||||
a = b + 9 * a = b + 9 *
|
||||
c; c;
|
||||
<
|
||||
cN Indent comment lines after the comment opener, when there is no
|
||||
other text with which to align, N characters from the comment
|
||||
opener. (default 3). See also |format-comments|.
|
||||
|
||||
cino= cino=c5 >
|
||||
/* /*
|
||||
text. text.
|
||||
*/ */
|
||||
<
|
||||
CN When N is non-zero, indent comment lines by the amount specified
|
||||
with the c flag above even if there is other text behind the
|
||||
comment opener. (default 0).
|
||||
|
||||
cino=c0 cino=c0,C1 >
|
||||
/******** /********
|
||||
text. text.
|
||||
********/ ********/
|
||||
< (Example uses ":set comments& comments-=s1:/* comments^=s0:/*")
|
||||
|
||||
/N Indent comment lines N characters extra. (default 0).
|
||||
cino= cino=/4 >
|
||||
a = b; a = b;
|
||||
/* comment */ /* comment */
|
||||
c = d; c = d;
|
||||
<
|
||||
(N When in unclosed parentheses, indent N characters from the line
|
||||
with the unclosed parentheses. Add a 'shiftwidth' for every
|
||||
unclosed parentheses. When N is 0 or the unclosed parentheses
|
||||
is the first non-white character in its line, line up with the
|
||||
next non-white character after the unclosed parentheses.
|
||||
(default 'shiftwidth' * 2).
|
||||
|
||||
cino= cino=(0 >
|
||||
if (c1 && (c2 || if (c1 && (c2 ||
|
||||
c3)) c3))
|
||||
foo; foo;
|
||||
if (c1 && if (c1 &&
|
||||
(c2 || c3)) (c2 || c3))
|
||||
{ {
|
||||
<
|
||||
uN Same as (N, but for one level deeper. (default 'shiftwidth').
|
||||
|
||||
cino= cino=u2 >
|
||||
if (c123456789 if (c123456789
|
||||
&& (c22345 && (c22345
|
||||
|| c3)) || c3))
|
||||
<
|
||||
UN When N is non-zero, do not ignore the indenting specified by
|
||||
( or u in case that the unclosed parentheses is the first
|
||||
non-white character in its line. (default 0).
|
||||
|
||||
cino= or cino=(s cino=(s,U1 >
|
||||
c = c1 && c = c1 &&
|
||||
( (
|
||||
c2 || c2 ||
|
||||
c3 c3
|
||||
) && c4; ) && c4;
|
||||
<
|
||||
wN When in unclosed parentheses and N is non-zero and either
|
||||
using "(0" or "u0", respectively, or using "U0" and the unclosed
|
||||
parentheses is the first non-white character in its line, line
|
||||
up with the character immediately after the unclosed parentheses
|
||||
rather than the first non-white character. (default 0).
|
||||
|
||||
cino=(0 cino=(0,w1 >
|
||||
if ( c1 if ( c1
|
||||
&& ( c2 && ( c2
|
||||
|| c3)) || c3))
|
||||
foo; foo;
|
||||
<
|
||||
mN When N is non-zero, line up a line starting with a closing
|
||||
parentheses with the first character of the line with the
|
||||
matching opening parentheses. (default 0).
|
||||
|
||||
cino=(s cino=(s,m1 >
|
||||
c = c1 && ( c = c1 && (
|
||||
c2 || c2 ||
|
||||
c3 c3
|
||||
) && c4; ) && c4;
|
||||
if ( if (
|
||||
c1 && c2 c1 && c2
|
||||
) )
|
||||
foo; foo;
|
||||
<
|
||||
*java-cinoptions* *java-indenting*
|
||||
jN Indent java anonymous classes correctly. The value 'N' is
|
||||
currently unused but must be non-zero (e.g. 'j1'). 'j1' will
|
||||
indent for example the following code snippet correctly: >
|
||||
|
||||
object.add(new ChangeListener() {
|
||||
public void stateChanged(ChangeEvent e) {
|
||||
do_something();
|
||||
}
|
||||
});
|
||||
<
|
||||
)N Vim searches for unclosed parentheses at most N lines away.
|
||||
This limits the time needed to search for parentheses. (default
|
||||
20 lines).
|
||||
|
||||
*N Vim searches for unclosed comments at most N lines away. This
|
||||
limits the time needed to search for the start of a comment.
|
||||
(default 30 lines).
|
||||
|
||||
|
||||
The defaults, spelled out in full, are:
|
||||
cinoptions=>s,e0,n0,f0,{0,}0,^0,:s,=s,l0,gs,hs,ps,ts,+s,c3,C0,(2s,us,
|
||||
\U0,w0,m0,j0,)20,*30
|
||||
|
||||
Vim puts a line in column 1 if:
|
||||
- It starts with '#' (preprocessor directives), if 'cinkeys' contains '#'.
|
||||
- It starts with a label (a keyword followed by ':', other than "case" and
|
||||
"default").
|
||||
- Any combination of indentations causes the line to have less than 0
|
||||
indentation.
|
||||
|
||||
==============================================================================
|
||||
2. Indenting by expression *indent-expression*
|
||||
|
||||
The basics for using flexible indenting are explained in section |30.3| of the
|
||||
user manual.
|
||||
|
||||
If you want to write your own indent file, it must set the 'indentexpr'
|
||||
option. Setting the 'indentkeys' option is often useful. See the
|
||||
$VIMRUNTIME/indent directory for examples.
|
||||
|
||||
|
||||
REMARKS ABOUT SPECIFIC INDENT FILES ~
|
||||
|
||||
|
||||
FORTRAN *fortran-indent*
|
||||
|
||||
Block if, select case, and where constructs are indented. Comments, labelled
|
||||
statements and continuation lines are indented if the Fortran is in free
|
||||
source form, whereas they are not indented if the Fortran is in fixed source
|
||||
form because of the left margin requirements. Hence manual indent corrections
|
||||
will be necessary for labelled statements and continuation lines when fixed
|
||||
source form is being used. For further discussion of the method used for the
|
||||
detection of source format see |fortran-syntax|.
|
||||
|
||||
Do loops ~
|
||||
All do loops are left unindented by default. Do loops can be unstructured in
|
||||
Fortran with (possibly multiple) loops ending on a labelled executable
|
||||
statement of almost arbitrary type. Correct indentation requires
|
||||
compiler-quality parsing. Old code with do loops ending on labelled statements
|
||||
of arbitrary type can be indented with elaborate programs such as Tidy
|
||||
(http://www.unb.ca/chem/ajit/f_tidy.htm). Structured do/continue loops are
|
||||
also left unindented because continue statements are also used for purposes
|
||||
other than ending a do loop. Programs such as Tidy can convert structured
|
||||
do/continue loops to the do/enddo form. Do loops of the do/enddo variety can
|
||||
be indented. If you use only structured loops of the do/enddo form, you should
|
||||
declare this by setting the fortran_do_enddo variable in your .vimrc as
|
||||
follows >
|
||||
|
||||
let fortran_do_enddo=1
|
||||
|
||||
in which case do loops will be indented. If all your loops are of do/enddo
|
||||
type only in, say, .f90 files, then you should set a buffer flag with an
|
||||
autocommand such as >
|
||||
|
||||
au! BufRead,BufNewFile *.f90 let b:fortran_do_enddo=1
|
||||
|
||||
to get do loops indented in .f90 files and left alone in Fortran files with
|
||||
other extensions such as .for.
|
||||
|
||||
|
||||
VERILOG *verilog-indent*
|
||||
|
||||
General block statements such as if, for, case, always, initial, function,
|
||||
specify and begin, etc., are indented. The module block statements (first
|
||||
level blocks) are not indented by default. you can turn on the indent with
|
||||
setting a variable in the .vimrc as follows: >
|
||||
|
||||
let b:verilog_indent_modules = 1
|
||||
|
||||
then the module blocks will be indented. To stop this, remove the variable: >
|
||||
|
||||
:unlet b:verilog_indent_modules
|
||||
|
||||
To set the variable only for Verilog file. The following statements can be
|
||||
used: >
|
||||
|
||||
au BufReadPost * if exists("b:current_syntax")
|
||||
au BufReadPost * if b:current_syntax == "verilog"
|
||||
au BufReadPost * let b:verilog_indent_modules = 1
|
||||
au BufReadPost * endif
|
||||
au BufReadPost * endif
|
||||
|
||||
Furthermore, setting the variable b:verilog_indent_width to change the
|
||||
indenting width (default is 'shiftwidth'): >
|
||||
|
||||
let b:verilog_indent_width = 4
|
||||
let b:verilog_indent_width = &sw * 2
|
||||
|
||||
In addition, you can turn the verbose mode for debug issue: >
|
||||
|
||||
let b:verilog_indent_verbose = 1
|
||||
|
||||
Make sure to do ":set cmdheight=2" first to allow the display of the message.
|
||||
|
||||
-->
|
||||
1641
help/txt/index.txt
1641
help/txt/index.txt
File diff suppressed because it is too large
Load Diff
1065
help/txt/insert.txt
1065
help/txt/insert.txt
File diff suppressed because it is too large
Load Diff
@@ -1,944 +0,0 @@
|
||||
*intro.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Introduction to Vim *ref* *reference*
|
||||
|
||||
1. Introduction |intro|
|
||||
2. Vim on the internet |internet|
|
||||
3. Credits |credits|
|
||||
4. Notation |notation|
|
||||
5. Modes, introduction |vim-modes-intro|
|
||||
6. Switching from mode to mode |mode-switching|
|
||||
7. The window contents |window-contents|
|
||||
8. Definitions |definitions|
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *intro*
|
||||
|
||||
IdeaVim is an attempt to replicate the features of Vim withing the context of
|
||||
the IntelliJ platform based IDEs. Not all the functionality of Vim applies within IdeaVim plugin. And not
|
||||
all appropriate features are implemented.
|
||||
|
||||
<!--
|
||||
Vim stands for Vi IMproved. It used to be Vi IMitation, but there are so many
|
||||
improvements that a name change was appropriate. Vim is a text editor which
|
||||
includes almost all the commands from the Unix program "Vi" and a lot of new
|
||||
ones. It is very useful for editing programs and other plain text.
|
||||
All commands are given with the keyboard. This has the advantage that you
|
||||
can keep your fingers on the keyboard and your eyes on the screen. For those
|
||||
who want it, there is mouse support and a GUI version with scrollbars and
|
||||
menus (see |gui.txt|).
|
||||
|
||||
-->
|
||||
An overview of this manual can be found in the file "help.txt", |help.txt|.
|
||||
It can be accessed from within Vim with the <Help> or <F1> key and with the
|
||||
|:help| command (just type ":help", without the bars or quotes).
|
||||
The 'helpfile' option can be set to the name of the help file, in case it
|
||||
is not located in the default place. You can jump to subjects like with tags:
|
||||
Use CTRL-] to jump to a subject under the cursor, use CTRL-T to jump back.
|
||||
|
||||
Throughout this manual the differences between Vim and IdeaVim are mentioned in
|
||||
curly braces, like this: {IdeaVim does not support this feature}. See
|
||||
|vi_diff.txt| for a summary of the differences between IdeaVim and Vim.
|
||||
|
||||
<!--
|
||||
This manual refers to Vim on various machines. There may be small differences
|
||||
between different computers and terminals. Besides the remarks given in this
|
||||
document, there is a separate document for each supported system, see
|
||||
|sys-file-list|.
|
||||
|
||||
-->
|
||||
This manual is a reference for all the IdeaVim commands and options. This is not
|
||||
an introduction to the use of Vi or Vim, it gets a bit complicated here and
|
||||
<!--
|
||||
there. For beginners, there is a hands-on |tutor|. To learn using Vim, read
|
||||
the user manual |usr_toc.txt|.
|
||||
-->
|
||||
there. To learn using Vim, read the user manual |usr_toc.txt|.
|
||||
|
||||
*book*
|
||||
There are many books on Vi that contain a section for beginners. There are
|
||||
two books I can recommend:
|
||||
|
||||
"Vim - Vi Improved" by Steve Oualline
|
||||
|
||||
This is the very first book completely dedicated to Vim. It is very good for
|
||||
beginners. The most often used commands are explained with pictures and
|
||||
examples. The less often used commands are also explained, the more advanced
|
||||
features are summarized. There is a comprehensive index and a quick
|
||||
reference. Parts of this book have been included in the user manual
|
||||
|frombook|.
|
||||
Published by New Riders Publishing. ISBN: 0735710015
|
||||
For more information try one of these:
|
||||
http://vim.iccf-holland.org
|
||||
http://www.vim.org/iccf/click5.html
|
||||
|
||||
"Learning the Vi editor" by Linda Lamb and Arnold Robbins
|
||||
|
||||
This is a book about Vi that includes a chapter on Vim (in the sixth edition).
|
||||
The first steps in Vi are explained very well. The commands that Vim adds are
|
||||
only briefly mentioned. There is also a German translation.
|
||||
Published by O'Reilly. ISBN: 1-56592-426-6.
|
||||
|
||||
==============================================================================
|
||||
2. IdeaVim on the internet *internet*
|
||||
|
||||
*www* *faq* *FAQ* *distribution* *download*
|
||||
|
||||
IdeaVim home page: http://plugins.intellij.net/plugin/?ruby&id=164
|
||||
|
||||
<!--
|
||||
The Vim pages contain the most recent information about Vim. They also
|
||||
contain links to the most recent version of Vim. The FAQ is a list of
|
||||
Frequently Asked Questions. Read this if you have problems.
|
||||
|
||||
VIM home page: http://vim.sf.net/
|
||||
Sven's VIM pages: http://www.vim.org/
|
||||
Latest news: http://www.vim.org/news.html
|
||||
VIM FAQ: http://www.vim.org/faq/
|
||||
Downloading: ftp://ftp.vim.org/pub/vim/MIRRORS
|
||||
|
||||
|
||||
Usenet News group where Vim is discussed: *news* *usenet*
|
||||
comp.editors
|
||||
See http://www.vim.org/usenet.html. This group is also for other editors. If
|
||||
you write about Vim, don't forget to mention that.
|
||||
|
||||
*mail-list* *maillist*
|
||||
There are several mailing lists for Vim:
|
||||
<vim@vim.org>
|
||||
For discussions about using existing versions of Vim: Useful mappings,
|
||||
questions, answers, where to get a specific version, etc.
|
||||
<vim-dev@vim.org> *vim-dev* *vimdev*
|
||||
For discussions about changing Vim: New features, porting, patches,
|
||||
beta-test versions, etc.
|
||||
<vim-announce@vim.org> *vim-announce*
|
||||
Announcements about new versions of Vim; also for beta-test versions
|
||||
and ports to different systems.
|
||||
<vim-multibyte@vim.org> *vim-multibyte*
|
||||
For discussions about using and improving the multi-byte aspects of
|
||||
Vim.
|
||||
<vim-mac@vim.org> *vim-mac*
|
||||
For discussions about using and improving the Macintosh version of
|
||||
Vim.
|
||||
|
||||
See http://www.vim.org/mail.html.
|
||||
|
||||
NOTE:
|
||||
- You can only send messages to these lists if you have subscribed!
|
||||
- You need to send the messages from the same location as where you subscribed
|
||||
from (to avoid spam mail).
|
||||
- Maximum message size is 40000 characters.
|
||||
|
||||
*subscribe-maillist*
|
||||
If you want to join, send a message to
|
||||
<vim-help@vim.org>
|
||||
Make sure that your "From:" address is correct. Then the list server will
|
||||
give you help on how to subscribe.
|
||||
|
||||
You can retrieve old messages from the maillist software, and an index of
|
||||
messages. Ask vim-help for instructions.
|
||||
|
||||
Archives are kept at: *maillist-archive*
|
||||
http://groups.yahoo.com/group/vim
|
||||
http://groups.yahoo.com/group/vimdev
|
||||
http://groups.yahoo.com/group/vimannounce
|
||||
http://groups.yahoo.com/group/vim-multibyte
|
||||
http://groups.yahoo.com/group/vim-mac
|
||||
|
||||
Another archive is at http://www.somelist.com in the "Editeurs" section (the
|
||||
site is in French, the messages are in English).
|
||||
|
||||
|
||||
Additional maillists:
|
||||
|
||||
<vim-fr@club.voila.fr> *french-maillist*
|
||||
Vim list in the French language. Subscribe by sending a message to
|
||||
<vim-fr-subscribe@club.voila.fr>
|
||||
Or go to http://groups.yahoo.com/group/vim-fr.
|
||||
|
||||
-->
|
||||
|
||||
Bug reports: *bugs* *bug-reports* *bugreport.vim*
|
||||
|
||||
Bug reports and other requests can be made on JetBrains issue tracker http://youtrack.jetbrains.net/issues/VIM
|
||||
<!--
|
||||
Send bug reports to: Vim bugs <bugs@vim.org>
|
||||
This is not a maillist but the message is redirected to the Vim maintainer.
|
||||
Please be brief; all the time that is spent on answering mail is subtracted
|
||||
from the time that is spent on improving Vim! Always give a reproducible
|
||||
example and try to find out which settings or other things influence the
|
||||
appearance of the bug. Try different machines, if possible. Send me patches
|
||||
if you can!
|
||||
|
||||
In case of doubt, use: >
|
||||
:so $VIMRUNTIME/bugreport.vim
|
||||
This will create a file "bugreport.txt" in the current directory, with a lot
|
||||
of information of your environment. Before sending this out, check if it
|
||||
doesn't contain any confidential information!
|
||||
|
||||
*debug-vim*
|
||||
When Vim crashes in one of the test files, and you are using gcc for
|
||||
compilation, here is what you can do to find out exactly where Vim crashes:
|
||||
|
||||
1. Compile Vim with the "-g" option (there is a line in the Makefile for this,
|
||||
which you can uncomment).
|
||||
|
||||
2. Execute these commands (replace "11" with the test that fails): >
|
||||
cd testdir
|
||||
gdb ../vim
|
||||
run -u unix.vim -U NONE -s dotest.in test11.in
|
||||
|
||||
3. Check where Vim crashes, gdb should give a message for this.
|
||||
|
||||
4. Get a stack trace from gdb with this command: >
|
||||
where
|
||||
< You can check out different places in the stack trace with: >
|
||||
frame 3
|
||||
< Replace "3" with one of the numbers in the stack trace.
|
||||
|
||||
*year-2000* *Y2K*
|
||||
Since Vim internally doesn't use dates for editing, there is no year 2000
|
||||
problem to worry about. Vim does use the time in the form of seconds since
|
||||
January 1st 1970. It is used for a time-stamp check of the edited file and
|
||||
the swap file, which is not critical and should only cause warning messages.
|
||||
|
||||
There might be a year 2038 problem, when the seconds don't fit in a 32 bit int
|
||||
anymore. This depends on the compiler, libraries and operating system.
|
||||
Specifically, time_t and the ctime() function are used. And the time_t is
|
||||
stored in four bytes in the swap file. But that's only used for printing a
|
||||
file date/time for recovery, it will never affect normal editing.
|
||||
|
||||
The Vim strftime() function directly uses the strftime() system function.
|
||||
localtime() uses the time() system function. getftime() uses the time
|
||||
returned by the stat() system function. If your system libraries are year
|
||||
2000 compliant, Vim is too.
|
||||
|
||||
The user may create scripts for Vim that use external commands. These might
|
||||
introduce Y2K problems, but those are not really part of Vim itself.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
3. Credits *credits* *author*
|
||||
|
||||
IdeaVim was originally written by Rick Maddy <rick@maddyhome.com>
|
||||
and now is maintained at JetBrains by Oleg Shpynov <oleg.shpynov@jetbrains.com>
|
||||
|
||||
Most of Vim was written by Bram Moolenaar.
|
||||
|
||||
Parts of the documentation come from several Vi manuals, written by:
|
||||
W.N. Joy
|
||||
Alan P.W. Hewett
|
||||
Mark Horton
|
||||
|
||||
The Vim editor is based on Stevie and includes (ideas from) other software,
|
||||
worked on by the people mentioned here. Other people helped by sending me
|
||||
patches, suggestions and giving feedback about what is good and bad in Vim.
|
||||
|
||||
Vim would never have become what it is now, without the help of these people!
|
||||
|
||||
Ron Aaron Win32 GUI changes
|
||||
Zoltan Arpadffy work on VMS port
|
||||
Tony Andrews Stevie
|
||||
Gert van Antwerpen changes for DJGPP on MS-DOS
|
||||
Berkeley DB(3) ideas for swap file implementation
|
||||
Keith Bostic Nvi
|
||||
Walter Briscoe Makefile updates, various patches
|
||||
Ralf Brown SPAWNO library for MS-DOS
|
||||
Robert Colon many useful remarks
|
||||
Marcin Dalecki GTK+ GUI port, toolbar icons, gettext()
|
||||
Kayhan Demirel sent me news in Uganda
|
||||
Chris & John Downey xvi (ideas for multi-windows version)
|
||||
Henk Elbers first VMS port
|
||||
Eric Fischer Mac port, 'cindent', and other improvements
|
||||
Benji Fisher Answering lots of user questions
|
||||
Bill Foster Athena GUI port
|
||||
Loic Grenie xvim (ideas for multi windows version)
|
||||
Sven Guckes Vim WWW page maintainer
|
||||
Darren Hiebert Exuberant ctags
|
||||
Bruce Hunsaker improvements for VMS port
|
||||
Andy Kahn Cscope support, GTK+ GUI port
|
||||
Oezguer Kesim Maintainer of Vim Mailing Lists
|
||||
Axel Kielhorn work on the Macintosh port
|
||||
Steve Kirkendall Elvis
|
||||
Roger Knobbe original port to Windows NT
|
||||
Sergey Laskavy Vim's help from Moscow
|
||||
Felix von Leitner Maintainer of Vim Mailing Lists
|
||||
David Leonard Port of Python extensions to Unix
|
||||
Avner Lottem Edit in right-to-left windows
|
||||
Flemming Madsen X11 client-server, various features and patches
|
||||
MicroSoft Gave me a copy of DevStudio to compile Vim with
|
||||
Paul Moore Python interface extensions, many patches
|
||||
Katsuhito Nagano Work on multi-byte versions
|
||||
Sung-Hyun Nam Work on multi-byte versions
|
||||
Vince Negri Win32 GUI and generic console enhancements
|
||||
Steve Oualline Author of the first Vim book |frombook|
|
||||
George V. Reilly Win32 port, Win32 GUI start-off
|
||||
Stephen Riehm bug collector
|
||||
Stefan Roemer various patches and help to users
|
||||
Ralf Schandl IBM OS/390 port
|
||||
Olaf Seibert DICE and BeBox version, regexp improvements
|
||||
Mortaza Shiran Farsi patches
|
||||
Peter da Silva termlib
|
||||
Paul Slootman OS/2 port
|
||||
Henry Spencer regular expressions
|
||||
Dany St-Amant Macintosh port
|
||||
Tim Thompson Stevie
|
||||
G. R. (Fred) Walter Stevie
|
||||
Sven Verdoolaege Perl interface
|
||||
Robert Webb Command-line completion, GUI versions, and
|
||||
lots of patches
|
||||
Ingo Wilken Tcl interface
|
||||
Mike Williams PostScript printing
|
||||
Juergen Weigert Lattice version, AUX improvements, UNIX and
|
||||
MS-DOS ports, autoconf
|
||||
Stefan 'Sec' Zehl Maintainer of vim.org
|
||||
|
||||
I wish to thank all the people that sent me bug reports and suggestions. The
|
||||
list is too long to mention them all here. Vim would not be the same without
|
||||
the ideas from all these people: They keep Vim alive!
|
||||
|
||||
|
||||
In this documentation there are several references to other versions of Vi:
|
||||
*Vi*
|
||||
Vi "the original". Without further remarks this is the version
|
||||
of Vi that appeared in Sun OS 4.x. ":version" returns
|
||||
"Version 3.7, 6/7/85". Sometimes other versions are referred
|
||||
to. Only runs under Unix. Source code only available with a
|
||||
license. More information on Vi can be found through:
|
||||
http://vi-editor.org
|
||||
*Posix*
|
||||
Posix From the IEEE standard 1003.2, Part 2: Shell and utilities.
|
||||
Generally known as "Posix". This is a textual description of
|
||||
how Vi is supposed to work.
|
||||
The version used is a draft from beginning 1996, so all remarks are
|
||||
"expected to comply to" this. Anything can change though...
|
||||
*Nvi*
|
||||
Nvi The "New" Vi. The version of Vi that comes with BSD 4.4 and FreeBSD.
|
||||
Very good compatibility with the original Vi, with a few extensions.
|
||||
The version used is 1.79. ":version" returns "Version 1.79
|
||||
(10/23/96)". There has been no release the last few years, although
|
||||
there is a development version 1.81.
|
||||
Source code is freely available.
|
||||
*Elvis*
|
||||
Elvis Another Vi clone, made by Steve Kirkendall. Very compact but isn't
|
||||
as flexible as Vim.
|
||||
The version used is 2.1. It is still being developed. Source code is
|
||||
freely available.
|
||||
|
||||
==============================================================================
|
||||
4. Notation *notation*
|
||||
|
||||
When syntax highlighting is used to read this, text that is not typed
|
||||
literally is often highlighted with the Special group. These are items in [],
|
||||
{} and <>, and CTRL-X.
|
||||
|
||||
Note that Vim uses all possible characters in commands. Sometimes the [], {}
|
||||
and <> are part of what you type, the context should make this clear.
|
||||
|
||||
|
||||
[] Characters in square brackets are optional.
|
||||
|
||||
*count* *[count]* *E489*
|
||||
[count] An optional number that may precede the command to multiply
|
||||
or iterate the command. If no number is given, a count of one
|
||||
is used, unless otherwise noted. Note that in this manual the
|
||||
[count] is not mentioned in the description of the command,
|
||||
but only in the explanation. This was done to make the
|
||||
commands easier to look up. If the 'showcmd' option is on,
|
||||
the (partially) entered count is shown at the bottom of the
|
||||
window. You can use <Del> to erase the last digit (|N<Del>|).
|
||||
|
||||
*[quotex]*
|
||||
["x] An optional register designation where text can be stored.
|
||||
See |registers|. The x is a single character between 'a' and
|
||||
'z' or 'A' and 'Z' or '"', and in some cases (with the put
|
||||
command) between '0' and '9', '%', '#', or others. The
|
||||
uppercase and lowercase letter designate the same register,
|
||||
but the lowercase letter is used to overwrite the previous
|
||||
register contents, while the uppercase letter is used to
|
||||
append to the previous register contents. Without the ""x" or
|
||||
with """" the stored text is put into the unnamed register.
|
||||
|
||||
*{}*
|
||||
{} Curly braces denote parts of the command which must appear,
|
||||
but which can take a number of different values. The
|
||||
differences between Vim and Vi are also given in curly braces
|
||||
(this will be clear from the context).
|
||||
|
||||
*{char1-char2}*
|
||||
{char1-char2} A single character from the range char1 to char2. For
|
||||
example: {a-z} is a lowercase letter. Multiple ranges may be
|
||||
concatenated. For example, {a-zA-Z0-9} is any alphanumeric
|
||||
character.
|
||||
|
||||
*{motion}*
|
||||
{motion} A command that moves the cursor. These are explained in
|
||||
|motion.txt|. Examples:
|
||||
w to start of next word
|
||||
4j four lines down
|
||||
/The<CR> to next occurrence of "The"
|
||||
This is used after an |operator| command to move over the text
|
||||
that is to be operated upon.
|
||||
- If the motion includes a count and the operator also had a
|
||||
count, the two counts are multiplied. For example: "2d3w"
|
||||
deletes six words.
|
||||
- The motion can also be a mouse click. The mouse is not
|
||||
supported in every terminal though.
|
||||
- The ":omap" command can be used to map characters while an
|
||||
operator is pending.
|
||||
- Ex commands can be used to move the cursor. This can be
|
||||
used to call a function that does some complicated motion.
|
||||
The motion is always characterwise exclusive, no matter
|
||||
what ":" command is used. This means it's impossible to
|
||||
include the last character of a line without the line break
|
||||
(unless 'virtualedit' is set).
|
||||
If the Ex command changes the text before where the operator
|
||||
start or jumps to another buffer the result is
|
||||
unpredictable. It is possible to change the text further
|
||||
down. Jumping to another buffer is possible if the current
|
||||
buffer is not unloaded.
|
||||
|
||||
*{Visual}*
|
||||
{Visual} A selected text area. It is started with the "v", "V", or
|
||||
CTRL-V command, then any cursor movement command can be used
|
||||
to change the end of the selected text.
|
||||
This is used before an |operator| command to highlight the
|
||||
text that is to be operated upon.
|
||||
See |Visual-mode|.
|
||||
|
||||
*<character>*
|
||||
<character> A special character from the table below, optionally with
|
||||
modifiers, or a single ASCII character with modifiers.
|
||||
|
||||
*'character'*
|
||||
'c' A single ASCII character.
|
||||
|
||||
*CTRL-{char}*
|
||||
CTRL-{char} {char} typed as a control character; that is, typing {char}
|
||||
while holding the CTRL key down. The case of {char} does not
|
||||
matter; thus CTRL-A and CTRL-a are equivalent. But on some
|
||||
terminals, using the SHIFT key will produce another code,
|
||||
don't use it then.
|
||||
|
||||
*'option'*
|
||||
'option' An option, or parameter, that can be set to a value, is
|
||||
enclosed in single quotes. See |options|.
|
||||
|
||||
*quotecommandquote*
|
||||
"command" A reference to a command that you can type is enclosed in
|
||||
double quotes.
|
||||
|
||||
*key-notation* *key-codes* *keycodes*
|
||||
These names for keys are used in the documentation. They can also be used
|
||||
with the ":map" command (insert the key name by pressing CTRL-K and then the
|
||||
key you want the name for).
|
||||
|
||||
notation meaning equivalent decimal value(s) ~
|
||||
-----------------------------------------------------------------------
|
||||
<Nul> zero CTRL-@ 0 (stored as 10) *<Nul>*
|
||||
<BS> backspace CTRL-H 8 *backspace*
|
||||
<Tab> tab CTRL-I 9 *tab* *Tab*
|
||||
*linefeed*
|
||||
<NL> linefeed CTRL-J 10 (used for <Nul>)
|
||||
<FF> formfeed CTRL-L 12 *formfeed*
|
||||
<CR> carriage return CTRL-M 13 *carriage-return*
|
||||
<Return> same as <CR> *<Return>*
|
||||
<Enter> same as <CR> *<Enter>*
|
||||
<Esc> escape CTRL-[ 27 *escape* *<Esc>*
|
||||
<Space> space 32 *space*
|
||||
<lt> less-than < 60 *<lt>*
|
||||
<Bslash> backslash \ 92 *backslash* *<Bslash>*
|
||||
<Bar> vertical bar | 124 *<Bar>*
|
||||
<Del> delete 127
|
||||
<CSI> command sequence intro ALT-Esc 155 *<CSI>*
|
||||
<xCSI> CSI when typed in the GUI *<xCSI>*
|
||||
|
||||
<EOL> end-of-line (can be <CR>, <LF> or <CR><LF>,
|
||||
depends on system and 'fileformat') *<EOL>*
|
||||
|
||||
<Up> cursor-up *cursor-up* *cursor_up*
|
||||
<Down> cursor-down *cursor-down* *cursor_down*
|
||||
<Left> cursor-left *cursor-left* *cursor_left*
|
||||
<Right> cursor-right *cursor-right* *cursor_right*
|
||||
<S-Up> shift-cursor-up
|
||||
<S-Down> shift-cursor-down
|
||||
<S-Left> shift-cursor-left
|
||||
<S-Right> shift-cursor-right
|
||||
<C-Left> control-cursor-left
|
||||
<C-Right> control-cursor-right
|
||||
<F1> - <F12> function keys 1 to 12 *function_key* *function-key*
|
||||
<S-F1> - <S-F12> shift-function keys 1 to 12 *<S-F1>*
|
||||
<Help> help key
|
||||
<Undo> undo key
|
||||
<Insert> insert key
|
||||
<Home> home *home*
|
||||
<End> end *end*
|
||||
<PageUp> page-up *page_up* *page-up*
|
||||
<PageDown> page-down *page_down* *page-down*
|
||||
<kHome> keypad home (upper left) *keypad-home*
|
||||
<kEnd> keypad end (lower left) *keypad-end*
|
||||
<kPageUp> keypad page-up (upper right) *keypad-page-up*
|
||||
<kPageDown> keypad page-down (lower right) *keypad-page-down*
|
||||
<kPlus> keypad + *keypad-plus*
|
||||
<kMinus> keypad - *keypad-minus*
|
||||
<kMultiply> keypad * *keypad-multiply*
|
||||
<kDivide> keypad / *keypad-divide*
|
||||
<kEnter> keypad Enter *keypad-enter*
|
||||
<kPoint> keypad Decimal point *keypad-point*
|
||||
<k0> - <k9> keypad 0 to 9 *keypad-0* *keypad-9*
|
||||
<S-...> shift-key *shift* *<S-*
|
||||
<C-...> control-key *control* *ctrl* *<C-*
|
||||
<M-...> alt-key or meta-key *meta* *alt* *<M-*
|
||||
<A-...> same as <M-...> *<A-*
|
||||
<D-...> command-key (Macintosh only) *<D-*
|
||||
<t_xx> key with "xx" entry in termcap
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
<!--
|
||||
Note: The shifted cursor keys, the help key, and the undo key are only
|
||||
available on a few terminals. On the Amiga, shifted function key 10 produces
|
||||
a code (CSI) that is also used by key sequences. It will be recognized only
|
||||
after typing another key.
|
||||
|
||||
Note: There are two codes for the delete key. 127 is the decimal ASCII value
|
||||
for the delete key, which is always recognized. Some delete keys send another
|
||||
value, in which case this value is obtained from the termcap entry "kD". Both
|
||||
values have the same effect. Also see |:fixdel|.
|
||||
|
||||
-->
|
||||
Note: The keypad keys are used in the same way as the corresponding "normal"
|
||||
keys. For example, <kHome> has the same effect as <Home>. If a keypad key
|
||||
sends the same raw key code as it non-keypad equivalent, it will be recognized
|
||||
as the non-keypad code. For example, when <kHome> sends the same code as
|
||||
<Home>, when pressing <kHome> Vim will think <Home> was pressed. Mapping
|
||||
<kHome> will not work then.
|
||||
|
||||
<!--
|
||||
*<>*
|
||||
Examples are often given in the <> notation. Sometimes this is just to make
|
||||
clear what you need to type, but often it can be typed literally, e.g., with
|
||||
the ":map" command. The rules are:
|
||||
1. Any printable characters are typed directly, except backslash and '<'
|
||||
2. A backslash is represented with "\\", double backslash, or "<Bslash>".
|
||||
3. A real '<' is represented with "\<" or "<lt>". When there is no
|
||||
confusion possible, a '<' can be used directly.
|
||||
4. "<key>" means the special key typed. This is the notation explained in
|
||||
the table above. A few examples:
|
||||
<Esc> Escape key
|
||||
<C-G> CTRL-G
|
||||
<Up> cursor up key
|
||||
<C-LeftMouse> Control- left mouse click
|
||||
<S-F11> Shifted function key 11
|
||||
<M-a> Meta- a ('a' with bit 8 set)
|
||||
<M-A> Meta- A ('A' with bit 8 set)
|
||||
<t_kd> "kd" termcap entry (cursor down key)
|
||||
|
||||
If you want to use the full <> notation in Vim, you have to make sure the '<'
|
||||
flag is excluded from 'cpoptions' (when 'compatible' is not set, it already is
|
||||
by default). >
|
||||
:set cpo-=<
|
||||
The <> notation uses <lt> to escape the special meaning of key names. Using a
|
||||
backslash also works, but only when 'cpoptions' does not include the 'B' flag.
|
||||
|
||||
Examples for mapping CTRL-H to the six characters "<Home>": >
|
||||
:imap <C-H> \<Home>
|
||||
:imap <C-H> <lt>Home>
|
||||
The first one only works when the 'B' flag is not in 'cpoptions'. The second
|
||||
one always works.
|
||||
To get a literal "<lt>" in a mapping: >
|
||||
:map <C-L> <lt>lt>
|
||||
|
||||
For mapping, abbreviation and menu commands you can then copy-paste the
|
||||
examples and use them directly. Or type them literally, including the '<' and
|
||||
'>' characters. This does NOT work for other commands, like ":set" and
|
||||
":autocmd"!
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
5. Modes, introduction *vim-modes-intro* *vim-modes*
|
||||
|
||||
IdeaVim has four BASIC modes:
|
||||
|
||||
*Normal* *Normal-mode* *command-mode*
|
||||
Normal mode In Normal mode you can enter all the normal editor
|
||||
commands. If you start the editor you are in this
|
||||
mode (unless you have set the 'insertmode' option,
|
||||
see below). This is also known as command mode.
|
||||
|
||||
Visual mode This is like Normal mode, but the movement commands
|
||||
extend a highlighted area. When a non-movement
|
||||
command is used, it is executed for the highlighted
|
||||
area. See |Visual-mode|.
|
||||
If the 'showmode' option is on "-- VISUAL --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
<!--
|
||||
Select mode This looks most like the MS-Windows selection mode.
|
||||
Typing a printable character deletes the selection
|
||||
and starts Insert mode. See |Select-mode|.
|
||||
If the 'showmode' option is on "-- SELECT --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
-->
|
||||
Insert mode In Insert mode the text you type is inserted into the
|
||||
buffer. See |Insert-mode|.
|
||||
If the 'showmode' option is on "-- INSERT --" is shown
|
||||
at the bottom of the window.
|
||||
|
||||
Command-line mode In Command-line mode (also called Cmdline mode) you
|
||||
Cmdline mode can enter one line of text at the bottom of the
|
||||
window. This is for the Ex commands, ":", the pattern
|
||||
search commands, "?" and "/", and the filter command,
|
||||
"!". |Cmdline-mode|
|
||||
|
||||
<!--
|
||||
Ex mode Like Command-line mode, but after entering a command
|
||||
you remain in Ex mode. Very limited editing of the
|
||||
command line. |Ex-mode|
|
||||
|
||||
-->
|
||||
There are four ADDITIONAL modes. These are variants of the BASIC modes:
|
||||
|
||||
*Operator-pending* *Operator-pending-mode*
|
||||
Operator-pending mode This is like Normal mode, but after an operator
|
||||
command has started, and Vim is waiting for a {motion}
|
||||
to specify the text that the operator will work on.
|
||||
|
||||
Replace mode Replace mode is a special case of Insert mode. You
|
||||
can do the same things as in Insert mode, but for
|
||||
each character you enter, one character of the existing
|
||||
text is deleted. See |Replace-mode|.
|
||||
If the 'showmode' option is on "-- REPLACE --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Insert Normal mode Entered when CTRL-O given in Insert mode. This is
|
||||
like Normal mode, but after executing one command Vim
|
||||
returns to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) --" is
|
||||
shown at the bottom of the window.
|
||||
|
||||
Insert Visual mode Entered when starting a Visual selection from Insert
|
||||
mode, e.g., by using CTRL-O and then "v", "V" or
|
||||
CTRL-V. When the Visual selection ends, Vim returns
|
||||
to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) VISUAL --"
|
||||
is shown at the bottom of the window.
|
||||
|
||||
<!--
|
||||
Insert Select mode Entered when starting Select mode from Insert mode.
|
||||
E.g., by dragging the mouse or <S-Right>.
|
||||
When the Select mode ends, Vim returns to Insert mode.
|
||||
If the 'showmode' option is on "-- (insert) SELECT --"
|
||||
is shown at the bottom of the window.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
6. Switching from mode to mode *mode-switching*
|
||||
|
||||
If for any reason you do not know which mode you are in, you can always get
|
||||
back to Normal mode by typing <Esc> twice. This doesn't work for Ex mode
|
||||
though, use ":visual".
|
||||
You will know you are back in Normal mode when you see the screen flash or
|
||||
hear the bell after you type <Esc>. However, when pressing <Esc> after using
|
||||
CTRL-O in Insert mode you get a beep but you are still in Insert mode, type
|
||||
<Esc> again.
|
||||
|
||||
*i_esc*
|
||||
<!--
|
||||
TO mode ~
|
||||
Normal Visual Select Insert Replace Cmd-line Ex ~
|
||||
FROM mode ~
|
||||
Normal v V ^V *4 *1 R : / ? ! Q
|
||||
Visual *2 ^G c C -- : --
|
||||
Select *5 ^O ^G *6 -- -- --
|
||||
Insert <Esc> -- -- <Insert> -- --
|
||||
Replace <Esc> -- -- <Insert> -- --
|
||||
Command-line *3 -- -- :start -- --
|
||||
Ex :vi -- -- -- -- --
|
||||
-->
|
||||
TO mode ~
|
||||
Normal Visual Insert Replace Cmd-line
|
||||
FROM mode
|
||||
Normal v V ^V *1 R : / ? !
|
||||
Visual *2 c C -- :
|
||||
Insert <Esc> -- <Insert> --
|
||||
Replace <Esc> -- <Insert> --
|
||||
Command-line *3 -- :start --
|
||||
|
||||
- NA
|
||||
-- not possible
|
||||
|
||||
*1 Go from Normal mode to Insert mode by giving the command "i", "I", "a",
|
||||
"A", "o", "O", "c", "C", "s" or S".
|
||||
*2 Go from Visual mode to Normal mode by giving a non-movement command, which
|
||||
causes the command to be executed, or by hitting <Esc> "v", "V" or "CTRL-V"
|
||||
(see |v_v|), which just stops Visual mode without side effects.
|
||||
*3 Go from Command-line mode to Normal mode by:
|
||||
- Hitting <CR> or <NL>, which causes the entered command to be executed.
|
||||
- Deleting the complete line (e.g., with CTRL-U) and giving a final <BS>.
|
||||
- Hitting CTRL-C or <Esc>, which quits the command-line without executing
|
||||
the command.
|
||||
<!--
|
||||
In the last case <Esc> may be the character defined with the 'wildchar'
|
||||
option, in which case it will start command-line completion. You can
|
||||
ignore that and type <Esc> again. {Vi: when hitting <Esc> the command-line
|
||||
is executed. This is unexpected for most people; therefore it was changed
|
||||
in Vim. But when the <Esc> is part of a mapping, the command-line is
|
||||
executed. If you want the Vi behaviour also when typing <Esc>, use ":cmap
|
||||
^V<Esc> ^V^M"}
|
||||
-->
|
||||
<!--
|
||||
*4 Go from Normal to Select mode by:
|
||||
- use the mouse to select text while 'selectmode' contains "mouse"
|
||||
- use a non-printable command to move the cursor while keeping the Shift
|
||||
key pressed, and the 'selectmode' option contains "key"
|
||||
- use "v", "V" or "CTRL-V" while 'selectmode' contains "cmd"
|
||||
- use "gh", "gH" or "g CTRL-H" |g_CTRL-H|
|
||||
*5 Go from Select mode to Normal mode by using a non-printable command to move
|
||||
the cursor, without keeping the Shift key pressed.
|
||||
*6 Go from Select mode to Insert mode by typing a printable character. The
|
||||
selection is deleted and the character is inserted.
|
||||
-->
|
||||
<!--
|
||||
|
||||
If the 'insertmode' option is on, editing a file will start in Insert mode.
|
||||
-->
|
||||
|
||||
*CTRL-\_CTRL-N* *i_CTRL-\_CTRL-N* *c_CTRL-\_CTRL-N* *v_CTRL-\_CTRL-N*
|
||||
Additionally the command CTRL-\ CTRL-N or <C-\><C-N> can be used to go to
|
||||
Normal mode from any other mode. This can be used to make sure Vim is in
|
||||
Normal mode, without causing a beep like <Esc> would. However, this does not
|
||||
work in Ex mode.
|
||||
|
||||
<!--
|
||||
*CTRL-\_CTRL-G* *i_CTRL-\_CTRL-G* *c_CTRL-\_CTRL-G* *v_CTRL-\_CTRL-G*
|
||||
The command CTRL-\ CTRL-G or <C-\><C-G> can be used to go to Insert mode when
|
||||
'insertmode' is set. Otherwise it goes to Normal mode. This can be used to
|
||||
make sure Vim is in the mode indicated by 'insertmode', without knowing in
|
||||
what mode Vim currently is.
|
||||
|
||||
*Q* *mode-Ex* *Ex-mode* *Ex* *EX* *E501*
|
||||
Q Switch to "Ex" mode. This is a bit like typing ":"
|
||||
commands one after another, except:
|
||||
- You don't have to keep pressing ":".
|
||||
- The screen doesn't get updated after each command.
|
||||
- There is no normal command-line editing.
|
||||
- Mappings and abbreviations are not used.
|
||||
In fact, you are editing the lines with the "standard"
|
||||
line-input editing commands (<Del> or <BS> to erase,
|
||||
CTRL-U to kill the whole line).
|
||||
Vim will enter this mode by default if it's invoked as
|
||||
"ex" on the command-line.
|
||||
Use the ":vi" command |:visual| to exit "Ex" mode.
|
||||
Note: In older versions of Vim "Q" formatted text,
|
||||
that is now done with |gq|. But if you use the
|
||||
|vimrc_example.vim| script "Q" works like "gq".
|
||||
|
||||
*gQ*
|
||||
gQ Switch to "Ex" mode, but really behave like typing ":"
|
||||
commands after another. All command line editing,
|
||||
completion etc. is available.
|
||||
Use the ":vi" command |:visual| to exit "Ex" mode.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
7. The window contents *window-contents*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
In Normal mode and Insert/Replace mode the screen window will show the current
|
||||
contents of the buffer: What You See Is What You Get. There are two
|
||||
exceptions:
|
||||
- When the 'cpoptions' option contains '$', and the change is within one line,
|
||||
the text is not directly deleted, but a '$' is put at the last deleted
|
||||
character.
|
||||
- When inserting text in one window, other windows on the same text are not
|
||||
updated until the insert is finished.
|
||||
{Vi: The screen is not always updated on slow terminals}
|
||||
|
||||
Lines longer than the window width will wrap, unless the 'wrap' option is off
|
||||
(see below). The 'linebreak' option can be set to wrap at a blank character.
|
||||
|
||||
If the window has room after the last line of the buffer, Vim will show '~' in
|
||||
the first column of the last lines in the window, like this: >
|
||||
|
||||
+-----------------------+
|
||||
|some line |
|
||||
|last line |
|
||||
|~ |
|
||||
|~ |
|
||||
+-----------------------+
|
||||
|
||||
Thus the '~' lines indicate that the end of the buffer was reached.
|
||||
|
||||
If the last line in a window doesn't fit, Vim will indicate this with a '@' in
|
||||
the first column of the last lines in the window, like this: >
|
||||
|
||||
+-----------------------+
|
||||
|first line |
|
||||
|second line |
|
||||
|@ |
|
||||
|@ |
|
||||
+-----------------------+
|
||||
|
||||
Thus the '@' lines indicate that there is a line that doesn't fit in the
|
||||
window.
|
||||
|
||||
When the "lastline" flag is present in the 'display' option, you will not see
|
||||
'@' characters at the left side of window. If the last line doesn't fit
|
||||
completely, only the part that fits is shown, and the last three characters of
|
||||
the last line are replaced with "@@@", like this: >
|
||||
|
||||
+-----------------------+
|
||||
|first line |
|
||||
|second line |
|
||||
|a very long line that d|
|
||||
|oesn't fit in the wi@@@|
|
||||
+-----------------------+
|
||||
|
||||
If there is a single line that is too long to fit in the window, this is a
|
||||
special situation. Vim will show only part of the line, around where the
|
||||
cursor is. There are no special characters shown, so that you can edit all
|
||||
parts of this line.
|
||||
{Vi: gives an "internal error" on lines that do not fit in the window}
|
||||
|
||||
The '@' occasion in the 'highlight' option can be used to set special
|
||||
highlighting for the '@' and '~' characters. This makes it possible to
|
||||
distinguish them from real characters in the buffer.
|
||||
|
||||
The 'showbreak' option contains the string to put in front of wrapped lines.
|
||||
|
||||
*wrap-off*
|
||||
If the 'wrap' option is off, long lines will not wrap. Only the part that
|
||||
fits on the screen is shown. If the cursor is moved to a part of the line
|
||||
that is not shown, the screen is scrolled horizontally. The advantage of
|
||||
this method is that columns are shown as they are and lines that cannot fit
|
||||
on the screen can be edited. The disadvantage is that you cannot see all the
|
||||
characters of a line at once. The 'sidescroll' option can be set to the
|
||||
minimal number of columns to scroll. {Vi: has no 'wrap' option}
|
||||
|
||||
All normal ASCII characters are displayed directly on the screen. The <Tab>
|
||||
is replaced with the number of spaces that it represents. Other non-printing
|
||||
characters are replaced with "^{char}", where {char} is the non-printing
|
||||
character with 64 added. Thus character 7 (bell) will be shown as "^G".
|
||||
Characters between 127 and 160 are replaced with "~{char}", where {char} is
|
||||
the character with 64 subtracted. These characters occupy more than one
|
||||
position on the screen. The cursor can only be positioned on the first one.
|
||||
|
||||
If you set the 'number' option, all lines will be preceded with their
|
||||
number. Tip: If you don't like wrapping lines to mix with the line numbers,
|
||||
set the 'showbreak' option to eight spaces:
|
||||
":set showbreak=\ \ \ \ \ \ \ \ "
|
||||
|
||||
If you set the 'list' option, <Tab> characters will not be shown as several
|
||||
spaces, but as "^I". A '$' will be placed at the end of the line, so you can
|
||||
find trailing blanks.
|
||||
|
||||
In Command-line mode only the command-line itself is shown correctly. The
|
||||
display of the buffer contents is updated as soon as you go back to Command
|
||||
mode.
|
||||
|
||||
The last line of the window is used for status and other messages. The
|
||||
status messages will only be used if an option is on:
|
||||
|
||||
status message option default Unix default ~
|
||||
current mode 'showmode' on on
|
||||
command characters 'showcmd' on off
|
||||
cursor position 'ruler' off off
|
||||
|
||||
The current mode is "-- INSERT --" or "-- REPLACE --", see |'showmode'|. The
|
||||
command characters are those that you typed but were not used yet. {Vi: does
|
||||
not show the characters you typed or the cursor position}
|
||||
|
||||
If you have a slow terminal you can switch off the status messages to speed
|
||||
up editing:
|
||||
:set nosc noru nosm
|
||||
|
||||
If there is an error, an error message will be shown for at least one second
|
||||
(in reverse video). {Vi: error messages may be overwritten with other
|
||||
messages before you have a chance to read them}
|
||||
|
||||
Some commands show how many lines were affected. Above which threshold this
|
||||
happens can be controlled with the 'report' option (default 2).
|
||||
|
||||
On the Amiga Vim will run in a CLI window. The name Vim and the full name of
|
||||
the current file name will be shown in the title bar. When the window is
|
||||
resized, Vim will automatically redraw the window. You may make the window as
|
||||
small as you like, but if it gets too small not a single line will fit in it.
|
||||
Make it at least 40 characters wide to be able to read most messages on the
|
||||
last line.
|
||||
|
||||
On most Unix systems, resizing the window is recognized and handled correctly
|
||||
by Vim. {Vi: not ok}
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
8. Definitions *definitions*
|
||||
|
||||
<!--
|
||||
screen The whole area that Vim uses to work in. This can be
|
||||
a terminal emulator window. Also called "the Vim
|
||||
window".
|
||||
window A view on a buffer.
|
||||
|
||||
A screen contains one or more windows, separated by status lines and with the
|
||||
command line at the bottom.
|
||||
|
||||
+-------------------------------+
|
||||
screen | window 1 | window 2 |
|
||||
| | |
|
||||
| | |
|
||||
|= status line =|= status line =|
|
||||
| window 3 |
|
||||
| |
|
||||
| |
|
||||
|==== status line ==============|
|
||||
|command line |
|
||||
+-------------------------------+
|
||||
|
||||
The command line is also used for messages. It scrolls up the screen when
|
||||
there is not enough room in the command line.
|
||||
|
||||
-->
|
||||
A difference is made between four types of lines:
|
||||
|
||||
buffer lines The lines in the buffer. This is the same as the
|
||||
lines as they are read from/written to a file. They
|
||||
can be thousands of characters long.
|
||||
logical lines The buffer lines with folding applied. Buffer lines
|
||||
in a closed fold are changed to a single logical line:
|
||||
"+-- 99 lines folded". They can be thousands of
|
||||
characters long.
|
||||
window lines The lines displayed in a window: A range of logical
|
||||
lines with wrapping, line breaks, etc. applied. They
|
||||
can only be as long as the width of the window allows,
|
||||
longer lines are wrapped or truncated.
|
||||
screen lines The lines of the screen that Vim uses. Consists of
|
||||
the window lines of all windows, with status lines
|
||||
and the command line added. They can only be as long
|
||||
as the width of the screen allows. When the command
|
||||
line gets longer it wraps and lines are scrolled to
|
||||
make room.
|
||||
|
||||
buffer lines logical lines window lines screen lines ~
|
||||
|
||||
1. one 1. one 1. +-- folded 1. +-- folded
|
||||
2. two 2. +-- folded 2. five 2. five
|
||||
3. three 3. five 3. six 3. six
|
||||
4. four 4. six 4. seven 4. seven
|
||||
5. five 5. seven 5. === status line ===
|
||||
6. six 6. aaa
|
||||
7. seven 7. bbb
|
||||
8. ccc ccc c
|
||||
1. aaa 1. aaa 1. aaa 9. cc
|
||||
2. bbb 2. bbb 2. bbb 10. ddd
|
||||
3. ccc ccc ccc 3. ccc ccc ccc 3. ccc ccc c 11. ~
|
||||
4. ddd 4. ddd 4. cc 12. === status line ===
|
||||
5. ddd 13. (command line)
|
||||
6. ~
|
||||
|
||||
==============================================================================
|
||||
1067
help/txt/map.txt
1067
help/txt/map.txt
File diff suppressed because it is too large
Load Diff
1370
help/txt/mbyte.txt
1370
help/txt/mbyte.txt
File diff suppressed because it is too large
Load Diff
@@ -1,777 +0,0 @@
|
||||
*message.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
This file contains an alphabetical list of messages and error messages that
|
||||
Vim produces. You can use this if you don't understand what the message
|
||||
means. It is not complete though.
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Old messages |:messages|
|
||||
2. Error messages |error-messages|
|
||||
3. Messages |messages|
|
||||
|
||||
==============================================================================
|
||||
1. Old messages *:messages* *:mes* *message-history*
|
||||
|
||||
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.
|
||||
|
||||
If you are using translated messages, the first printed line tells who
|
||||
maintains the messages or the translations. You can use this to contact the
|
||||
maintainer when you spot a mistake.
|
||||
|
||||
If you want to find help on a specific (error) message, use the ID at the
|
||||
start of the message. For example, to get help on the message: >
|
||||
|
||||
E72: Close error on swap file
|
||||
|
||||
or (translated): >
|
||||
|
||||
E72: Errore durante chiusura swap file
|
||||
|
||||
Use: >
|
||||
|
||||
:help E72
|
||||
|
||||
If you are lazy, it also works without the shift key: >
|
||||
|
||||
:help e72
|
||||
|
||||
==============================================================================
|
||||
2. Error messages *error-messages*
|
||||
|
||||
When an error message is displayed, but it is removed before you could read
|
||||
it, you can see it again with: >
|
||||
:echo errmsg
|
||||
or view a list of recent messages with: >
|
||||
:messages
|
||||
|
||||
|
||||
LIST OF MESSAGES
|
||||
*E222* *E228* *E232* *E256* *E293* *E298* *E304* *E317*
|
||||
*E318* *E356* *E438* *E439* *E440* *E316* *E320* *E322*
|
||||
*E323* *E341* *E473* *E570* >
|
||||
Add to read buffer
|
||||
makemap: Illegal mode
|
||||
Cannot create BalloonEval with both message and callback
|
||||
Hangul automata ERROR
|
||||
block was not locked
|
||||
Didn't get block nr {N}?
|
||||
ml_timestamp: Didn't get block 0??
|
||||
pointer block id wrong {N}
|
||||
Updated too many blocks?
|
||||
get_varp ERROR
|
||||
u_undo: line numbers wrong
|
||||
undo list corrupt
|
||||
undo line missing
|
||||
ml_get: cannot find line {N}
|
||||
cannot find line {N}
|
||||
line number out of range: {N} past the end
|
||||
line count wrong in block {N}
|
||||
Internal error
|
||||
fatal error in cs_manage_matches
|
||||
|
||||
This is an internal error. If you can reproduce it, please send in a bug
|
||||
report. |bugs|
|
||||
|
||||
>
|
||||
ATTENTION
|
||||
Found a swap file by the name ...
|
||||
|
||||
See |ATTENTION|.
|
||||
|
||||
*E92* >
|
||||
Buffer {N} not found
|
||||
|
||||
The buffer you requested does not exist. This can also happen when you have
|
||||
wiped out a buffer which contains a mark or is referenced in another way.
|
||||
|:bwipeout|
|
||||
|
||||
*E95* >
|
||||
Buffer with this name already exists
|
||||
|
||||
You cannot have two buffers with the same name.
|
||||
|
||||
*E72* >
|
||||
Close error on swap file
|
||||
|
||||
The |swap-file|, that is used to keep a copy of the edited text, could not be
|
||||
closed properly. Mostly harmless.
|
||||
|
||||
*E169* >
|
||||
Command too recursive
|
||||
|
||||
This happens when an Ex command executes an Ex command that executes an Ex
|
||||
command, etc. This is only allowed 200 times. When it's more there probably
|
||||
is an endless loop. Probably a |:execute| or |:source| command is involved.
|
||||
|
||||
*E254* >
|
||||
Cannot allocate color {name}
|
||||
|
||||
The color name {name} is unknown. See |gui-colors| for a list of colors that
|
||||
are available on most systems.
|
||||
|
||||
*E458* >
|
||||
Cannot allocate colormap entry for "xxxx"
|
||||
Cannot allocate colormap entry, some colors may be incorrect
|
||||
|
||||
This means that there are not enough colors available for Vim. It will still
|
||||
run, but some of the colors will not appear in the specified color. Try
|
||||
stopping other applications that use many colors, or start them after starting
|
||||
gvim.
|
||||
Netscape is known to consume a lot of colors. You can avoid this by telling
|
||||
it to use its own colormap: >
|
||||
netscape -install
|
||||
Or tell it to limit to a certain number of colors (64 should work well): >
|
||||
netscape -ncols 64
|
||||
This can also be done with a line in your Xdefaults file: >
|
||||
Netscape*installColormap: Yes
|
||||
or >
|
||||
Netscape*maxImageColors: 64
|
||||
<
|
||||
*E79* >
|
||||
Cannot expand wildcards
|
||||
|
||||
A filename contains a strange combination of characters, which causes Vim to
|
||||
attempt expanding wildcards but this fails. This does NOT mean that no
|
||||
matching file names could be found, but that the pattern was illegal.
|
||||
|
||||
*E459* >
|
||||
Cannot go back to previous directory
|
||||
|
||||
While expanding a file name, Vim failed to go back to the previously used
|
||||
directory. All file names being used may be invalid now! You need to have
|
||||
execute permission on the current directory.
|
||||
|
||||
*E190* *E212* >
|
||||
Cannot open "{filename}" for writing
|
||||
Can't open file for writing
|
||||
|
||||
For some reason the file you are writing to cannot be created or overwritten.
|
||||
The reason could be that you do not have permission to write in the directory
|
||||
or the file name is not valid.
|
||||
|
||||
*E166* >
|
||||
Can't open linked file for writing
|
||||
|
||||
You are trying to write to a file which can't be overwritten, and the file is
|
||||
a link (either a hard link or a symbolic link). Writing might still be
|
||||
possible if the directory that contains the link or the file is writable, but
|
||||
Vim now doesn't know if you want to delete the link and write the file in its
|
||||
place, or if you want to delete the file itself and write the new file in its
|
||||
place. If you really want to write the file under this name, you have to
|
||||
manually delete the link or the file, or change the permissions so that Vim
|
||||
can overwrite.
|
||||
|
||||
*E46* >
|
||||
Cannot set read-only variable "{name}"
|
||||
|
||||
You are trying to assign a value to an argument of a function |a:var| or a Vim
|
||||
internal variable |v:var| which is read-only.
|
||||
|
||||
*E90* >
|
||||
Cannot unload last buffer
|
||||
|
||||
Vim always requires one buffer to be loaded, otherwise there would be nothing
|
||||
to display in the window.
|
||||
|
||||
*E40* >
|
||||
Can't open errorfile <filename>
|
||||
|
||||
When using the ":make" or ":grep" commands: The file used to save the error
|
||||
messages or grep output cannot be opened. This can have several causes:
|
||||
- 'shellredir' has a wrong value.
|
||||
- The shell changes directory, causing the error file to be written in another
|
||||
directory. This could be fixed by changing 'makeef', but then the make
|
||||
command is still executed in the wrong directory.
|
||||
- 'makeef' has a wrong value.
|
||||
- The 'grepprg' or 'makeprg' could not be executed. This cannot always be
|
||||
detected (especially on MS-Windows). Check your $PATH.
|
||||
|
||||
>
|
||||
Can't open file C:\TEMP\VIoD243.TMP
|
||||
|
||||
On MS-Windows, this message appears when the output of an external command was
|
||||
to be read, but the command didn't run successfully. This can be caused by
|
||||
many things. Check the 'shell', 'shellquote', 'shellxquote', 'shellslash' and
|
||||
related options. It might also be that the external command was not found,
|
||||
there is no different error message for that.
|
||||
|
||||
*E12* >
|
||||
Command not allowed from exrc/vimrc in current dir or tag search
|
||||
|
||||
Some commands are not allowed for security reasons. These commands mostly
|
||||
come from a .exrc or .vimrc file in the current directory, or from a tags
|
||||
file. Also see 'secure'.
|
||||
|
||||
*E74* >
|
||||
Command too complex
|
||||
|
||||
A mapping resulted in a very long command string. Could be caused by a
|
||||
mapping that indirectly calls itself.
|
||||
|
||||
>
|
||||
CONVERSION ERROR
|
||||
|
||||
When writing a file and the text "CONVERSION ERROR" appears, this means that
|
||||
some bits were lost when converting text from the internally used UTF-8 to the
|
||||
format of the file. The file will not be marked unmodified. If you care
|
||||
about the loss of information, set the 'fileencoding' option to another value
|
||||
that can handle the characters in the buffer and write again. If you don't
|
||||
care, you can abandon the buffer or reset the 'modified' option.
|
||||
|
||||
*E302* >
|
||||
Could not rename swap file
|
||||
|
||||
When the file name changes, Vim tries to rename the |swap-file| as well.
|
||||
This failed and the old swap file is now still used. Mostly harmless.
|
||||
|
||||
*E43* *E44* >
|
||||
Damaged match string
|
||||
Corrupted regexp program
|
||||
|
||||
Something inside Vim went wrong and resulted in a corrupted regexp. If you
|
||||
know how to reproduce this problem, please report it. |bugs|
|
||||
|
||||
*E208* *E209* *E210* >
|
||||
Error writing to "{filename}"
|
||||
Error closing "{filename}"
|
||||
Error reading "{filename}"
|
||||
|
||||
This occurs when Vim is trying to rename a file, but a simple change of file
|
||||
name doesn't work. Then the file will be copied, but somehow this failed.
|
||||
The result may be that both the original file and the destination file exist
|
||||
and the destination file may be incomplete.
|
||||
|
||||
>
|
||||
Vim: Error reading input, exiting...
|
||||
|
||||
This occurs when Vim cannot read typed characters while input is required.
|
||||
Vim got stuck, the only thing it can do is exit. This can happen when both
|
||||
stdin and stderr are redirected and executing a script that doesn't exit Vim.
|
||||
|
||||
*E47* >
|
||||
Error while reading errorfile
|
||||
|
||||
Reading the error file was not possible. This is NOT caused by an error
|
||||
message that was not recognized.
|
||||
|
||||
*E80* >
|
||||
Error while writing
|
||||
|
||||
Writing a file was not completed successfully. The file is probably
|
||||
incomplete.
|
||||
|
||||
*E13* *E189* >
|
||||
File exists (use ! to override)
|
||||
"{filename}" exists (use ! to override)
|
||||
|
||||
You are protected from accidentally overwriting a file. When you want to
|
||||
write anyway, use the same command, but add a "!" just after the command.
|
||||
Example: >
|
||||
:w /tmp/test
|
||||
changes to: >
|
||||
:w! /tmp/test
|
||||
<
|
||||
*E139* >
|
||||
File is loaded in another buffer
|
||||
|
||||
You are trying to write a file under a name which is also used in another
|
||||
buffer. This would result in two versions of the same file.
|
||||
|
||||
*E142* >
|
||||
File not written: Writing is disabled by 'write' option
|
||||
|
||||
The 'write' option is off. This makes all commands that try to write a file
|
||||
generate this message. This could be caused by a |-m| commandline argument.
|
||||
You can switch the 'write' option on with ":set write".
|
||||
|
||||
*E25* >
|
||||
GUI cannot be used: Not enabled at compile time
|
||||
|
||||
You are running a version of Vim that doesn't include the GUI code. Therefore
|
||||
"gvim" and ":gui" don't work.
|
||||
|
||||
*E49* >
|
||||
Invalid scroll size
|
||||
|
||||
This is caused by setting an invalid value for the 'scroll', 'scrolljump' or
|
||||
'scrolloff' options.
|
||||
|
||||
*E17* >
|
||||
"{filename}" is a directory
|
||||
|
||||
You tried to write a file with the name of a directory. This is not possible.
|
||||
You probably need to append a file name.
|
||||
|
||||
*E19* >
|
||||
Mark has invalid line number
|
||||
|
||||
You are using a mark that has a line number that doesn't exist. This can
|
||||
happen when you have a mark in another file, and some other program has
|
||||
deleted lines from it.
|
||||
|
||||
*E219* *E220* >
|
||||
Missing {.
|
||||
Missing }.
|
||||
|
||||
Using a {} construct in a file name, but there is a { without a matching } or
|
||||
the other way around. It should be used like this: {foo,bar}. This matches
|
||||
"foo" and "bar".
|
||||
|
||||
*E315* >
|
||||
ml_get: invalid lnum:
|
||||
|
||||
This is an internal Vim error. Please try to find out how it can be
|
||||
reproduced, and submit a bug report |bugreport.vim|.
|
||||
|
||||
*E173* >
|
||||
{number} more files to edit
|
||||
|
||||
You are trying to exit, while the last item in the argument list has not been
|
||||
edited. This protects you from accidentally exiting when you still have more
|
||||
files to work on. See |argument-list|. If you do want to exit, just do it
|
||||
again and it will work.
|
||||
|
||||
*E23* *E194* >
|
||||
No alternate file
|
||||
No alternate file name to substitute for '#'
|
||||
|
||||
The alternate file is not defined yet. See |alternate-file|.
|
||||
|
||||
*E32* >
|
||||
No file name
|
||||
|
||||
The current buffer has no name. To write it, use ":w fname". Or give the
|
||||
buffer a name with ":file fname".
|
||||
|
||||
*E141* >
|
||||
No file name for buffer {number}
|
||||
|
||||
One of the buffers that was changed does not have a file name. Therefore it
|
||||
cannot be written. You need to give the buffer a file name: >
|
||||
:buffer {number}
|
||||
:file {filename}
|
||||
<
|
||||
*E33* >
|
||||
No previous substitute regular expression
|
||||
|
||||
When using the '~' character in a pattern, it is replaced with the previously
|
||||
used pattern in a ":substitute" command. This fails when no such command has
|
||||
been used yet. See |/~|.
|
||||
|
||||
*E35* >
|
||||
No previous regular expression
|
||||
|
||||
When using an empty search pattern, the previous search pattern is used. But
|
||||
that is not possible if there was no previous search.
|
||||
|
||||
*E24* >
|
||||
No such abbreviation
|
||||
|
||||
You have used an ":unabbreviate" command with an argument which is not an
|
||||
existing abbreviation. All variations of this command give the same message:
|
||||
":cunabbrev", ":iunabbrev", etc. Check for trailing white space.
|
||||
|
||||
>
|
||||
/dev/dsp: No such file or directory
|
||||
|
||||
Only given for GTK GUI with Gnome support. Gnome tries to use the audio
|
||||
device and it isn't present. You can ignore this error.
|
||||
|
||||
*E31* >
|
||||
No such mapping
|
||||
|
||||
You have used an ":unmap" command with an argument which is not an existing
|
||||
mapping. All variations of this command give the same message: ":cunmap",
|
||||
":unmap!", etc. Check for trailing white space.
|
||||
|
||||
*E37* *E89* >
|
||||
No write since last change (use ! to override)
|
||||
No write since last change for buffer {N} (use ! to override)
|
||||
|
||||
You are trying to |abandon| a file that has changes. Vim protects you from
|
||||
losing your work. You can either write the changed file with ":w", or, if you
|
||||
are sure, |abandon| it anyway, and lose all the changes. This can be done by
|
||||
adding a '!' character just after the command you used. Example: >
|
||||
:e other_file
|
||||
changes to: >
|
||||
:e! other_file
|
||||
<
|
||||
*E162* >
|
||||
No write since last change for buffer "{name}"
|
||||
|
||||
This appears when you try to exit Vim while some buffers are changed. You
|
||||
will either have to write the changed buffer (with |:w|), or use a command to
|
||||
abandon the buffer forcefully, e.g., with ":qa!". Careful, make sure you
|
||||
don't throw away changes you really want to keep. You might have forgotten
|
||||
about a buffer, especially when 'hidden' is set.
|
||||
|
||||
*E38* >
|
||||
Null argument
|
||||
|
||||
Something inside Vim went wrong and resulted in a NULL pointer. If you know
|
||||
how to reproduce this problem, please report it. |bugs|
|
||||
|
||||
*E172* >
|
||||
Only one file name allowed
|
||||
|
||||
The ":edit" command only accepts one file name. When you want to specify
|
||||
several files for editing use ":next" |:next|.
|
||||
|
||||
*E41* *E82* *E83* *E342* >
|
||||
Out of memory!
|
||||
Out of memory! (allocating {number} bytes)
|
||||
Cannot allocate any buffer, exiting...
|
||||
Cannot allocate buffer, using other one...
|
||||
|
||||
Oh, oh. You must have been doing something complicated, or some other program
|
||||
is consuming your memory. Be careful! Vim is not completely prepared for an
|
||||
out-of-memory situation. First make sure that any changes are saved. Then
|
||||
try to solve the memory shortage. To stay on the safe side, exit Vim and
|
||||
start again. Also see |msdos-limitations|.
|
||||
|
||||
*E339* >
|
||||
Pattern too long
|
||||
|
||||
This only happens on systems with 16 bit ints: The compiled regexp pattern is
|
||||
longer than about 65000 characters. Try using a shorter pattern.
|
||||
|
||||
*E45* >
|
||||
'readonly' option is set (use ! to override)
|
||||
|
||||
You are trying to write a file that was marked as read-only. To write the
|
||||
file anyway, either reset the 'readonly' option, or add a '!' character just
|
||||
after the command you used. Example: >
|
||||
:w
|
||||
changes to: >
|
||||
:w!
|
||||
<
|
||||
*E294* *E295* *E301* >
|
||||
Read error in swap file
|
||||
Seek error in swap file read
|
||||
Oops, lost the swap file!!!
|
||||
|
||||
Vim tried to read text from the |swap-file|, but something went wrong. The
|
||||
text in the related buffer may now be corrupted! Check carefully before you
|
||||
write a buffer. You may want to write it in another file and check for
|
||||
differences.
|
||||
|
||||
*E192* >
|
||||
Recursive use of :normal too deep
|
||||
|
||||
You are using a ":normal" command, whose argument again uses a ":normal"
|
||||
command in a recursive way. This is restricted to 'maxmapdepth' levels. This
|
||||
example illustrates how to get this message: >
|
||||
:map gq :normal gq<CR>
|
||||
If you type "gq", it will execute this mapping, which will call "gq" again.
|
||||
|
||||
*E22* >
|
||||
Scripts nested too deep
|
||||
|
||||
Scripts can be read with the "-s" command-line argument and with the ":source"
|
||||
command. The script can then again read another script. This can continue
|
||||
for about 14 levels. When more nesting is done, Vim assumes that there is a
|
||||
recursive loop somewhere and stops with this error message.
|
||||
|
||||
*E319* >
|
||||
Sorry, the command is not available in this version
|
||||
|
||||
You have used a command that is not present in the version of Vim you are
|
||||
using. When compiling Vim, many different features can be enabled or
|
||||
disabled. This depends on how big Vim has chosen to be and the operating
|
||||
system. See |+feature-list| for when which feature is available. The
|
||||
|:version| command shows which feature Vim was compiled with.
|
||||
|
||||
*E300* >
|
||||
Swap file already exists (symlink attack?)
|
||||
|
||||
This message appears when Vim is trying to open a swap file and finds it
|
||||
already exists or finds a symbolic link in its place. This shouldn't happen,
|
||||
because Vim already checked that the file doesn't exist. Either someone else
|
||||
opened the same file at exactly the same moment (very unlikely) or someone is
|
||||
attempting a symlink attack (could happen when editing a file in /tmp or when
|
||||
'directory' starts with "/tmp", which is a bad choice).
|
||||
|
||||
*E432* >
|
||||
Tags file not sorted: {file name}
|
||||
|
||||
Vim (and Vi) expect tags files to be sorted in ASCII order. Binary searching
|
||||
can then be used, which is a lot faster than a linear search. If your tags
|
||||
files are not properly sorted, reset the |'tagbsearch'| option.
|
||||
This message is only given when Vim detects a problem when searching for a
|
||||
tag. Sometimes this message is not given, even thought the tags file is not
|
||||
properly sorted.
|
||||
|
||||
*E460* >
|
||||
The resource fork would be lost (add ! to override)
|
||||
|
||||
On the Macintosh (classic), when writing a file, Vim attempts to preserve all
|
||||
info about a file, including its resource fork. If this is not possible you
|
||||
get this error message. Append "!" to the command name to write anyway (and
|
||||
lose the info).
|
||||
|
||||
*E424* >
|
||||
Too many different highlighting attributes in use
|
||||
|
||||
Vim can only handle about 223 different kinds of highlighting. If you run
|
||||
into this limit, you have used too many |:highlight| commands with different
|
||||
arguments. A ":highlight link" is not counted.
|
||||
|
||||
*E77* >
|
||||
Too many file names
|
||||
|
||||
When expanding file names, more than one match was found. Only one match is
|
||||
allowed for the command that was used.
|
||||
|
||||
*E303* >
|
||||
Unable to open swap file for "{filename}", recovery impossible
|
||||
|
||||
Vim was not able to create a swap file. You can still edit the file, but if
|
||||
Vim unexpected exits the changes will be lost. And Vim may consume a lot of
|
||||
memory when editing a big file. You may want to change the 'directory' option
|
||||
to avoid this error. See |swap-file|.
|
||||
|
||||
*E140* >
|
||||
Use ! to write partial buffer
|
||||
|
||||
When using a range to write part of a buffer, it is unusual to overwrite the
|
||||
original file. It is probably a mistake (e.g., when Visual mode was active
|
||||
when using ":w"), therefore Vim requires using a ! after the command, e.g.:
|
||||
":3,10w!".
|
||||
>
|
||||
|
||||
Warning: Cannot convert string "<Key>Escape,_Key_Cancel" to type
|
||||
VirtualBinding
|
||||
|
||||
Messages like this appear when starting up. This is not a Vim problem, your
|
||||
X11 configuration is wrong. You can find a hint on how to solve this here:
|
||||
http://groups.yahoo.com/group/solarisonintel/message/12179.
|
||||
|
||||
*W10* >
|
||||
Warning: Changing a readonly file
|
||||
|
||||
The file is read-only and you are making a change to it anyway. You can use
|
||||
the |FileChangedRO| autocommand event to avoid this message (the autocommand
|
||||
must reset the 'readonly' option). See 'modifiable' to completely disallow
|
||||
making changes to a file.
|
||||
|
||||
*W13* >
|
||||
Warning: File "{filename}" has been created after editing started
|
||||
|
||||
You are editing a file in Vim when it didn't exist, but it does exist now.
|
||||
You will have to decide if you want to keep the version in Vim or the newly
|
||||
created file. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W11* >
|
||||
Warning: File "{filename}" has changed since editing started
|
||||
|
||||
The file which you have started editing has got another timestamp and the
|
||||
contents changed (more precisely: When reading the file again with the current
|
||||
option settings and autocommands you would end up with different text). This
|
||||
probably means that some other program changed the file. You will have to
|
||||
find out what happened, and decide which version of the file you want to keep.
|
||||
Set the 'autoread' option if you want to do this automatically.
|
||||
This message is not given when 'buftype' is not empty.
|
||||
|
||||
There is one situation where you get this message even though there is nothing
|
||||
wrong: If you save a file in Windows on the day the daylight saving time
|
||||
starts. It can be fixed in one of these ways:
|
||||
- Add this line in your autoexec.bat: >
|
||||
SET TZ=-1
|
||||
< Adjust the "-1" for your time zone.
|
||||
- Disable "automatically adjust clock for daylight saving changes".
|
||||
- Just write the file again the next day. Or set your clock to the next day,
|
||||
write the file twice and set the clock back.
|
||||
|
||||
*W12* >
|
||||
Warning: File "{filename}" has changed and the buffer was changed in Vim as well
|
||||
|
||||
Like the above, and the buffer for the file was changed in this Vim as well.
|
||||
You will have to decide if you want to keep the version in this Vim or the one
|
||||
on disk. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W16* >
|
||||
Warning: Mode of file "{filename}" has changed since editing started
|
||||
|
||||
When the timestamp for a buffer was changed and the contents are still the
|
||||
same but the mode (permissions) have changed. This usually occurs when
|
||||
checking out a file from a version control system, which causes the read-only
|
||||
bit to be reset. It should be safe to reload the file. Set 'autoread' to
|
||||
automatically reload the file.
|
||||
|
||||
*E211* >
|
||||
Warning: File "{filename}" no longer available
|
||||
|
||||
The file which you have started editing has disappeared, or is no longer
|
||||
accessible. Make sure you write the buffer somewhere to avoid losing
|
||||
changes. This message is not given when 'buftype' is not empty.
|
||||
|
||||
*W14* >
|
||||
Warning: List of file names overflow
|
||||
|
||||
You must be using an awful lot of buffers. It's now possible that two buffers
|
||||
have the same number, which causes various problems. You might want to exit
|
||||
Vim and restart it.
|
||||
|
||||
*E296* *E297* >
|
||||
Seek error in swap file write
|
||||
Write error in swap file
|
||||
|
||||
This mostly happens when the disk is full. Vim could not write text into the
|
||||
|swap-file|. It's not directly harmful, but when Vim unexpectedly exits some
|
||||
text may be lost without recovery being possible. Vim might run out of memory
|
||||
when this problem persists.
|
||||
|
||||
*connection-refused* >
|
||||
Xlib: connection to "<machine-name:0.0" refused by server
|
||||
|
||||
This happens when Vim tries to connect to the X server, but the X server does
|
||||
not allow a connection. The connection to the X server is needed to be able
|
||||
to restore the title and for the xterm clipboard support. Unfortunately this
|
||||
error message cannot be avoided, except by disabling the |+xterm_clipboard|
|
||||
and |+X11| features.
|
||||
|
||||
*E10* >
|
||||
\\ should be followed by /, ? or &
|
||||
|
||||
A command line started with a backslash or the range of a command contained a
|
||||
backslash in a wrong place. This is often caused by command-line continuation
|
||||
being disabled. Remove the 'C' flag from the 'cpoptions' option to enable it.
|
||||
|
||||
*E471* >
|
||||
Argument required
|
||||
|
||||
This happens when an Ex command with mandatory argument(s) was executed, but
|
||||
no argument has been specified.
|
||||
|
||||
*E474* *E475* >
|
||||
Invalid argument
|
||||
|
||||
An Ex command has been executed, but an invalid argument has been specified.
|
||||
|
||||
*E488* >
|
||||
Trailing characters
|
||||
|
||||
An argument has been added to an Ex command that does not permit one.
|
||||
|
||||
*E477* *E478* >
|
||||
No ! allowed
|
||||
Don't panic!
|
||||
|
||||
You have added a "!" after an Ex command that doesn't permit one.
|
||||
|
||||
*E481* >
|
||||
No range allowed
|
||||
|
||||
A range was specified for an Ex command that doesn't permit one. See
|
||||
|cmdline-ranges|.
|
||||
|
||||
*E482* *E483* >
|
||||
Can't create file {filename}
|
||||
Can't get temp file name
|
||||
|
||||
Vim cannot create a temporary file.
|
||||
|
||||
*E484* *E485* >
|
||||
Can't open file %s"
|
||||
Can't read file %s"
|
||||
|
||||
Vim cannot read a temporary file.
|
||||
|
||||
*E464* >
|
||||
Ambiguous use of user-defined command
|
||||
|
||||
There are two user-defined commands with a common name prefix, and you used
|
||||
Command-line completion to execute one of them. |user-cmd-abmiguous|
|
||||
Example: >
|
||||
:command MyCommand1 echo "one"
|
||||
:command MyCommand2 echo "two"
|
||||
:MyCommand
|
||||
<
|
||||
*E492* >
|
||||
Not an editor command
|
||||
|
||||
You tried to execute a command that is neither an Ex command nor
|
||||
a user-defined command.
|
||||
|
||||
==============================================================================
|
||||
3. Messages *messages*
|
||||
|
||||
This is an (incomplete) overview of various messages that Vim gives:
|
||||
|
||||
*hit-enter* *press-enter* *hit-return* *press-return* >
|
||||
|
||||
Hit ENTER or type command to continue
|
||||
|
||||
This message is given when there is something on the screen for you to read,
|
||||
and the screen is about to be redrawn:
|
||||
- After executing an external command (e.g., ":!ls" and "=").
|
||||
- Something is displayed on the status line that is longer than the width of
|
||||
the window, or runs into the 'showcmd' or 'ruler' output.
|
||||
|
||||
-> Hit <Enter> or <Space> to redraw the screen and continue, without that key
|
||||
being used otherwise.
|
||||
-> Hit ":" or any other Normal mode command character to start that command.
|
||||
-> Hit <C-Y> to copy (yank) a modeless selection to the clipboard register.
|
||||
-> Use a menu. The characters defined for Cmdline-mode are used.
|
||||
-> When 'mouse' contians the 'r' flag, clicking the left mouse button works
|
||||
like pressing <Space>. This makes it impossible to select text though.
|
||||
-> For the GUI clicking the left mouse button in the last line works like
|
||||
pressing <Space>.
|
||||
{Vi: only ":" commands are interpreted}
|
||||
|
||||
To reduce the number of hit-enter prompts:
|
||||
- Set 'cmdheight' to 2 or higher.
|
||||
- Add flags to 'shortmess'.
|
||||
- Reset 'showcmd' and/or 'ruler'.
|
||||
|
||||
Also see 'mouse'. The hit-enter message is highlighted with the |hl-Question|
|
||||
group.
|
||||
|
||||
|
||||
*more-prompt* *pager* >
|
||||
-- More --
|
||||
-- More -- (RET: line, SPACE: page, d: half page, q: quit)
|
||||
-- More -- (RET/BS: line, SPACE/b: page, d/u: half page, q: quit)
|
||||
|
||||
This message is given when the screen is filled with messages. It is only
|
||||
given when the 'more' option is on. It is highlighted with the |hl-MoreMsg|
|
||||
group.
|
||||
|
||||
Type effect ~
|
||||
<CR> or <NL> or j or <Down> one more line
|
||||
<BS> or k or <Up> one line back (*)
|
||||
<Space> or <PageDown> next page
|
||||
b or <PageUp> previous page (*)
|
||||
d down half a page
|
||||
u up half a page (*)
|
||||
q, <Esc> or CTRL-C stop the listing
|
||||
: stop the listing and enter a
|
||||
command-line
|
||||
<C-Y> yank (copy) a modeless selection to
|
||||
the clipboard ("* and "+ registers)
|
||||
{menu-entry} what the menu is defined to in
|
||||
Cmdline-mode.
|
||||
<LeftMouse> (**) next page
|
||||
|
||||
Any other key causes the meaning of the keys to be displayed.
|
||||
|
||||
(*) backwards scrolling is only supported for these commands: >
|
||||
:clist
|
||||
(**) Clicking the left mouse button only works:
|
||||
- For the GUI: in the last line of the screen.
|
||||
- When 'r' is included in 'mouse' (but then selecting text won't work).
|
||||
|
||||
|
||||
Note: The typed key is directly obtained from the terminal, it is not mapped
|
||||
and typeahead is ignored.
|
||||
-->
|
||||
|
||||
@@ -1,205 +0,0 @@
|
||||
*mlang.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Multi-language features *multilang* *multi-lang*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
This is about using messages and menus in various languages. For editing
|
||||
multi-byte text see |multibyte|.
|
||||
|
||||
The basics are explained in the user manual: |usr_45.txt|.
|
||||
|
||||
1. Messages |multilang-messages|
|
||||
2. Menus |multilang-menus|
|
||||
3. Scripts |multilang-scripts|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
{not available when compiled without the |+multi_lang| feature}
|
||||
|
||||
==============================================================================
|
||||
1. Messages *multilang-messages*
|
||||
|
||||
Vim picks up the locale from the environment. In most cases this means Vim
|
||||
will use the language that you prefer, unless it's not available.
|
||||
|
||||
To see a list of supported locale names on your system, look in one of these
|
||||
directories (for Unix):
|
||||
/usr/lib/locale ~
|
||||
/usr/share/locale ~
|
||||
Unfortunately, upper/lowercase differences matter. Also watch out for the
|
||||
use of "-" and "_".
|
||||
|
||||
*:lan* *:lang* *:language* *E197*
|
||||
:lan[guage]
|
||||
:lan[guage] mes[sages]
|
||||
:lan[guage] cty[pe]
|
||||
:lan[guage] tim[e]
|
||||
Print the current language (aka locale).
|
||||
With the "messages" argument the language used for
|
||||
messages is printed. Technical: LC_MESSAGES.
|
||||
With the "ctype" argument the language used for
|
||||
character encoding is printed. Technical: LC_CTYPE.
|
||||
With the "time" argument the language used for
|
||||
strftime() is printed. Technical: LC_TIME.
|
||||
Without argument all parts of the locale are printed
|
||||
(this is system dependent).
|
||||
The current language can also be obtained with the
|
||||
|v:lang|, |v:ctype| and |v:lc_time| variables.
|
||||
|
||||
:lan[guage] {name}
|
||||
:lan[guage] mes[sages] {name}
|
||||
:lan[guage] cty[pe] {name}
|
||||
:lan[guage] tim[e] {name}
|
||||
Set the current language (aka locale) to {name}.
|
||||
The locale {name} must be a valid locale on your
|
||||
system. Some systems accept aliases like "en" or
|
||||
"en_US", but some only accept the full specification
|
||||
like "en_US.ISO_8859-1".
|
||||
With the "messages" argument the language used for
|
||||
messages is set. This can be different when you want,
|
||||
for example, English messages while editing Japanese
|
||||
text. This sets $LC_MESSAGES.
|
||||
With the "ctype" argument the language used for
|
||||
character encoding is set. This affects the libraries
|
||||
that Vim was linked with. It's unusual to set this to
|
||||
a different value from 'encoding'. This sets
|
||||
$LC_CTYPE.
|
||||
With the "time" argument the language used for time
|
||||
and date messages is set. This affects strftime().
|
||||
This sets $LC_TIME.
|
||||
Without an argument both are set, and additionally
|
||||
$LANG is set.
|
||||
This will make a difference for items that depend on
|
||||
the language (some messages, time and date format).
|
||||
Not fully supported on all systems
|
||||
If this fails there will be an error message. If it
|
||||
succeeds there is no message. Example: >
|
||||
:language
|
||||
Current language: C
|
||||
:language de_DE.ISO_8859-1
|
||||
:language mes
|
||||
Current messages language: de_DE.ISO_8859-1
|
||||
:lang mes en
|
||||
<
|
||||
|
||||
MS-WINDOWS MESSAGE TRANSLATIONS *win32-gettext*
|
||||
|
||||
If you used the self-installing .exe file, message translations should work
|
||||
already. Otherwise get the libintl.dll file if you don't have it yet:
|
||||
|
||||
http://sourceforge.net/projects/gettext
|
||||
|
||||
This also contains tools xgettext, msgformat and others.
|
||||
|
||||
libintl.dll should be placed in same directory with (g)vim.exe, or some
|
||||
place where PATH environment value describe. Message files (vim.mo)
|
||||
have to be placed in "$VIMRUNTIME/lang/xx/LC_MESSAGES", where "xx" is the
|
||||
abbreviation of the language (mostly two letters).
|
||||
|
||||
If you write your own translations you need to generate the .po file and
|
||||
convert it to a .mo file. You need to get the source distribution and read
|
||||
the file "src/po/README.txt".
|
||||
|
||||
To overrule the automatic choice of the language, set the $LANG variable to
|
||||
the language of your choice. use "en" to disable translations. >
|
||||
|
||||
:let $LANG = 'ja'
|
||||
|
||||
(text for Windows by Muraoka Taro)
|
||||
|
||||
==============================================================================
|
||||
2. Menus *multilang-menus*
|
||||
|
||||
See |45.2| for the basics.
|
||||
|
||||
Note that if changes have been made to the menus after the translation was
|
||||
done, some of the menus may be shown in English. Please try contacting the
|
||||
maintainer of the translation and ask him to update it. You can find the
|
||||
name and e-mail address of the translator in
|
||||
"$VIMRUNTIME/lang/menu_<lang>.vim".
|
||||
|
||||
To set the font (or fontset) to use for the menus, use the |:highlight|
|
||||
command. Example: >
|
||||
|
||||
:highlight Menu font=k12,r12
|
||||
|
||||
|
||||
ALIAS LOCALE NAMES
|
||||
|
||||
Unfortunately, the locale names are different on various systems, even though
|
||||
they are for the same language and encoding. If you do not get the menu
|
||||
translations you expected, check the output of this command: >
|
||||
|
||||
echo v:lang
|
||||
|
||||
Now check the "$VIMRUNTIME/lang" directory for menu translation files that use
|
||||
a similar language. A difference in a "-" being a "_" already causes a file
|
||||
not to be found! Another common difference to watch out for is "iso8859-1"
|
||||
versus "iso_8859-1". Fortunately Vim makes all names lowercase, thus you
|
||||
don't have to worry about case differences. Spaces are changed to
|
||||
underscores, to avoid having to escape them.
|
||||
|
||||
If you find a menu translation file for your language with a different name,
|
||||
create a file in your own runtime directory to load that one. The name of
|
||||
that file could be: >
|
||||
|
||||
~/.vim/lang/menu_<v:lang>.vim
|
||||
|
||||
Check the 'runtimepath' option for directories which are searched. In that
|
||||
file put a command to load the menu file with the other name: >
|
||||
|
||||
runtime lang/menu_<other_lang>.vim
|
||||
|
||||
|
||||
TRANSLATING MENUS
|
||||
|
||||
If you want to do your own translations, you can use the |:menutrans| command,
|
||||
explained below. It is recommended to put the translations for one language
|
||||
in a Vim script. For a language that has no translation yet, please consider
|
||||
becoming the maintainer and make your translations available to all Vim users.
|
||||
Send an e-mail to the Vim maintainer <maintainer@vim.org>.
|
||||
|
||||
*:menut* *:menutrans* *:menutranslate*
|
||||
:menut[ranslate] clear
|
||||
Clear all menu translations.
|
||||
|
||||
:menut[ranslate] {english} {mylang}
|
||||
Translate menu name {english} to {mylang}. All
|
||||
special characters like "&" and "<Tab>" need to be
|
||||
included. Spaces and dots need to be escaped with a
|
||||
backslash, just like in other |:menu| commands.
|
||||
|
||||
See the $VIMRUNTIME/lang directory for examples.
|
||||
|
||||
To try out your translations you first have to remove all menus. This is how
|
||||
you can do it without restarting Vim: >
|
||||
:source $VIMRUNTIME/delmenu.vim
|
||||
:source <your-new-menu-file>
|
||||
:source $VIMRUNTIME/menu.vim
|
||||
|
||||
Each part of a menu path is translated separately. The result is that when
|
||||
"Help" is translated to "Hilfe" and "Overview" to "<22>berblick" then
|
||||
"Help.Overview" will be translated to "Hilfe.<2E>berblick".
|
||||
|
||||
==============================================================================
|
||||
3. Scripts *multilang-scripts*
|
||||
|
||||
In Vim scripts you can use the |v:lang| variable to get the current language
|
||||
(locale). The default value is "C" or comes from the $LANG environment
|
||||
variable.
|
||||
|
||||
The following example shows how this variable is used in a simple way, to make
|
||||
a message adapt to language preferences of the user, >
|
||||
|
||||
:if v:lang =~ "de_DE"
|
||||
: echo "Guten Morgen"
|
||||
:else
|
||||
: echo "Good morning"
|
||||
:endif
|
||||
<
|
||||
-->
|
||||
|
||||
1080
help/txt/motion.txt
1080
help/txt/motion.txt
File diff suppressed because it is too large
Load Diff
@@ -1,654 +0,0 @@
|
||||
*netbeans.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
NetBeans ExternalEditor Integration Features *netbeans*
|
||||
*netbeans-support*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Introduction |netbeans-intro|
|
||||
2. NetBeans Key Bindings |netbeans-keybindings|
|
||||
3. Configuring Vim for NetBeans |netbeans-configure|
|
||||
4. Downloading NetBeans |netbeans-download|
|
||||
5. Preparing NetBeans for Vim |netbeans-preparation|
|
||||
6. Obtaining the External Editor Module |obtaining-exted|
|
||||
7. Setting up NetBeans to run with Vim |netbeans-setup|
|
||||
8. Messages |netbeans-messages|
|
||||
9. Running Vim from Netbeans |netbeans-run|
|
||||
10. Netbeans protocol |netbeans-protocol|
|
||||
11. Known problems |netbeans-problems|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
{only available when compiled with the |+netbeans_intg| feature}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *netbeans-intro*
|
||||
|
||||
NetBeans is an open source Integrated Development Environment developed
|
||||
jointly by Sun Microsystems, Inc. and the netbeans.org developer community.
|
||||
Initialy just a Java IDE, NetBeans has had C, C++, and Fortran support added
|
||||
in recent releases.
|
||||
|
||||
For more information visit the main NetBeans web site http://www.netbeans.org
|
||||
or the NetBeans External Editor site at http://externaleditor.netbeans.org.
|
||||
|
||||
Sun Microsystems, Inc. also ships NetBeans under the name Sun ONE Studio.
|
||||
Visit http://www.sun.com for more information regarding the Sun ONE Studio
|
||||
product line.
|
||||
|
||||
Current releases of NetBeans provide full support for Java and limited support
|
||||
for C, C++, and Fortran. Current releases of Sun ONE Studio provide full
|
||||
support for Java, C, C++, and Fortran.
|
||||
|
||||
The interface to NetBeans is also supported by Agide, the A-A-P GUI IDE.
|
||||
Agide is very different from NetBeans:
|
||||
- Based on Python instead of Java, much smaller footprint and fast startup.
|
||||
- Agide is a framework in which many different tools can work together.
|
||||
See the A-A-P website for information: http://www.A-A-P.org.
|
||||
|
||||
==============================================================================
|
||||
2. NetBeans Key Bindings *netbeans-keybindings*
|
||||
|
||||
Vim understands a number of key bindings that execute NetBeans commands. These
|
||||
are typically all the Function key combinations. To execute a NetBeans command,
|
||||
the user must press the Pause key followed by a NetBeans key binding. For
|
||||
example, in order to compile a Java file, the NetBeans key binding is "F9". So,
|
||||
while in vim, press "Pause F9" to compile a java file. To toggle a breakpoint
|
||||
at the current line, press "Pause Shift F8".
|
||||
|
||||
The Pause key is Function key 21. If you don't have a working Pause key and
|
||||
want to use F8 instead, use: >
|
||||
|
||||
:map <F8> <F21>
|
||||
|
||||
The External Editor module dynamically reads the NetBeans key bindings so vim
|
||||
should always have the latest key bindings, even when NetBeans changes them.
|
||||
|
||||
==============================================================================
|
||||
3. Configuring Vim for NetBeans *netbeans-configure*
|
||||
|
||||
When running configure without arguments the NetBeans interface should be
|
||||
included. That is, if the configure check to find out if your system supports
|
||||
the required features succeeds.
|
||||
|
||||
In case you do not want the NetBeans interface you can disable it by
|
||||
uncommenting a line with "--disable-netbeans" in the Makefile.
|
||||
|
||||
Currently, only gvim is supported in this integration as NetBeans does not
|
||||
have means to supply a terminal emulator for the vim command. Furthermore,
|
||||
there is only GUI support for GTK, GNOME, and Motif.
|
||||
|
||||
If Motif support is required the user must supply XPM libraries. See
|
||||
|workshop-xpm| for details on obtaining the latest version of XPM.
|
||||
|
||||
For more help installing vim, please read |usr_90.txt| in the Vim User Manual.
|
||||
|
||||
==============================================================================
|
||||
4. Downloading NetBeans *netbeans-download*
|
||||
|
||||
The NetBeans IDE is available for download from netbeans.org. You can download
|
||||
a released version, download sources, or use CVS to download the current
|
||||
source tree. If you choose to download sources, follow directions from
|
||||
netbeans.org on building NetBeans.
|
||||
|
||||
Depending on the version of NetBeans you download, you may need to do further
|
||||
work to get the required External Editor module. This is the module which lets
|
||||
NetBeans work with gvim (or xemacs :-). See http://externaleditor.netbeans.org
|
||||
for details on downloading this module if your NetBeans release does not have
|
||||
it.
|
||||
|
||||
For C, C++, and Fortran support you will also need the cpp module. See
|
||||
http://cpp.netbeans.org for information regarding this module.
|
||||
|
||||
You can also download Sun ONE Studio from Sun Microsystems, Inc for a 30 day
|
||||
free trial. See http://www.sun.com for further details.
|
||||
|
||||
==============================================================================
|
||||
5. Preparing NetBeans for Vim *netbeans-preparation*
|
||||
|
||||
In order for NetBeans to work with vim, the NetBeans External Editor module
|
||||
must be loaded and enabled. If you have a Sun ONE Studio Enterprise Edition
|
||||
then this module should be loaded and enabled. If you have a NetBeans release
|
||||
you may need to find another way of obtaining this open source module.
|
||||
|
||||
You can check if you have this module by opening the Tools->Options dialog
|
||||
and drilling down to the "Modules" list (IDE Configuration->System->Modules).
|
||||
If your Modules list has an entry for "External Editor" you must make sure
|
||||
it is enabled (the "Enabled" property should have the value "True"). If your
|
||||
Modules list has no External Editor see the next section on |obtaining-exted|.
|
||||
|
||||
==============================================================================
|
||||
6. Obtaining the External Editor Module *obtaining-exted*
|
||||
|
||||
There are 2 ways of obtaining the External Editor module. The easiest way
|
||||
is to use the NetBeans Update Center to download and install the module.
|
||||
Unfortunately, some versions do not have this module in their update
|
||||
center. If you cannot download via the update center you will need to
|
||||
download sources and build the module. I will try and get the module
|
||||
available from the NetBeans Update Center so building will be unnecesary.
|
||||
Also check http://externaleditor.netbeans.org for other availability options.
|
||||
|
||||
To download the External Editor sources via CVS and build your own module,
|
||||
see http://externaleditor.netbeans.org and http://www.netbeans.org.
|
||||
Unfortunately, this is not a trivial procedure.
|
||||
|
||||
==============================================================================
|
||||
7. Setting up NetBeans to run with Vim *netbeans-setup*
|
||||
|
||||
Assuming you have loaded and enabled the NetBeans External Editor module
|
||||
as described in |netbeans-preparation| all you need to do is verify that
|
||||
the gvim command line is properly configured for your environment.
|
||||
|
||||
Open the Tools->Options dialog and open the Editing category. Select the
|
||||
External Editor. The right hand pane should contain a Properties tab and
|
||||
an Expert tab. In the Properties tab make sure the "Editor Type" is set
|
||||
to "Vim". In the Expert tab make sure the "Vim Command" is correct.
|
||||
|
||||
You should be carefull if you change the "Vim Command". There are command
|
||||
line options there which must be there for the connection to be properly
|
||||
set up. You can change the command name but thats about it. If your gvim
|
||||
can be found by your $PATH then the VIM Command can start with "gvim". If
|
||||
you don't want gvim searched from your $PATH then hard code in the full
|
||||
Unix path name. At this point you should get a gvim for any source file
|
||||
you open in NetBeans.
|
||||
|
||||
If some files come up in gvim and others (with different file suffixes) come
|
||||
up in the default NetBeans editor you should verify the MIME type in the
|
||||
Expert tab MIME Type property. NetBeans is MIME oriented and the External
|
||||
Editor will only open MIME types specified in this property.
|
||||
|
||||
==============================================================================
|
||||
8. Messages *netbeans-messages*
|
||||
|
||||
These messages are specific for Netbeans:
|
||||
|
||||
*E463*
|
||||
Region is guarded, cannot modify
|
||||
Netbeans defines guarded areas in the text, which you cannot
|
||||
change.
|
||||
|
||||
==============================================================================
|
||||
9. Running Vim from Netbeans *netbeans-run*
|
||||
|
||||
Netbeans starts Vim with the |-nb| argument. The full form is: >
|
||||
-nb:{hostname}:{addr}:{password}
|
||||
|
||||
{hostname} is the name of the machine where Netbeans is running. When omitted
|
||||
the environment variable "__NETBEANS_HOST" is used or the default "localhost".
|
||||
|
||||
{addr} is the port number for Netbeans. When omitted the environment variable
|
||||
"__NETBEANS_SOCKET" is used or the default 3219.
|
||||
|
||||
{password} is the password for connecting to Netbeans. When omitted the
|
||||
environment variable "__NETBEANS_VIM_PASSWORD" is used or "changeme".
|
||||
|
||||
==============================================================================
|
||||
10. Netbeans protocol *netbeans-protocol*
|
||||
|
||||
The communication between Netbeans and Vim uses plain text messages. This
|
||||
protocol was first designed to work with the external editor module of
|
||||
Netbeans (see http://externaleditor.netbeans.org). Later it was extended to
|
||||
work with Agide (A-A-P GUI IDE, see http://www.a-a-p.org). The extensions are
|
||||
marked with "version 2.1".
|
||||
|
||||
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.
|
||||
|
||||
10.1 Kinds of messages |nb-messages|
|
||||
10.2 Terms |nb-terms|
|
||||
10.3 Commands |nb-commands|
|
||||
10.4 Functions and Replies |nb-functions|
|
||||
10.5 Events |nb-events|
|
||||
10.6 Special messages |nb-special|
|
||||
|
||||
*E627* *E628* *E629* *E630* *E631* *E632* *E633* *E634* *E635* *E636*
|
||||
*E637* *E638* *E639* *E640* *E641* *E642* *E643* *E644* *E645* *E646*
|
||||
*E647* *E648* *E649* *E650* *E651* *E652* *E653* *E654*
|
||||
These errors occur when a message violates the protocol.
|
||||
|
||||
|
||||
10.1 Kinds of messages *nb-messages*
|
||||
|
||||
There are four kinds of messages:
|
||||
|
||||
kind direction comment ~
|
||||
Command IDE -> editor no reply necessary
|
||||
Function IDE -> editor editor must send back a reply
|
||||
Reply editor -> IDE only in response to a Function
|
||||
Event editor -> IDE no reply necessary
|
||||
|
||||
The messages are sent as a single line with a terminating newline character.
|
||||
Arguments are separated by a single space. The first item of the message
|
||||
depends on the kind of message:
|
||||
|
||||
kind first item example ~
|
||||
Command bufID:name!seqno 11:showBalloon!123 "text"
|
||||
Function bufID:name/seqno 11:getLength/123
|
||||
Reply seqno 123 5000
|
||||
Event bufID:name=123 11:keyCommand=123 "S-F2"
|
||||
|
||||
|
||||
10.2 Terms *nb-terms*
|
||||
|
||||
bufID Buffer number. A message may be either for a specific buffer
|
||||
or generic. Generic messages use a bufID of zero. NOTE: this
|
||||
buffer ID is assigned by the IDE, it is not Vim's buffer
|
||||
number. The bufID must be a sequentially rising number,
|
||||
starting at one.
|
||||
|
||||
seqno The IDE uses a sequence number for Commands and Functions. A
|
||||
Reply must use the sequence number of the Function that it is
|
||||
associated with. A zero sequence number can be used for
|
||||
Events (the seqno of the last received Command or Function can
|
||||
also be used).
|
||||
|
||||
string Argument in double quotes. Text is in UTF-8 encoding. This
|
||||
means ASCII is passed as-is. Special characters are
|
||||
represented with a backslash:
|
||||
\" double quote
|
||||
\n newline
|
||||
\r carriage-return
|
||||
\t tab (optional, also works literally)
|
||||
\\ backslash
|
||||
NUL bytes are not allowed!
|
||||
|
||||
boolean Argument with two possible values:
|
||||
T true
|
||||
F false
|
||||
|
||||
number Argument with a decimal number.
|
||||
|
||||
optnum Argument with either a decimal number or "none" (without the
|
||||
quotes).
|
||||
|
||||
offset A number argument that indicates a byte position in a buffer.
|
||||
The first byte has offset zero. Line breaks are counted for
|
||||
how they appear in the file (CR/LF counts for two bytes).
|
||||
Note that a multi-byte character is counted for the number of
|
||||
bytes it takes.
|
||||
|
||||
lnum/col Argument with a line number and column number position. The
|
||||
line number starts with one, the column is the byte position,
|
||||
starting with zero. Note that a multi-byte character counts
|
||||
for several columns.
|
||||
|
||||
pathname String argument: file name with full path.
|
||||
|
||||
|
||||
10.3 Commands *nb-commands*
|
||||
|
||||
actionMenuItem Not implemented.
|
||||
|
||||
actionSensitivity
|
||||
Not implemented.
|
||||
|
||||
addAnno serNum typeNum off len
|
||||
Place an annotation in this buffer.
|
||||
Arguments:
|
||||
serNum number serial number of this placed
|
||||
annotation, used to be able to remove
|
||||
it
|
||||
typeNum number sequence number of the annotation
|
||||
defined with defineAnnoType for this
|
||||
buffer
|
||||
off number offset where annotion is to be placed
|
||||
len number not used
|
||||
In version 2.1 "lnum/col" can be used instead of "off".
|
||||
|
||||
balloonResult text
|
||||
Not implemented.
|
||||
|
||||
close Close the buffer. This leaves us without current buffer, very
|
||||
dangerous to use!
|
||||
|
||||
create Creates a buffer without a name. Replaces the current buffer
|
||||
(it's hidden when it was changed).
|
||||
Netbeans uses this as the first command for a file that is
|
||||
being opened. The sequence of commands could be:
|
||||
create
|
||||
setCaretListener (ignored)
|
||||
setModified (no effect)
|
||||
setContentType (ignored)
|
||||
startDocumentListen
|
||||
setTitle
|
||||
setFullName
|
||||
|
||||
defineAnnoType typeNum typeName tooltip glyphFile fg bg
|
||||
Define a type of annotation for this buffer.
|
||||
Arguments:
|
||||
typeNum number sequence number (not really used)
|
||||
typeName string name that identifies this annotation
|
||||
tooltip string not used
|
||||
glyphFile string name of icon file
|
||||
fg optnum foreground color for line highlighting
|
||||
bg optnum background color for line highlighting
|
||||
Vim will define a sign for the annotation.
|
||||
When both "fg" and "bg" are "none" no line highlighting is
|
||||
used (new in version 2.1).
|
||||
When "glyphFile" is empty, no text sign is used (new in
|
||||
version 2.1).
|
||||
When "glyphFile" is one or two characters long, a text sign is
|
||||
defined (new in version 2.1).
|
||||
Note: the annotations will be defined in sequence, and the
|
||||
sequence number is later used with addAnno.
|
||||
|
||||
editFile pathname
|
||||
Set the name for the buffer and edit the file "pathname", a
|
||||
string argument.
|
||||
Normal way for the IDE to tell the editor to edit a file. If
|
||||
the IDE is going to pass the file text to the editor use these
|
||||
commands instead:
|
||||
setFullName
|
||||
insert
|
||||
initDone
|
||||
New in version 2.1.
|
||||
|
||||
enableBalloonEval
|
||||
Not implemented.
|
||||
|
||||
endAtomic End an atomic operation. The changes between "startAtomic"
|
||||
and "endAtomic" can be undone as one operation. But it's not
|
||||
implemented yet. Redraw when necessary.
|
||||
|
||||
guard off len
|
||||
Mark an area in the buffer as guarded. This means it cannot
|
||||
be edited. "off" and "len" are numbers and specify the text
|
||||
to be guarded.
|
||||
|
||||
initDone Mark the buffer as ready for use. Implicitly makes the buffer
|
||||
the current buffer. Fires the BufReadPost autocommand event.
|
||||
|
||||
moveAnnoToFront serNum
|
||||
Not implemented.
|
||||
|
||||
putBufferNumber pathname
|
||||
Associate a buffer number with the Vim buffer by the name
|
||||
"pathname", a string argument. To be used when the editor
|
||||
repored editing another file to the IDE and the IDE needs to
|
||||
tell the editor what buffer number it will use for this file.
|
||||
Also marks the buffer as initialized.
|
||||
New in version 2.1.
|
||||
|
||||
raise Bring the editor to the foreground.
|
||||
New in version 2.1.
|
||||
|
||||
removeAnno serNum
|
||||
Remove a previously place annotation for this buffer.
|
||||
"serNum" is the same number used in addAnno.
|
||||
|
||||
setAsUser Not implemented.
|
||||
|
||||
setBufferNumber pathname
|
||||
Associate a buffer number with Vim buffer by the name
|
||||
"pathname". To be used when the editor reported editing
|
||||
another file to the IDE and the IDE needs to tell the editor
|
||||
what buffer number it will use for this file.
|
||||
Has the side effect of making the buffer the current buffer.
|
||||
See "putBufferNumber" for a more useful command.
|
||||
|
||||
setContentType
|
||||
Not implemented.
|
||||
|
||||
setDot off Make the buffer the current buffer and set the cursor at the
|
||||
specified position.
|
||||
In version 2.1 "lnum/col" can be used instead of "off".
|
||||
|
||||
setExitDelay seconds
|
||||
Set the delay for exiting to "seconds", a number.
|
||||
This delay is used to give the IDE a chance to handle things
|
||||
before really exiting. The default delay is two seconds.
|
||||
New in version 2.1.
|
||||
|
||||
setFullName pathname
|
||||
Set the file name to be used for a buffer to "pathname", a
|
||||
string argument.
|
||||
Used when the IDE wants to edit a file under control of the
|
||||
IDE. This makes the buffer the current buffer, but does not
|
||||
read the file. "insert" commands will be used next to set the
|
||||
contents.
|
||||
|
||||
setLocAndSize Not implemented.
|
||||
|
||||
setMark Not implemented.
|
||||
|
||||
setModified modified
|
||||
When the boolean argument "modified" is "T" mark the buffer as
|
||||
modified, when it is "F" mark it as unmodified.
|
||||
|
||||
setReadOnly Not implemented.
|
||||
|
||||
setStyle Not implemented.
|
||||
|
||||
setTitle name
|
||||
Set the title for the buffer to "name", a string argument.
|
||||
The title is only used for Netbeans functions, not by Vim.
|
||||
|
||||
setVisible visible
|
||||
When the boolean argument "visible" is "T", goto the buffer.
|
||||
The "F" argument does nothing.
|
||||
|
||||
showBalloon text
|
||||
Show a balloon (popup window) at the mouse pointer position,
|
||||
containing "text", a string argument. The balloon should
|
||||
disappear when the mouse is moved more than a few pixels.
|
||||
New in version 2.1.
|
||||
|
||||
specialKeys Not implemented.
|
||||
|
||||
startAtomic Begin an atomic operation. The screen will not be updated
|
||||
until "endAtomic" is given.
|
||||
|
||||
startCaretListen
|
||||
Not implemented.
|
||||
|
||||
startDocumentListen
|
||||
Mark the buffer to report changes to the IDE with the
|
||||
"insert" and "remove" events. The default is to report
|
||||
changes.
|
||||
|
||||
stopCaretListen
|
||||
Not implemented.
|
||||
|
||||
stopDocumentListen
|
||||
Mark the buffer to stop reporting changes to the IDE.
|
||||
Opposite of startDocumentListen.
|
||||
|
||||
unguard off len
|
||||
Opposite of "guard", remove guarding for a text area.
|
||||
|
||||
version Not implemented.
|
||||
|
||||
|
||||
10.4 Functions and Replies *nb-functions*
|
||||
|
||||
getDot Not implemented.
|
||||
|
||||
getCursor Return the current buffer and cursor position.
|
||||
The reply is:
|
||||
seqno bufID lnum col off
|
||||
seqno = sequence number of the function
|
||||
bufID = buffer ID of the current buffer (if this is unknown -1
|
||||
is used)
|
||||
lnum = line number of the cursor (first line is one)
|
||||
col = column number of the cursor (in bytes, zero based)
|
||||
off = offset of the cursor in the buffer (in bytes)
|
||||
New in version 2.1.
|
||||
|
||||
getLength Return the length of the buffer in bytes.
|
||||
Reply example for a buffer with 5000 bytes:
|
||||
123 5000
|
||||
TODO: explain use of partial line.
|
||||
|
||||
getMark Not implemented.
|
||||
|
||||
getModified When a buffer is specified: Return zero if the buffer does not
|
||||
have changes, one if it does have changes.
|
||||
When no buffer is specified (buffer number zero): Return the
|
||||
number of buffers with changes. When the result is zero it's
|
||||
safe to tell Vim to exit.
|
||||
New in version 2.1.
|
||||
|
||||
getText Return the contents of the buffer as a string.
|
||||
Reply example for a buffer with two lines
|
||||
123 "first line\nsecond line\n"
|
||||
NOTE: docs indicate an offset and length argument, but this is
|
||||
not implemented.
|
||||
|
||||
insert off text
|
||||
Insert "text" before position "off". "text" is a string
|
||||
argument, "off" a number.
|
||||
Possible replies:
|
||||
123 no problem
|
||||
123 !message failed
|
||||
Note that the message in the reply is not quoted.
|
||||
|
||||
remove off length
|
||||
Delete "length" bytes of text at position "off". Both
|
||||
arguments are numbers.
|
||||
Possible replies:
|
||||
123 no problem
|
||||
123 !message failed
|
||||
Note that the message in the reply is not quoted.
|
||||
|
||||
saveAndExit Perform the equivalent of closing Vim: ":confirm qall".
|
||||
If there are no changed files or the user does not cancel the
|
||||
operation Vim exits and no result is sent back. The IDE can
|
||||
consider closing the connection as a successful result.
|
||||
If the user cancels the operation the number of modified
|
||||
buffers that remains is returned and Vim does not exit.
|
||||
New in version 2.1.
|
||||
|
||||
|
||||
10.5 Events *nb-events*
|
||||
|
||||
balloonEval off len type
|
||||
The mouse pointer rests on text for a short while. When "len"
|
||||
is zero, there is no selection and the pointer is at position
|
||||
"off". When "len" is non-zero the text from position "off" to
|
||||
"off" + "len" is selected.
|
||||
Only sent after "enableBalloonEval" was used for this buffer.
|
||||
"type" is not yet defined.
|
||||
Not implemented yet.
|
||||
|
||||
balloonText text
|
||||
Used when 'ballooneval' is set and the mouse pointer rests on
|
||||
some text for a moment. "text" is a string, the text under
|
||||
the mouse pointer.
|
||||
New in version 2.1.
|
||||
|
||||
fileClosed Not implemented.
|
||||
|
||||
fileModified Not implemented.
|
||||
|
||||
fileOpened pathname open modified
|
||||
A file was opened by the user.
|
||||
Arguments:
|
||||
pathname string name of the file
|
||||
open boolean always "F"
|
||||
modified boolean always "F"
|
||||
|
||||
geometry cols rows x y
|
||||
Report the size and position of the editor window.
|
||||
Arguments:
|
||||
cols number number of text columns
|
||||
rows number number of text rows
|
||||
x number pixel position on screen
|
||||
y number pixel position on screen
|
||||
Only works for Motif.
|
||||
|
||||
insert off text
|
||||
Text "text" has been inserted in Vim at position "off".
|
||||
Only fired when enabled, see "startDocumentListen".
|
||||
|
||||
invokeAction Not implemented.
|
||||
|
||||
keyCommand keyName
|
||||
Reports a special key being pressed with name "keyName", which
|
||||
is a string.
|
||||
Supported key names:
|
||||
F1 function key 1
|
||||
F2 function key 2
|
||||
...
|
||||
F12 function key 12
|
||||
|
||||
' ' space (without the quotes)
|
||||
! exclamation mark
|
||||
... any other ASCII printable character
|
||||
~ tilde
|
||||
|
||||
X any unrecognized key
|
||||
|
||||
The key may be prepended by "C", "S" and/or "M" for Control,
|
||||
Shift and Meta (Alt) modifiers. If there is a modifier a dash
|
||||
is used to separate it from the key name. For example:
|
||||
"C-F2".
|
||||
ASCII characters are new in version 2.1.
|
||||
|
||||
keyAtPos keyName lnum/col
|
||||
Like "keyCommand" and also report the line number and column
|
||||
of the cursor.
|
||||
New in version 2.1.
|
||||
|
||||
killed A file was closed by the user. Only for files that have been
|
||||
assigned a number by the IDE.
|
||||
|
||||
newDotAndMark off off
|
||||
Reports the position of the cursor being at "off" bytes into
|
||||
the buffer. Only sent just before a "keyCommand" event.
|
||||
|
||||
quit Not implemented.
|
||||
|
||||
remove off len
|
||||
Text was deleted in Vim at position "off" with byte length
|
||||
"len".
|
||||
Only fired when enabled, see "startDocumentListen".
|
||||
|
||||
revert Not implemented.
|
||||
|
||||
save The buffer has been saved and is now unmodified.
|
||||
Only fired when enabled, see "startDocumentListen".
|
||||
|
||||
startupDone The editor has finished its startup work and is ready for
|
||||
editing files.
|
||||
New in version 2.1.
|
||||
|
||||
unmodified The buffer is now unmodified.
|
||||
Only fired when enabled, see "startDocumentListen".
|
||||
|
||||
version vers Report the version of the interface implementation. Vim
|
||||
reports "2.1" (including the quotes).
|
||||
|
||||
|
||||
10.6 Special messages *nb-special*
|
||||
|
||||
These messages do not follow the style of the messages above. They are
|
||||
terminated by a newline character.
|
||||
|
||||
ACCEPT Not used.
|
||||
|
||||
AUTH password editor -> IDE: First message that the editor sends to the IDE.
|
||||
Must contain the password for the socket server, as specified
|
||||
with the |-nb| argument. No quotes are used!
|
||||
|
||||
DISCONNECT IDE -> editor: break the connection. The editor will exit.
|
||||
The IDE must only send this message when there are no unsaved
|
||||
changes!
|
||||
|
||||
DETACH IDE -> editor: break the connection without exiting the
|
||||
editor. Used when the IDE exits without bringing down the
|
||||
editor as well.
|
||||
New in version 2.1.
|
||||
|
||||
REJECT Not used.
|
||||
|
||||
==============================================================================
|
||||
11. Known problems *netbeans-problems*
|
||||
|
||||
NUL bytes are not possible. For editor -> IDE they will appear as NL
|
||||
characters. For IDE -> editor they cannot be inserted.
|
||||
-->
|
||||
|
||||
6673
help/txt/options.txt
6673
help/txt/options.txt
File diff suppressed because it is too large
Load Diff
1140
help/txt/pattern.txt
1140
help/txt/pattern.txt
File diff suppressed because it is too large
Load Diff
@@ -1,217 +0,0 @@
|
||||
*pi_expl.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
*file-explorer* *file-browser*
|
||||
Plugin for exploring (or browsing) directories and files
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Starting the file explorer |expl-starting|
|
||||
|
||||
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_explorer" variable: >
|
||||
:let loaded_explorer = 1
|
||||
|
||||
{Vi does not have any of this}
|
||||
|
||||
==============================================================================
|
||||
1. Starting the file explorer *expl-starting*
|
||||
|
||||
This plugin is used to explore directories inside Vim. The file explorer is
|
||||
launched whenever the user tries to edit a directory.
|
||||
*:Explore* *:Sexplore*
|
||||
To launch the explorer in the directory of the file currently edited: >
|
||||
:Explore
|
||||
If the file has changes the window is split. To always split the window: >
|
||||
:Sexplore
|
||||
To launch the explorer in a specific directory: >
|
||||
:Explore dirname
|
||||
:Sexplore dirname
|
||||
|
||||
From inside the explorer move your cursor to a line containing a file or
|
||||
directory name. The following command keys are available:
|
||||
|
||||
<enter> will open the file in the window the explorer is currently
|
||||
occupying.
|
||||
'o' will split a new window and open the file in the new window.
|
||||
'O' will open the file chosen using the window that the cursor was in just
|
||||
before you started or entered the explorer window. If the explorer is
|
||||
the only window, it will first split a new window to use for the file to
|
||||
be opened.
|
||||
'p' will open (or use) the preview window showing the file
|
||||
'x' will execute the file with the system tools. Only when supported
|
||||
(currently MS-Windows and KDE).
|
||||
|
||||
When splitting off a new window, you can control where the split window will
|
||||
go relative to the explorer window using the variables g:explVertical,
|
||||
g:explSplitBelow and g:explSplitRight.
|
||||
|
||||
*g:explVertical*
|
||||
*g:explSplitBelow*
|
||||
*g:explSplitRight*
|
||||
*g:explStartBelow*
|
||||
*g:explStartRight*
|
||||
To control whether the split is made horizontally or vertically, use: >
|
||||
let g:explVertical=1 " Split vertically
|
||||
let g:explVertical=0 " Split horizontally (default)
|
||||
|
||||
To control where the window goes relative to the explorer window when
|
||||
splitting horizontally, use the variable: >
|
||||
let g:explSplitBelow=1 " Put new window below explorer window
|
||||
let g:explSplitBelow=0 " Put new window above explorer window
|
||||
The default for this is the setting of splitbelow at the time the plugin is
|
||||
loaded.
|
||||
|
||||
To control where the windows goes relative to the explorer window when
|
||||
splitting vertically, use the variable: >
|
||||
let g:explSplitRight=1 " Put new window to the right of the explorer
|
||||
let g:explSplitRight=0 " Put new window to the left of the explorer
|
||||
The default for this is the setting of splitright at the time the plugin is
|
||||
loaded.
|
||||
|
||||
To use a different split method for the explorer window, use: >
|
||||
let g:explStartRight=1 " Put new explorer window to the right of the
|
||||
" current window
|
||||
let g:explStartRight=0 " Put new explorer window to the left of the
|
||||
" current window
|
||||
The default for this set to g:explSplitRight at the time the plugin is loaded.
|
||||
|
||||
To use a different split method for the explorer window, use: >
|
||||
let g:explStartBelow=1 " Put new explorer window below the
|
||||
" current window
|
||||
let g:explStartBelow=0 " Put new explorer window above the
|
||||
" current window
|
||||
The default for this set to g:explSplitBelow at the time the plugin is loaded.
|
||||
|
||||
The start splits allow for the explorer window to be placed in a file browser
|
||||
type arrangement, where the directories are shown on the left and the contents
|
||||
opened on the right. The start split settings are only used when issuing
|
||||
the Sexplore command.
|
||||
|
||||
Note that the window split is done a little bit differently than window splits
|
||||
are usually done. Ordinarily, when splitting a window, the space occupied by
|
||||
the current window will be split to give space for the new window. The
|
||||
explorer attempts to instead split from a window adjacent to the explorer
|
||||
window so that the explorer window will not change sizes. If there is not an
|
||||
adjacent window in the direction you are splitting, the explorer window is
|
||||
split.
|
||||
|
||||
*g:explWinSize*
|
||||
After opening a file with the 'o' command, you might want to resize the
|
||||
explorer window. This can be done by setting the variable >
|
||||
let g:explWinSize=N
|
||||
N is the number of rows (when the window is split horizontally) or the number
|
||||
of columns (when the window is split vertically). If g:explWinSize is set to
|
||||
an empty string (""), resizing will not be done. g:explWinSize defaults to
|
||||
15.
|
||||
|
||||
*g:explDetailedList*
|
||||
The file size (in bytes) and modification time can be displayed inside the
|
||||
file explorer window. By pressing 'i', you can toggle between the name only
|
||||
display and the more lengthy display. If you want the size and date to show
|
||||
by default, use >
|
||||
let g:explDetailedList=1
|
||||
Doing this may slightly slow down explorer. The difference may or may not be
|
||||
noticeable depending on your system and whether the directory is local or on
|
||||
the network and on the size of the directory.
|
||||
|
||||
*g:explDateFormat*
|
||||
The format of date displayed is configurable using the variable
|
||||
g:explDateFormat. explorer uses this variable to pass to strftime() to fetch
|
||||
the date information. |strftime()| The default is >
|
||||
let g:explDateFormat="%d %b %Y %H:%M"
|
||||
|
||||
Note that for sorting purposes, the date is always placed at the end of the
|
||||
line in its 'raw' form. If you have syntax highlighting turned on, this raw
|
||||
date should be invisible.
|
||||
|
||||
*g:explHideFiles*
|
||||
You can hide some files by filling the variable g:explHidFiles with regular
|
||||
expressions. A filename that matches any of these regular expressions will not
|
||||
be shown. For example, >
|
||||
|
||||
let g:explHideFiles='^\.,\.gz$,\.exe$,\.zip$'
|
||||
|
||||
will not show files that begin with "." and those that end in .gz, .exe or
|
||||
.zip. However, all directory names will always be shown. If while exploring,
|
||||
you'd like to see the hidden files as well, use the command "a".
|
||||
The explorer header will indicate if filtering is being done.
|
||||
|
||||
*g:explDetailedHelp*
|
||||
The help information spanning a few lines can be turned off (and just a single
|
||||
help message enabled) using the option >
|
||||
let g:explDetailedHelp=0
|
||||
You can anytime switch to the detailed help format by pressing ?.
|
||||
|
||||
*explorer-delete*
|
||||
Pressing 'D' inside explorer deletes the file under the cursor. You can delete
|
||||
many files by visually selecting them and using 'D'. The deletion is
|
||||
interactive in the form y/n/a/q. Directory deletion is not supported (mainly
|
||||
because there is no way to delete a directory using a vim built-in function).
|
||||
|
||||
*explorer-rename*
|
||||
Pressing 'R' inside explorer will allow you to rename the file under the
|
||||
cursor.
|
||||
|
||||
*g:explSortBy*
|
||||
The display in the file explorer can be sorted in forward or reverse order by
|
||||
name, size, or modification date. You can set the default sorting direction
|
||||
with the option >
|
||||
let g:explSortBy='name' " alphabetically
|
||||
let g:explSortBy='reverse name' " reverse alphabetically
|
||||
let g:explSortBy='date' " newest first
|
||||
let g:explSortBy='reverse date' " oldest first
|
||||
let g:explSortBy='size' " largest first
|
||||
let g:explSortBy='reverse size' " smallest first
|
||||
While in the explorer, you can rotate through the sort fields by pressing the
|
||||
's' key and you can reverse the current sort order by pressing the 'r' key.
|
||||
Sorting on fields other than the name will be faster if the size and date are
|
||||
displayed (using 'i' or g:explDetailedList).
|
||||
The explorer heading will indicate the current sort order.
|
||||
|
||||
*g:explDirsFirst*
|
||||
To control the segregation of directories and files, you can set this option >
|
||||
let g:explDirsFirst=1 " Directories at the top of the list (default)
|
||||
let g:explDirsFirst=0 " Directories mixed in with files
|
||||
let g:explDirsFirst=-1 " Directories at the bottom of the list
|
||||
|
||||
*g:explSuffixesLast*
|
||||
To control the segregation of files matching the suffixes option, you can set
|
||||
this option >
|
||||
let g:explSuffixesLast=1 " Files matching suffixes sorted at the bottom
|
||||
" of the list (default)
|
||||
let g:explSuffixesLast=0 " Files matching suffixes sorted normally
|
||||
let g:explSuffixesLast=-1 " Files matching suffixes sorted at the top of
|
||||
" the list
|
||||
The heading will indicate if suffixes have been moved to the end (or start) of
|
||||
the list.
|
||||
|
||||
*g:explUseSeparators*
|
||||
Directories and files matching the suffixes list will be highlighted. If you
|
||||
have the directories, files, and suffixes separated, and you would like a
|
||||
separator line between the groups, you can set the option >
|
||||
let g:explUseSeparators=1 " Use separator lines
|
||||
let g:explUseSeparators=0 " Don't use separator lines
|
||||
<
|
||||
*g:explFileHandler*
|
||||
If you set the "g:explFileHandler" variable to the name of a function, typing
|
||||
'x' will call this function. The file or directory under the cursor will be
|
||||
passed as an argument to the function. Suppose you have KDE, you could use
|
||||
this: >
|
||||
|
||||
function MyFileHandler(fn)
|
||||
exec "silent! !kfmclient exec " . escape(a:fn,' \%#')
|
||||
endfunction
|
||||
let g:explFileHandler = 'MyFileHandler'
|
||||
|
||||
For Win32 the variable is set by default to invoke the execute action. If you
|
||||
type 'x' on a HTML file, Microsoft Internet Explorer will start (or whatever
|
||||
application you have associated with HTML files).
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
*pi_gzip.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Editing compressed files with Vim *gzip* *bzip2* *compress*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Autocommands |gzip-autocmd|
|
||||
|
||||
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_gzip" variable: >
|
||||
:let loaded_gzip = 1
|
||||
|
||||
{Vi does not have any of this}
|
||||
|
||||
==============================================================================
|
||||
1. Autocommands *gzip-autocmd*
|
||||
|
||||
The plugin installs autocommands to intercept reading and writing of files
|
||||
with these extensions:
|
||||
|
||||
extension compression ~
|
||||
*.Z compress (Lempel-Ziv)
|
||||
*.gz gzip
|
||||
*.bz2 bzip2
|
||||
|
||||
That's actually the only thing you need to know. There are no options.
|
||||
|
||||
After decompressing a file, the filetype will be detected again. This will
|
||||
make a file like "foo.c.gz" get the "c" filetype.
|
||||
|
||||
If you have 'patchmode' set, it will be appended after the extension for
|
||||
compression. Thus editing the patchmode file will not give you the automatic
|
||||
decompression. You have to rename the file if you want this.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,365 +0,0 @@
|
||||
*pi_netrw.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
*ftp* *http* *scp* *rcp* *Nread* *Nwrite* *netrw* *netrw.vim* *network*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Network-Oriented File Transfers with Vim
|
||||
|
||||
1. Network-Oriented File Transfer |netrw-xfer|
|
||||
2. Activation |netrw-activate|
|
||||
3. Ex Commands |netrw-ex|
|
||||
4. Variables |netrw-var|
|
||||
5. User Options |netrw-options|
|
||||
6. Debugging |netrw-debug|
|
||||
|
||||
The functionality mentioned here is done via using |standard-plugin|
|
||||
techniques. This plugin is only available if
|
||||
|
||||
set nocp " 'compatible' is not set
|
||||
filetype plugin on " plugins are enabled
|
||||
|
||||
You can avoid loading this plugin by setting the "loaded_netrw" variable: >
|
||||
|
||||
:let loaded_netrw = 1
|
||||
|
||||
{Vi does not have any of this}
|
||||
|
||||
==============================================================================
|
||||
1. 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 writing across networks using rcp, scp, ftp or ftp+<.netrc>,
|
||||
dav/cadaver, or rsync.
|
||||
|
||||
http is currently supported read-only by using wget.
|
||||
|
||||
Ftp, an old protocol, seems to be blessed by numerous implementations.
|
||||
Unfortunately, some implementations are noisy (ie., add junk to the end of the
|
||||
file). Thus, concerned users may decide to write a NetReadFixup() function
|
||||
that will clean up after reading with their ftp. Some Unix systems (ie.,
|
||||
FreeBSD) provide a utility called "fetch" which uses the ftp protocol but is
|
||||
not noisy and more convenient, actually, for <netrw.vim> to use.
|
||||
Consequently, if "fetch" is executable, it will be used to do reads for
|
||||
ftp://... (and http://...) . See |netrw-var| for more about this.
|
||||
|
||||
For rcp, scp, and http, one may use network-oriented file transfers
|
||||
transparently; ie.
|
||||
>
|
||||
vim rcp://[user@]machine/path
|
||||
vim scp://[user@]machine/path
|
||||
<
|
||||
If your ftp supports <.netrc>, then it too can be just as transparently used
|
||||
if the needed triad of machine name, user id, and password are present in that
|
||||
file. Your ftp must be able to use the <.netrc> file on its own, however.
|
||||
>
|
||||
vim ftp://[user@]machine/path
|
||||
<
|
||||
However, ftp will often need to query the user for the userid and password.
|
||||
The latter will be done "silently"; ie. asterisks will show up instead of the
|
||||
actually-typed-in password. Netrw will retain the userid and password for
|
||||
subsequent read/writes from the most recent transfer so subsequent transfers
|
||||
(read/write) to or from that machine will take place without additional
|
||||
prompting.
|
||||
|
||||
+==============================+==============================+============+
|
||||
| Reading | Writing | Uses |
|
||||
+==============================+==============================+============+
|
||||
| RCP: | | |
|
||||
| rcp://[user@]machine/path | rcp://[user@]machine/path | rcp |
|
||||
| :Nread rcp://machine/path | :Nwrite rcp://machine/path | rcp |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| SCP: | | |
|
||||
| scp://[user@]machine/path | scp://[user@]machine/path | scp |
|
||||
| :Nread scp://machine/path | :Nwrite scp://machine/path | scp (*1) |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| FTP: | | |
|
||||
| ftp://[user@]machine/path | ftp://[user@]machine/path | ftp (*2) |
|
||||
| :Nread ftp://machine/path | :Nwrite ftp://machine/path | ftp+.netrc|
|
||||
| :Nread machine path | :Nwrite machine path | ftp+.netrc|
|
||||
| :Nread machine uid pass path| :Nwrite machine uid pass path| ftp |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| FTP: if fetch is present... | | |
|
||||
| ftp://[user@]machine/path | ftp://[user@]machine/path | fetch |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| HTTP: | | |
|
||||
| http://[user@]machine/path | | wget |
|
||||
| :Nread http://machine/path | | wget |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| HTTP: if fetch is present... | | |
|
||||
| http://[user@]machine/path | | fetch |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| DAV: | | |
|
||||
| dav://machine/path | | cadaver |
|
||||
| :Nread dav://machine/path | :Nwrite dav://machine/path | cadaver |
|
||||
+------------------------------+------------------------------+------------+
|
||||
| RSYNC: | | |
|
||||
| rsync://[user@]machine/path | rsync://[user@]machine/path | rsync |
|
||||
| :Nread rsync://machine/path | :Nwrite rsync://machine/path | rsync |
|
||||
+==============================+==============================+============+
|
||||
(*1) For an absolute path use scp://machine//path.
|
||||
(*2) if <.netrc> is present, it is assumed that it will
|
||||
work with your ftp client. Otherwise the script will
|
||||
prompt for user-id and pasword.
|
||||
(*3) for ftp, "machine" may be machine#port if a different
|
||||
port is needed than the standard ftp port
|
||||
|
||||
Both the :Nread and the :Nwrite ex-commands can accept multiple filenames.
|
||||
|
||||
|
||||
NETRC *netrw-netrc*
|
||||
|
||||
The typical syntax for lines in a <.netrc> file is given as shown below.
|
||||
Ftp under Unix usually support <.netrc>; Windows' ftp usually doesn't.
|
||||
>
|
||||
machine {full machine name} login {user-id} password "{password}"
|
||||
default login {user-id} password "{password}"
|
||||
|
||||
Your ftp client must handle the use of <.netrc> on its own, but if the
|
||||
<.netrc> file exists, an ftp transfer will not ask for the user-id or
|
||||
password.
|
||||
|
||||
Note:
|
||||
Since this file contains passwords, make very sure nobody else can
|
||||
read this file! Most programs will refuse to use a .netrc that is
|
||||
readable for others. Don't forget that the system administrator can
|
||||
still read the file!
|
||||
|
||||
|
||||
PASSWORD *netrw-passwd*
|
||||
|
||||
The script attempts to get passwords for ftp invisibly using |inputsecret()|,
|
||||
a built-in Vim function. See |netrw-uidpass| for how to change the password
|
||||
after one has set it.
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Activation *netrw-activate*
|
||||
|
||||
Network-oriented file transfers are available by default whenever
|
||||
|'nocompatible'| mode is enabled. The <netrw.vim> file resides in your
|
||||
system's vim-plugin directory and is sourced automatically whenever you bring
|
||||
up vim.
|
||||
|
||||
|
||||
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. Thus one may use files across networks as if they were local. >
|
||||
|
||||
vim ftp://[user@]machine/path
|
||||
...
|
||||
:wq
|
||||
|
||||
|
||||
==============================================================================
|
||||
3. Ex Commands *netrw-ex*
|
||||
|
||||
The usual read/write commands are supported. There are also a couple of
|
||||
additional commands available.
|
||||
|
||||
:[range]Nw
|
||||
Write the specified lines to the current
|
||||
file as specified in b:netrw_lastfile.
|
||||
|
||||
:[range]Nw {netfile} [{netfile}]...
|
||||
Write the specified lines to the {netfile}.
|
||||
|
||||
:Nread
|
||||
Read the specified lines into the current
|
||||
buffer from the file specified in
|
||||
b:netrw_lastfile.
|
||||
|
||||
:Nread {netfile} {netfile}...
|
||||
Read the {netfile} after the current line.
|
||||
|
||||
*netrw-uidpass*
|
||||
:call NetUserPass()
|
||||
If b:netrw_uid and b:netrw_passwd don't exist,
|
||||
this function query the user for them.
|
||||
|
||||
:call NetUserPass("userid")
|
||||
This call will set the b:netrw_uid and, if
|
||||
the password doesn't exist, will query the user for it.
|
||||
|
||||
:call NetUserPass("userid","passwd")
|
||||
This call will set both the b:netrw_uid and b:netrw_passwd.
|
||||
The user-id and password are used by ftp transfers. One may
|
||||
effectively remove the user-id and password by using ""
|
||||
strings.
|
||||
|
||||
|
||||
==============================================================================
|
||||
4. Variables *netrw-var*
|
||||
|
||||
The script <netrw.vim> uses several variables which can affect <netrw.vim>'s
|
||||
behavior. These variables are typically set in the user's <.vimrc> file:
|
||||
|
||||
g:netrw_uid Holds current user-id for ftp.
|
||||
g:netrw_passwd Holds current password for ftp.
|
||||
b:netrw_lastfile Holds latest method/machine/path.
|
||||
b:netrw_line Holds current line number (during NetWrite)
|
||||
b:netrw_col Holds current cursor position (during NetWrite)
|
||||
g:netrw_ftp =0 use default ftp (uid password)
|
||||
=1 use alternate ftp (user uid password)
|
||||
(see |netrw-options|)
|
||||
g:netrw_ftpmode ="binary" (default)
|
||||
="ascii" (your choice)
|
||||
g:netrw_win95ftp =0 use unix-style ftp even if win95/98/ME/etc
|
||||
=1 use default method to do ftp
|
||||
g:netrw_cygwin =1 assume scp under windows is from cygwin
|
||||
(default/windows)
|
||||
=0 assume scp under windows accepts windows
|
||||
style paths (default/else)
|
||||
g:netrw_use_nt_rcp =0 don't use WinNT/2K/XP's rcp (default)
|
||||
=1 use WinNT/2K/XP's rcp, binary mode
|
||||
|
||||
The following variables specify the external program to use handle the associated
|
||||
protocol (rcp, ftp, etc), plus any options. Again, the user may vary these
|
||||
at will:
|
||||
|
||||
g:netrw_rcp_cmd ="rcp"
|
||||
g:netrw_ftp_cmd ="ftp"
|
||||
g:netrw_scp_cmd ="scp -q"
|
||||
g:netrw_http_cmd ="wget -O"
|
||||
g:netrw_dav_cmd ="cadaver"
|
||||
g:netrw_rsync_cmd ="rsync -a"
|
||||
g:netrw_fetch_cmd ="" This variable is used for ftp and http
|
||||
reading only if it ends with "fetch -o"
|
||||
|
||||
|
||||
The script will also make use of the following variables internally,
|
||||
albeit temporarily.
|
||||
|
||||
g:netrw_method Index indicating rcp/ftp+.netrc/ftp
|
||||
g:netrw_machine Holds machine name parsed from input
|
||||
g:netrw_fname Holds filename being accessed
|
||||
|
||||
|
||||
==============================================================================
|
||||
5. User Options *netrw-options*
|
||||
|
||||
Option Type Setting Meaning ~
|
||||
--------- -------- -------------- --------------------------- >
|
||||
|
||||
netrw_ftp variable =doesn't exist userid set by "user userid"
|
||||
=0 userid set by "user userid"
|
||||
=1 userid set by "userid"
|
||||
|
||||
NetReadFixup function =doesn't exist no change
|
||||
=exists Allows user to have files
|
||||
read via ftp automatically
|
||||
transformed however they wish
|
||||
by NetReadFixup()
|
||||
g:netrw_rcp_cmd variable ="rcp"
|
||||
g:netrw_ftp_cmd variable ="ftp"
|
||||
g:netrw_scp_cmd variable ="scp -q"
|
||||
g:netrw_http_cmd variable ="wget -O"
|
||||
g:netrw_dav_cmd variable ="cadaver"
|
||||
g:netrw_rsync_cmd variable ="rsync -a"
|
||||
g:netrw_fetch_cmd variable ="" This variable is used for ftp and http
|
||||
reading only if it ends with "fetch -o"
|
||||
<
|
||||
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 g:netrw_..._cmd variables specify the external program to use handle the
|
||||
associated protocol (rcp, ftp, etc), plus any options.
|
||||
|
||||
Netrw typically builds up lines of one of the following formats in a
|
||||
temporary file:
|
||||
>
|
||||
IF g:netrw_ftp !exists or is not 1 IF g:netrw_ftp exists and is 1
|
||||
---------------------------------- ------------------------------
|
||||
open machine [port] open machine [port]
|
||||
user userid password userid password
|
||||
[g:netrw_ftpmode] password
|
||||
get filename tempfile [g:netrw_ftpmode]
|
||||
get filename tempfile
|
||||
<
|
||||
Netrw then executes the lines above by use of a filter:
|
||||
>
|
||||
:%! {g:netrw_ftp_cmd} -i [-n]
|
||||
<
|
||||
|
||||
where
|
||||
g:netrw_ftp_cmd is usually "ftp",
|
||||
-i tells ftp not to be interactive
|
||||
-n means don't use netrc and is used for Method #3 (ftp w/o <.netrc>)
|
||||
|
||||
if <.netrc> exists it will be used to avoid having to query the user for
|
||||
userid and password). The transferred file is put into a temporary file.
|
||||
The temporary file is then read into the main editing session window that
|
||||
requested it and the temporary file deleted.
|
||||
|
||||
If your ftp doesn't accept the "user" command and immediately just demands a
|
||||
userid, then try putting "let netrw_ftp=1" in your <.vimrc>.
|
||||
|
||||
If your ftp for whatever reason generates unwanted lines (such as AUTH
|
||||
messages) you may write a NetReadFixup(tmpfile) function:
|
||||
>
|
||||
function! NetReadFixup(method,line1,line2)
|
||||
if method == 1 "rcp
|
||||
elseif method == 2 "ftp + <.netrc>
|
||||
elseif method == 3 "ftp + machine,uid,password,filename
|
||||
elseif method == 4 "scp
|
||||
elseif method == 5 "http/wget
|
||||
elseif method == 6 "dav/cadaver
|
||||
elseif method == 7 "rsync
|
||||
endif
|
||||
endfunction
|
||||
>
|
||||
The NetReadFixup() function will be called if it exists and thus allows you
|
||||
to customize your reading process. As a further example, <netrw.vim> contains
|
||||
just such a function to handle Windows 95 ftp. For whatever reason, Windows
|
||||
95's ftp dumps four blank lines at the end of a transfer, and so it is
|
||||
desirable to automate their removal. Here's some code taken from <netrw.vim>
|
||||
itself:
|
||||
>
|
||||
if has("win95") && g:netrw_win95ftp
|
||||
fu! NetReadFixup(method, line1, line2)
|
||||
if method == 3 " ftp (no <.netrc>)
|
||||
let fourblanklines= line2 - 3
|
||||
silent fourblanklines.",".line2."g/^\s*/d"
|
||||
endif
|
||||
endfunction
|
||||
endif
|
||||
>
|
||||
|
||||
==============================================================================
|
||||
6. Debugging *netrw-debug*
|
||||
|
||||
The <netrw.vim> script is typically available as:
|
||||
|
||||
/usr/local/share/vim/vim6x/plugin/netrw.vim
|
||||
|
||||
which is loaded automatically at startup (assuming :set nocp).
|
||||
|
||||
1. Get the <Decho.vim> script, available as:
|
||||
|
||||
http://vim.sourceforge.net/scripts/script.php?script_id=120
|
||||
|
||||
and put that into your local plugin directory
|
||||
|
||||
2. Edit the <netrw.vim> file as follows:
|
||||
|
||||
:g/DBG/s/^"//
|
||||
|
||||
(to restore to normal, use :g/DBG/s/^/"/ )
|
||||
|
||||
3. Then bring up vim and attempt a transfer. A set of messages
|
||||
should appear concerning the steps that <netrw.vim> took in
|
||||
attempting to read/write your file over the network. Please
|
||||
send that information to <netrw.vim>'s maintainer,
|
||||
|
||||
cec@NgrOyphSon.gPsfAc.nMasa.gov - NOSPAM
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
@@ -1,113 +0,0 @@
|
||||
*pi_spec.txt* For IdeaVim version @VESION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
This is a filetype plugin to work with rpm spec files.
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Currently, this Vim plugin allows you to easily update the %changelog
|
||||
section in RPM spec files. It will even create a section for you if it
|
||||
doesn't exist yet. If you've already inserted an entry today, it will
|
||||
give you the opportunity to just add a new item in today's entry. If you
|
||||
don't provide a format string (|spec_chglog_format|), it'll ask you an
|
||||
email address and build a format string by itself.
|
||||
|
||||
1. How to use it |spec-how-to-use-it|
|
||||
2. Customizing |spec-customizing|
|
||||
|
||||
==============================================================================
|
||||
1. How to use it *spec-how-to-use-it*
|
||||
|
||||
The spec_chglog plugin provides a map like the following:
|
||||
|
||||
:map <buffer> <LocalLeader>c <Plug>SpecChangelog
|
||||
|
||||
It means that you may run the plugin inside a spec file by pressing
|
||||
your maplocalleader key (default is '\') plus 'c'. If you do not have
|
||||
|spec_chglog_format| set, the plugin will ask you for an email address
|
||||
to use in this edit session.
|
||||
|
||||
Everytime you run the plugin, it will check to see if the last entry
|
||||
in the changelog has been written today and by you. If it's the entry
|
||||
mathes, it will just insert a new changelog item, otherwise it will
|
||||
create a new changelog entry. If you are running with
|
||||
|spec_chglog_release_info| enabled, it will also check if the name, version
|
||||
and release matches. The plugin is smart enough to ask you if it should
|
||||
update the package release, if you have not done so.
|
||||
|
||||
Setting a map *spec-setting-a-map*
|
||||
-------------
|
||||
|
||||
As you should know, you can easily set a map to access any Vim command (or
|
||||
anything, for that matter). If you don't like the default map of
|
||||
<LocalLeader>c, you may just set up your own key. The following line
|
||||
shows you how you could do this in your .vimrc file, mapping the plugin to
|
||||
the <F5> key:
|
||||
|
||||
au FileType spec map <buffer> <F5> <Plug>SpecChangelog
|
||||
|
||||
Note: the plugin will respect your desire to change the default mapping
|
||||
and won't set it.
|
||||
|
||||
This command will add a map only in the spec file buffers.
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Customizing *spec-customizing*
|
||||
|
||||
The format string *spec_chglog_format*
|
||||
-----------------
|
||||
|
||||
You can easily customize how your spec file entry will look like. To do
|
||||
this just set the variable "spec_chglog_format" in your .vimrc file like
|
||||
this: >
|
||||
|
||||
let spec_chglog_format = "%a %b %d %Y My Name <my@email.com>"
|
||||
|
||||
Note that "%a %b %d %Y" is the most used time format. If you don't provide
|
||||
a format string, when you run the SpecChangelog command for the first
|
||||
time, it will ask you an email address and build the |spec_chglog_format|
|
||||
variable for you. This way, you will only need to provide your email
|
||||
address once.
|
||||
|
||||
To discover which format options you can use, take a look at the strftime()
|
||||
function man page.
|
||||
|
||||
Where to insert new items *spec_chglog_prepend*
|
||||
-------------------------
|
||||
|
||||
The plugin will usually insert new %changelog entry items (note that it's
|
||||
not the entry itself) after the existing ones. If you set the
|
||||
spec_chglog_prepend variable >
|
||||
|
||||
let spec_chglog_prepend = 1
|
||||
|
||||
it will insert new items before the existing ones.
|
||||
|
||||
Inserting release info *spec_chglog_release_info*
|
||||
----------------------
|
||||
|
||||
If you want, the plugin may automatically insert release information
|
||||
on each changelog entry. One advantage of turning this feature on is
|
||||
that it may control if the release has been updated after the last
|
||||
change in the package or not. If you have not updated the package
|
||||
version or release, it will ask you if it should update the package
|
||||
release for you. To turn this feature on, just insert the following
|
||||
code in your .vimrc: >
|
||||
|
||||
let spec_chglog_release_info = 1
|
||||
|
||||
Then, the first item in your changelog entry will be something like: >
|
||||
|
||||
+ name-1.0-1cl
|
||||
|
||||
If you don't like the release updating feature and don't want to answer
|
||||
"No" each time it detects an old release, you may disable it with >
|
||||
|
||||
let spec_chglog_never_increase_release = 1
|
||||
|
||||
|
||||
Good luck!!
|
||||
-->
|
||||
@@ -1,986 +0,0 @@
|
||||
*quickfix.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
This subject is introduced in section |30.1| of the user manual.
|
||||
|
||||
1. Using QuickFix commands |quickfix|
|
||||
2. The error window |quickfix-window|
|
||||
3. Using more than one list of errors |quickfix-error-lists|
|
||||
4. Using :make |:make_makeprg|
|
||||
5. Using :grep |grep|
|
||||
6. Selecting a compiler |compiler-select|
|
||||
7. The error format |error-file-format|
|
||||
8. The directory stack |quickfix-directory-stack|
|
||||
9. Specific error file formats |errorformats|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
The quickfix commands are not available when the |+quickfix| feature was
|
||||
disabled at compile time.
|
||||
|
||||
=============================================================================
|
||||
1. Using QuickFix commands *quickfix* *Quickfix* *E42*
|
||||
|
||||
Vim has a special mode to speedup the edit-compile-edit cycle. This is
|
||||
inspired by the quickfix option of the Manx's Aztec C compiler on the Amiga.
|
||||
The idea is to save the error messages from the compiler in a file and use Vim
|
||||
to jump to the errors one by one. You can examine each problem and fix it,
|
||||
without having to remember all the error messages.
|
||||
|
||||
If you are using Manx's Aztec C compiler on the Amiga look here for how to use
|
||||
it with Vim: |quickfix-manx|. If you are using another compiler you should
|
||||
save the error messages in a file and start Vim with "vim -q filename". An
|
||||
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:
|
||||
|
||||
*:cc*
|
||||
:cc[!] [nr] Display error [nr]. If [nr] is omitted, the same
|
||||
error is displayed again. Without [!] this doesn't
|
||||
work when jumping to another buffer, the current buffer
|
||||
has been changed, there is the only window for the
|
||||
buffer and both 'hidden' and 'autowrite' are off.
|
||||
When jumping to another buffer with [!] any changes to
|
||||
the current buffer are lost, unless 'hidden' is set or
|
||||
there is another window for this buffer.
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
|
||||
*: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'.
|
||||
|
||||
:[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'.
|
||||
|
||||
*: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
|
||||
file names at all or if there is no next file, go to
|
||||
the [count] next error. See |:cc| for [!] and
|
||||
'switchbuf'.
|
||||
|
||||
*:crewind* *:cr*
|
||||
:cr[ewind][!] [nr] Display error [nr]. If [nr] is omitted, the FIRST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:cfirst* *:cfir*
|
||||
:cfir[st][!] [nr] Same as ":crewind".
|
||||
|
||||
*:clast* *:cla*
|
||||
:cla[st][!] [nr] Display error [nr]. If [nr] is omitted, the LAST
|
||||
error is displayed. See |:cc|.
|
||||
|
||||
*:cq* *:cquit*
|
||||
:cq[uit] Quit Vim with an error code, so that the compiler
|
||||
will not compile the same file again.
|
||||
|
||||
*:cf* *:cfile*
|
||||
:cf[ile][!] [errorfile] Read the error file and jump to the first error.
|
||||
This is done automatically when Vim is started with
|
||||
the -q option. You can use this command when you
|
||||
keep Vim running while compiling. If you give the
|
||||
name of the errorfile, the 'errorfile' option will
|
||||
be set to [errorfile]. See |:cc| for [!].
|
||||
|
||||
*:cg* *:cgetfile*
|
||||
:cg[etfile][!] [errorfile]
|
||||
Read the error file. Just like ":cfile" but don't
|
||||
jump to the first error.
|
||||
|
||||
*:cl* *:clist*
|
||||
:cl[ist] [from] [, [to]]
|
||||
List all errors that are valid |quickfix-valid|.
|
||||
If numbers [from] and/or [to] are given, the respective
|
||||
range of errors is listed. A negative number counts
|
||||
from the last error backwards, -1 being the last error.
|
||||
The 'switchbuf' settings are respected when jumping
|
||||
to a buffer.
|
||||
|
||||
:cl[ist]! [from] [, [to]]
|
||||
List all errors.
|
||||
|
||||
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
|
||||
the error location may not be correct. If you quit Vim and start again the
|
||||
marks are lost and the error locations may not be correct anymore.
|
||||
|
||||
=============================================================================
|
||||
2. The error window *quickfix-window*
|
||||
|
||||
*:cope* *:copen*
|
||||
:cope[n] [height] Open a window to show the current list of errors.
|
||||
When [height] is given, the window becomes that high
|
||||
(if there is room). Otherwise the window is made ten
|
||||
lines high.
|
||||
The window will contain a special buffer, with
|
||||
'buftype' equal to "quickfix". Don't change this!
|
||||
If there already is a quickfix window, it will be made
|
||||
the current window. It is not possible to open a
|
||||
second quickfix window.
|
||||
|
||||
*:ccl* *:cclose*
|
||||
:ccl[ose] Close the quickfix 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.
|
||||
|
||||
|
||||
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
|
||||
make it always occupy the full width: >
|
||||
:botright cwindow
|
||||
You can move the window around with |window-moving| commands.
|
||||
For example, to move it to the top: CTRL-W K
|
||||
The 'winfixheight' option will be set, which means that the window will mostly
|
||||
keep its height, ignoring 'winheight' and 'equalalways'. You can change the
|
||||
height manually (e.g., by dragging the status line above it with the mouse).
|
||||
|
||||
In the quickfix window, each line is one error. The line number is equal to
|
||||
the error number. You can use ":.cc" to jump to the error under the cursor.
|
||||
Hitting the <CR> key or double-clicking the mouse on a line has the same
|
||||
effect. The file containing the error is opened in the window above the
|
||||
quickfix window. If there already is a window for that file, it is used
|
||||
instead. If the buffer in the used window has changed, and the error is in
|
||||
another file, jumping to the error will fail. You will first have to make
|
||||
sure the window contains a buffer which can be abandoned.
|
||||
|
||||
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 silent g/^/s//\=line(".")." "/
|
||||
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.
|
||||
|
||||
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
|
||||
lines anyway, the relation between the text and the error number is messed up.
|
||||
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.
|
||||
|
||||
=============================================================================
|
||||
3. Using more than one list of errors *quickfix-error-lists*
|
||||
|
||||
So far has been assumed that there is only one list of errors. Actually the
|
||||
ten last used lists are remembered. When starting a new list, the previous
|
||||
ones are automatically kept. Two commands can be used to access older error
|
||||
lists. They set one of the existing error lists as the current one.
|
||||
|
||||
*:colder* *:col* *E380*
|
||||
:col[der] [count] Go to older error list. When [count] is given, do
|
||||
this [count] times. When already at the oldest error
|
||||
list, an error message is given.
|
||||
|
||||
*: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.
|
||||
|
||||
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
|
||||
list, one newer list is overwritten. This is especially useful if you are
|
||||
browsing with ":grep" |grep|. If you want to keep the more recent error
|
||||
lists, use ":cnewer 99" first.
|
||||
|
||||
=============================================================================
|
||||
4. Using :make *:make_makeprg*
|
||||
|
||||
*:mak* *:make*
|
||||
:mak[e][!] [arguments] 1. If the 'autowrite' option is on, write any changed
|
||||
buffers
|
||||
2. An errorfile name is made from 'makeef'. If
|
||||
'makeef' doesn't contain "##", and a file with this
|
||||
name already exists, it is deleted.
|
||||
3. The program given with the 'makeprg' option is
|
||||
started (default "make") with the optional
|
||||
[arguments] and the output is saved in the
|
||||
errorfile (for Unix it is also echoed on the
|
||||
screen).
|
||||
4. The errorfile is read using 'errorformat'.
|
||||
5. If [!] is not given the first error is jumped to.
|
||||
6. The errorfile is deleted.
|
||||
7. You can now move through the errors with commands
|
||||
like |:cnext| and |:cprevious|, see above.
|
||||
This command does not accept a comment, any "
|
||||
characters are considered part of the arguments.
|
||||
|
||||
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
|
||||
|
||||
":!{makeprg} [arguments] {shellpipe} {errorfile}".
|
||||
|
||||
{makeprg} is the string given with the 'makeprg' option. Any command can be
|
||||
used, not just "make". Characters '%' and '#' are expanded as usual on a
|
||||
command-line. You can use "%<" to insert the current file name without
|
||||
extension, or "#<" to insert the alternate file name without extension, for
|
||||
example: >
|
||||
:set makeprg=make\ #<.o
|
||||
|
||||
[arguments] is anything that is typed after ":make".
|
||||
{shellpipe} is the 'shellpipe' option.
|
||||
{errorfile} is the 'makeef' option, with ## replaced to make it unique.
|
||||
|
||||
The placeholder "$*" can be used for the argument list in {makeprog} if the
|
||||
command needs some additional characters after its arguments. The $* is
|
||||
replaced then by all arguments. Example: >
|
||||
:set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
|
||||
or simpler >
|
||||
:let &mp = 'latex \\nonstopmode \\input\{$*}'
|
||||
"$*" can be given multiple times, for example: >
|
||||
:set makeprg=gcc\ -o\ $*\ $*
|
||||
|
||||
The 'shellpipe' option defaults to ">" for the Amiga, MS-DOS and Win32. This
|
||||
means that the output of the compiler is saved in a file and not shown on the
|
||||
screen directly. For Unix "| tee" is used. The compiler output is shown on
|
||||
the screen and saved in a file the same time. Depending on the shell used
|
||||
"|& tee" or "2>&1| tee" is the default, so stderr output will be included.
|
||||
|
||||
If 'shellpipe' is empty, the {errorfile} part will be omitted. This is useful
|
||||
for compilers that write to an errorfile themselves (e.g., Manx's Amiga C).
|
||||
|
||||
==============================================================================
|
||||
5. Using :grep *grep* *lid*
|
||||
|
||||
Vim can interface with "grep" and grep-like programs (such as the GNU
|
||||
id-utils) in a similar way to its compiler integration (see |:make| above).
|
||||
|
||||
[Unix trivia: The name for the Unix "grep" command comes from ":g/re/p", where
|
||||
"re" stands for Regular Expression.]
|
||||
|
||||
*:gr* *:grep*
|
||||
:gr[ep][!] [arguments] Just like ":make", but use 'grepprg' instead of
|
||||
'makeprg' and 'grepformat' instead of 'errorformat'.
|
||||
*:grepa* *:grepadd*
|
||||
:grepa[dd][!] [arguments]
|
||||
Just like ":grep", but instead of making a new list of
|
||||
errors the matches are appended to the current list.
|
||||
Example: >
|
||||
:grep nothing %
|
||||
:bufdo grepadd! something %
|
||||
< The first command makes a new error list which is
|
||||
empty. The second command executes "grepadd" for each
|
||||
listed buffer. Note the use of ! to avoid that
|
||||
":grepadd" jumps to the first error, which is not
|
||||
allowed with |:bufdo|.
|
||||
|
||||
5.1 Setting up grep
|
||||
|
||||
If you have a standard "grep" program installed, the :grep command may work
|
||||
well with the defaults. The syntax is very similar to the standard command: >
|
||||
|
||||
:grep foo *.c
|
||||
|
||||
Will search all files with the .c extension for the substring "foo". The
|
||||
arguments to :grep are passed straight to the "grep" program, so you can use
|
||||
whatever options your "grep" supports.
|
||||
|
||||
By default, :grep invokes grep with the -n option (show file and line
|
||||
numbers). You can change this with the 'grepprg' option. You will need to set
|
||||
'grepprg' if:
|
||||
|
||||
a) You are using a program that isn't called "grep"
|
||||
b) You have to call grep with a full path
|
||||
c) You want to pass other options automatically (e.g. case insensitive
|
||||
search.)
|
||||
|
||||
Once "grep" has executed, Vim parses the results using the 'grepformat'
|
||||
option. This option works in the same way as the 'errorformat' option - see
|
||||
that for details. You may need to change 'grepformat' from the default if
|
||||
your grep outputs in a non-standard format, or you are using some other
|
||||
program with a special format.
|
||||
|
||||
Once the results are parsed, Vim loads the first file containing a match and
|
||||
jumps to the appropriate line, in the same way that it jumps to a compiler
|
||||
error in |quickfix| mode. You can then use the |:cnext|, |:clist|, etc.
|
||||
commands to see the other matches.
|
||||
|
||||
|
||||
5.2 Using :grep with id-utils
|
||||
|
||||
You can set up :grep to work with the GNU id-utils like this: >
|
||||
|
||||
:set grepprg=lid\ -Rgrep\ -s
|
||||
:set grepformat=%f:%l:%m
|
||||
|
||||
then >
|
||||
:grep (regexp)
|
||||
|
||||
works just as you'd expect.
|
||||
(provided you remembered to mkid first :)
|
||||
|
||||
|
||||
5.3 Browsing source code with :grep
|
||||
|
||||
Using the stack of error lists that Vim keeps, you can browse your files to
|
||||
look for functions and the functions they call. For example, suppose that you
|
||||
have to add an argument to the read_file() function. You enter this command: >
|
||||
|
||||
:grep read_file *.c
|
||||
|
||||
You use ":cn" to go along the list of matches and add the argument. At one
|
||||
place you have to get the new argument from a higher level function msg(), and
|
||||
need to change that one too. Thus you use: >
|
||||
|
||||
:grep msg *.c
|
||||
|
||||
While changing the msg() functions, you find another function that needs to
|
||||
get the argument from a higher level. You can again use ":grep" to find these
|
||||
functions. Once you are finished with one function, you can use >
|
||||
|
||||
:colder
|
||||
|
||||
to go back to the previous one.
|
||||
|
||||
This works like browsing a tree: ":grep" goes one level deeper, creating a
|
||||
list of branches. ":colder" goes back to the previous level. You can mix
|
||||
this use of ":grep" and "colder" to browse all the locations in a tree-like
|
||||
way. If you do this consistently, you will find all locations without the
|
||||
need to write down a "todo" list.
|
||||
|
||||
=============================================================================
|
||||
6. Selecting a compiler *compiler-select*
|
||||
|
||||
*:comp* *:compiler*
|
||||
:comp[iler] {name} Set options to work with compiler {name}.
|
||||
{not available when compiled without the
|
||||
|+eval| feature}
|
||||
|
||||
|
||||
What this command actually does is:
|
||||
- delete the "current_compiler" variable *current_compiler*
|
||||
- execute ":runtime! compiler/{name}.vim"
|
||||
|
||||
For writing a compiler plugin, see |write-compiler-plugin|.
|
||||
|
||||
|
||||
MANX AZTEC C *quickfix-manx* *compiler-manx*
|
||||
|
||||
To use Vim with Manx's Aztec C compiler on the Amiga you should do the
|
||||
following:
|
||||
- Set the CCEDIT environment variable with the command: >
|
||||
mset "CCEDIT=vim -q"
|
||||
- Compile with the -qf option. If the compiler finds any errors, Vim is
|
||||
started and the cursor is positioned on the first error. The error message
|
||||
will be displayed on the last line. You can go to other errors with the
|
||||
commands mentioned below. You can fix the errors and write the file(s).
|
||||
- If you exit Vim normally the compiler will re-compile the same file. If you
|
||||
exit with the :cq command, the compiler will terminate. Do this if you
|
||||
cannot fix the error, or if another file needs to be compiled first.
|
||||
|
||||
There are some restrictions to the Quickfix mode on the Amiga. The
|
||||
compiler only writes the first 25 errors to the errorfile (Manx's
|
||||
documentation does not say how to get more). If you want to find the others,
|
||||
you will have to fix a few errors and exit the editor. After recompiling,
|
||||
up to 25 remaining errors will be found.
|
||||
|
||||
If Vim was started from the compiler, the :sh and some :! commands will not
|
||||
work, because Vim is then running in the same process as the compiler and
|
||||
stdin (standard input) will not be interactive.
|
||||
|
||||
|
||||
PYUNIT COMPILER *compiler-pyunit*
|
||||
|
||||
This is not actually a compiler, but a unit testing framework for the
|
||||
Python language. It is included into standard Python distribution
|
||||
starting from version 2.0. For older versions, you can get it from
|
||||
http://pyunit.sourceforge.net.
|
||||
|
||||
When you run your tests with the help of the framework, possible errors
|
||||
are parsed by Vim and presented for you in quick-fix mode.
|
||||
|
||||
Unfortunately, there is no standard way to run the tests.
|
||||
The alltests.py script seems to be used quite often, that's all.
|
||||
Useful values for the 'makeprg' options therefore are:
|
||||
setlocal makeprg=./alltests.py " Run a testsuite
|
||||
setlocal makeprg=python % " Run a single testcase
|
||||
|
||||
Also see http://vim.sourceforge.net/tip_view.php?tip_id=280.
|
||||
|
||||
|
||||
TEX COMPILER *compiler-tex*
|
||||
|
||||
Included in the distribution compiler for TeX ($VIMRUNTIME/compiler/tex.vim)
|
||||
is intended to handle all flavors of TeX formats. If b:tex_flavor or
|
||||
g:tex_flavor (in this precedence) variable exists, it defines TeX flavor for
|
||||
:make (actually, this is the name of executed command), and if both variables
|
||||
do not exist, it defaults to "latex". For example, while editing chapter2.tex
|
||||
\input-ed from mypaper.tex written in AMS-TeX: >
|
||||
|
||||
:let b:tex_flavor = 'amstex'
|
||||
:compiler tex
|
||||
< [editing...] >
|
||||
:make mypaper
|
||||
|
||||
Note that you must specify a name of the file to process as an argument (to
|
||||
process the right file when editing \input-ed or \include-ed file; portable
|
||||
solution for substituting % for no arguments is welcome). This is not in the
|
||||
semantics of make, but you may specify filename without extension ".tex" and
|
||||
mean this as "make filename.dvi or filename.pdf or
|
||||
filename.some_result_extension according to compiler".
|
||||
|
||||
Used variables:
|
||||
b:tex_ignore_makefile or g:tex_ignore_makefile
|
||||
usually if a file 'Makefile' or 'makefile' exists in the current
|
||||
directory, it is considered a sign that user wants to process his *TeX
|
||||
files with make (e.g. he has a multifile book with a master file - in this
|
||||
case :make should process master file regardless of which file is edited).
|
||||
If this is not the case, you can set one of the variables above before
|
||||
running :compiler tex.
|
||||
b:tex_flavor or g:tex_flavor
|
||||
by default this compiler thinks that you use LaTeX (don't you? why!?) and
|
||||
run it with "latex" command. If this assumption is invalid for you, set
|
||||
b:tex_flavor or g:tex_flavor to the name of command you run.
|
||||
|
||||
Note: latex command line syntax is set to usable both for MikTeX (suggestion
|
||||
by Srinath Avadhanula) and teTeX (checked by Artem Chuprina). Suggestion
|
||||
from :help errorformat-LaTeX is too complex to keep it working for different
|
||||
shells and OSes and also does not allow to use other available TeX options,
|
||||
if any. If your TeX doesn't support "-interaction=nonstopmode", please
|
||||
report it with different means to express \nonstopmode from the command line
|
||||
|
||||
=============================================================================
|
||||
7. The error format *error-file-format*
|
||||
|
||||
*errorformat* *E372* *E373* *E374*
|
||||
*E375* *E376* *E377* *E378*
|
||||
The 'errorformat' option specifies a list of formats that are recognized. The
|
||||
first format that matches with an error message is used. You can add several
|
||||
formats for different messages your compiler produces, or even entries for
|
||||
multiple compilers. See |efm-entries|.
|
||||
|
||||
Each entry in 'errorformat' is a scanf-like string that describes the format.
|
||||
First, you need to know how scanf works. Look in the documentation of your
|
||||
C compiler. Below you find the % items that Vim understands. Others are
|
||||
invalid.
|
||||
|
||||
Special characters in 'errorformat' are comma and backslash. See
|
||||
|efm-entries| for how to deal with them. Note that a literal "%" is matched
|
||||
by "%%", thus it is not escaped with a backslash.
|
||||
|
||||
Note: By default the difference between upper and lowercase is ignored. If
|
||||
you want to match case, add "\C" to the pattern |/\C|.
|
||||
|
||||
|
||||
Basic items
|
||||
|
||||
%f file name (finds a string)
|
||||
%l line number (finds a number)
|
||||
%c column number (finds a number representing character
|
||||
column of the error, (1 <tab> == 1 character column))
|
||||
%v virtual column number (finds a number representing
|
||||
screen column of the error (1 <tab> == 8 screen
|
||||
columns)
|
||||
%t error type (finds a single character)
|
||||
%n error number (finds a number)
|
||||
%m error message (finds a string)
|
||||
%r matches the "rest" of a single-line file message %O/P/Q
|
||||
%p pointer line (finds a sequence of '-', '.' or ' ' and
|
||||
uses the length for the column number)
|
||||
%*{conv} any scanf non-assignable conversion
|
||||
%% the single '%' character
|
||||
|
||||
The "%f" conversion depends on the current 'isfname' setting.
|
||||
|
||||
The "%f" and "%m" conversions have to detect the end of the string. They
|
||||
should be followed by a character that cannot be in the string. Everything
|
||||
up to that character is included in the string. But when the next character
|
||||
is a '%' or a backslash, "%f" will look for any 'isfname' character and "%m"
|
||||
finds anything. If the "%f" or "%m" is at the end, everything up to the end
|
||||
of the line is included.
|
||||
|
||||
On MS-DOS, MS-Windows and OS/2 a leading "C:" will be included in "%f", even
|
||||
when using "%f:". This means that a file name which is a single alphabetical
|
||||
letter will not be detected.
|
||||
|
||||
The "%p" conversion is normally followed by a "^". It's used for compilers
|
||||
that output a line like: >
|
||||
^
|
||||
or >
|
||||
---------^
|
||||
to indicate the column of the error. This is to be used in a multi-line error
|
||||
message. See |errorformat-javac| for a useful example.
|
||||
|
||||
|
||||
Changing directory
|
||||
|
||||
The following uppercase conversion characters specify the type of special
|
||||
format strings. At most one of them may be given as a prefix at the begin
|
||||
of a single comma-separated format pattern.
|
||||
Some compilers produce messages that consist of directory names that have to
|
||||
be prepended to each file name read by %f (example: GNU make). The following
|
||||
codes can be used to scan these directory names; they will be stored in an
|
||||
internal directory stack. *E379*
|
||||
%D "enter directory" format string; expects a following
|
||||
%f that finds the directory name
|
||||
%X "leave directory" format string; expects following %f
|
||||
|
||||
When defining an "enter directory" or "leave directory" format, the "%D" or
|
||||
"%X" has to be given at the start of that substring. Vim tracks the directory
|
||||
changes and prepends the current directory to each erroneous file found with a
|
||||
relative path. See |quickfix-directory-stack| for details, tips and
|
||||
limitations.
|
||||
|
||||
|
||||
Multi-line messages *errorformat-multi-line*
|
||||
|
||||
It is possible to read the output of programs that produce multi-line
|
||||
messages, ie. error strings that consume more than one line. Possible
|
||||
prefixes are:
|
||||
%E start of a multi-line error message
|
||||
%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)
|
||||
%C continuation of a multi-line message
|
||||
%Z end of a multi-line message
|
||||
These can be used with '+' and '-', see |efm-ignore| below.
|
||||
|
||||
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 '--'
|
||||
|
||||
The appropriate error format string has to look like this: >
|
||||
:set efm=%EError\ %n,%Cline\ %l,%Ccolumn\ %c,%Z%m
|
||||
|
||||
And the |:clist| error message generated for this error is:
|
||||
|
||||
1:42 col 3 error 275: ' ' expected after '--'
|
||||
|
||||
Another example: Think of a Python interpreter that produces the following
|
||||
error message (line numbers are not part of the actual output):
|
||||
|
||||
1 ==============================================================
|
||||
2 FAIL: testGetTypeIdCachesResult (dbfacadeTest.DjsDBFacadeTest)
|
||||
3 --------------------------------------------------------------
|
||||
4 Traceback (most recent call last):
|
||||
5 File "unittests/dbfacadeTest.py", line 89, in testFoo
|
||||
6 self.assertEquals(34, dtid)
|
||||
7 File "/usr/lib/python2.2/unittest.py", line 286, in
|
||||
8 failUnlessEqual
|
||||
9 raise self.failureException, \
|
||||
10 AssertionError: 34 != 33
|
||||
11
|
||||
12 --------------------------------------------------------------
|
||||
13 Ran 27 tests in 0.063s
|
||||
|
||||
Say you want |:clist| write the relevant information of this message only,
|
||||
namely:
|
||||
5 unittests/dbfacadeTest.py:89: AssertionError: 34 != 33
|
||||
|
||||
Then the error format string could be defined as follows: >
|
||||
:set efm=%C\ %.%#,%A\ \ File\ \"%f\"\\,\ line\ %l%.%#,%Z%[%^\ ]%\\@=%m
|
||||
|
||||
Note that the %C string is given before the %A here: since the expression
|
||||
' %.%#' (which stands for the regular expression ' .*') matches every line
|
||||
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.
|
||||
|
||||
|
||||
Separate file name *errorformat-separate-filename*
|
||||
|
||||
These prefixes are useful if the file name is given once and multiple messages
|
||||
follow that refer to this file name.
|
||||
%O single-line file message: overread the matched part
|
||||
%P single-line file message: push file %f onto the stack
|
||||
%Q single-line file message: pop the last file from stack
|
||||
|
||||
Example: Given a compiler that produces the following error logfile (without
|
||||
leading line numbers):
|
||||
|
||||
1 [a1.tt]
|
||||
2 (1,17) error: ';' missing
|
||||
3 (21,2) warning: variable 'z' not defined
|
||||
4 (67,3) error: end of file found before string ended
|
||||
5
|
||||
6 [a2.tt]
|
||||
7
|
||||
8 [a3.tt]
|
||||
9 NEW compiler v1.1
|
||||
10 (2,2) warning: variable 'x' not defined
|
||||
11 (67,3) warning: 's' already defined
|
||||
|
||||
This logfile lists several messages for each file enclosed in [...] which are
|
||||
properly parsed by an error format like this: >
|
||||
:set efm=%+P[%f],(%l\\,%c)%*[\ ]%t%*[^:]:\ %m,%-Q
|
||||
|
||||
A call of |:clist| writes them accordingly with their correct filenames:
|
||||
|
||||
2 a1.tt:1 col 17 error: ';' missing
|
||||
3 a1.tt:21 col 2 warning: variable 'z' not defined
|
||||
4 a1.tt:67 col 3 error: end of file found before string ended
|
||||
8 a3.tt:2 col 2 warning: variable 'x' not defined
|
||||
9 a3.tt:67 col 3 warning: 's' already defined
|
||||
|
||||
Unlike the other prefixes that all match against whole lines, %P, %Q and %O
|
||||
can be used to match several patterns in the same line. Thus it is possible
|
||||
to parse even nested files like in the following line:
|
||||
{"file1" {"file2" error1} error2 {"file3" error3 {"file4" error4 error5}}}
|
||||
The %O then parses over strings that do not contain any push/pop file name
|
||||
information. See |errorformat-LaTeX| for an extended example.
|
||||
|
||||
|
||||
Ignoring and using whole messages *efm-ignore*
|
||||
|
||||
The codes '+' or '-' can be combined with the uppercase codes above; in that
|
||||
case they have to precede the letter, eg. '%+A' or '%-G':
|
||||
%- do not include the matching multi-line in any output
|
||||
%+ include the whole matching line in the %m error string
|
||||
|
||||
One prefix is only useful in combination with '+' or '-', namely %G. It parses
|
||||
over lines containing general information like compiler version strings or
|
||||
other headers that can be skipped.
|
||||
%-G ignore this message
|
||||
%+G general message
|
||||
|
||||
|
||||
Pattern matching
|
||||
|
||||
The scanf()-like "%*[]" notation is supported for backward-compatibility
|
||||
with previous versions of Vim. However, it is also possible to specify
|
||||
(nearly) any Vim supported regular expression in format strings.
|
||||
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
|
||||
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.
|
||||
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".
|
||||
Important note: The \(...\) grouping of sub-matches can not be used in format
|
||||
specifications because it is reserved for internal conversions.
|
||||
|
||||
|
||||
Multiple entries in 'errorformat' *efm-entries*
|
||||
|
||||
To be able to detect output from several compilers, several format patterns
|
||||
may be put in 'errorformat', separated by commas (note: blanks after the comma
|
||||
are ignored). The first pattern that has a complete match is used. If no
|
||||
match is found, matching parts from the last one will be used, although the
|
||||
file name is removed and the error message is set to the whole message. If
|
||||
there is a pattern that may match output from several compilers (but not in a
|
||||
right way), put it after one that is more restrictive.
|
||||
|
||||
To include a comma in a pattern precede it with a backslash (you have to type
|
||||
two in a ":set" command). To include a backslash itself give two backslashes
|
||||
(you have to type four in a ":set" command). You also need to put a backslash
|
||||
before a space for ":set".
|
||||
|
||||
|
||||
Valid matches *quickfix-valid*
|
||||
|
||||
If a line does not completely match one of the entries in 'errorformat', the
|
||||
whole line is put in the error message and the entry is marked "not valid"
|
||||
These lines are skipped with the ":cn" and ":cp" commands (unless there is
|
||||
no valid line at all). You can use ":cl!" to display all the error messages.
|
||||
|
||||
If the error format does not contain a file name Vim cannot switch to the
|
||||
correct file. You will have to do this by hand.
|
||||
|
||||
|
||||
Examples
|
||||
|
||||
The format of the file from the Amiga Aztec compiler is:
|
||||
|
||||
filename>linenumber:columnnumber:errortype:errornumber:errormessage
|
||||
|
||||
filename name of the file in which the error was detected
|
||||
linenumber line number where the error was detected
|
||||
columnnumber column number where the error was detected
|
||||
errortype type of the error, normally a single 'E' or 'W'
|
||||
errornumber number of the error (for lookup in the manual)
|
||||
errormessage description of the error
|
||||
|
||||
This can be matched with this 'errorformat' entry:
|
||||
%f>%l:%c:%t:%n:%m"
|
||||
|
||||
Some examples for C compilers that produce single-line error outputs:
|
||||
%f:%l:\ %t%*[^0123456789]%n:\ %m for Manx/Aztec C error messages
|
||||
(scanf() doesn't understand [0-9])
|
||||
%f\ %l\ %t%*[^0-9]%n:\ %m for SAS C
|
||||
\"%f\"\\,%*[^0-9]%l:\ %m for generic C compilers
|
||||
%f:%l:\ %m for GCC
|
||||
%f:%l:\ %m,%Dgmake[%*\\d]:\ Entering\ directory\ `%f',
|
||||
%Dgmake[%*\\d]:\ Leaving\ directory\ `%f'
|
||||
for GCC with gmake (concat the lines!)
|
||||
%f(%l)\ :\ %*[^:]:\ %m old SCO C compiler (pre-OS5)
|
||||
%f(%l)\ :\ %t%*[^0-9]%n:\ %m idem, with error type and number
|
||||
%f:%l:\ %m,In\ file\ included\ from\ %f:%l:,\^I\^Ifrom\ %f:%l%m
|
||||
for GCC, with some extras
|
||||
|
||||
Extended examples for the handling of multi-line messages are given below,
|
||||
see |errorformat-Jikes| and |errorformat-LaTeX|.
|
||||
|
||||
Note the backslash in front of a space and double quote. It is required for
|
||||
the :set command. There are two backslashes in front of a comma, one for the
|
||||
:set command and one to avoid recognizing the comma as a separator of error
|
||||
formats.
|
||||
|
||||
|
||||
Filtering messages
|
||||
|
||||
If you have a compiler that produces error messages that do not fit in the
|
||||
format string, you could write a program that translates the error messages
|
||||
into this format. You can use this program with the ":make" command by
|
||||
changing the 'makeprg' option. For example: >
|
||||
:set mp=make\ \\\|&\ error_filter
|
||||
The backslashes before the pipe character are required to avoid it to be
|
||||
recognized as a command separator. The backslash before each space is
|
||||
required for the set command.
|
||||
|
||||
=============================================================================
|
||||
8. The directory stack *quickfix-directory-stack*
|
||||
|
||||
Quickfix maintains a stack for saving all used directories parsed from the
|
||||
make output. For GNU-make this is rather simple, as it always prints the
|
||||
absolute path of all directories it enters and leaves. Regardless if this is
|
||||
done via a 'cd' command in the makefile or with the parameter "-C dir" (change
|
||||
to directory before reading the makefile). It may be useful to use the switch
|
||||
"-w" to force GNU-make to print out the working directory before and after
|
||||
processing.
|
||||
|
||||
Maintaining the correct directory is more complicated if you don't use
|
||||
GNU-make. AIX-make for example doesn't print any information about its working
|
||||
directory. Then you need to enhance the makefile. In the makefile of lesstiff
|
||||
there is a command which echoes "Making {target} in {dir}". The special
|
||||
problem here is that it doesn't print informations on leaving the directory
|
||||
and that it doesn't print the absolute path.
|
||||
|
||||
To solve the problem with relative paths and missing "leave directory"
|
||||
messages Vim uses following algorithm:
|
||||
|
||||
1) Check if the given directory is a subdirectory of the current directory.
|
||||
If this is true, store it as the current directory.
|
||||
2) If it is not a subdir of the current directory, try if this is a
|
||||
subdirectory of one of the upper directories.
|
||||
3) If the directory still isn't found, it is assumed to be a subdirectory
|
||||
of Vim's current directory.
|
||||
|
||||
Additionally it is checked for every file, if it really exists in the
|
||||
identified directory. If not, it is searched in all other directories of the
|
||||
directory stack (NOT the directory subtree!). If it is still not found, it is
|
||||
assumed that it is in Vim's current directory.
|
||||
|
||||
There are limitation in this algorithm. This examples assume that make just
|
||||
prints information about entering a directory in the form "Making all in dir".
|
||||
|
||||
1) Assume you have following directories and files:
|
||||
./dir1
|
||||
./dir1/file1.c
|
||||
./file1.c
|
||||
|
||||
If make processes the directory "./dir1" before the current directory and
|
||||
there is an error in the file "./file1.c", you will end up with the file
|
||||
"./dir1/file.c" loaded by Vim.
|
||||
|
||||
This can only be solved with a "leave directory" message.
|
||||
|
||||
2) Assume you have following directories and files:
|
||||
./dir1
|
||||
./dir1/dir2
|
||||
./dir2
|
||||
|
||||
You get the following:
|
||||
|
||||
Make output Directory interpreted by Vim
|
||||
------------------------ ----------------------------
|
||||
Making all in dir1 ./dir1
|
||||
Making all in dir2 ./dir1/dir2
|
||||
Making all in dir2 ./dir1/dir2
|
||||
|
||||
This can be solved by printing absolute directories in the "enter directory"
|
||||
message or by printing "leave directory" messages..
|
||||
|
||||
To avoid this problems, ensure to print absolute directory names and "leave
|
||||
directory" messages.
|
||||
|
||||
Examples for Makefiles:
|
||||
|
||||
Unix:
|
||||
libs:
|
||||
for dn in $(LIBDIRS); do \
|
||||
(cd $$dn; echo "Entering dir '$$(pwd)'"; make); \
|
||||
echo "Leaving dir"; \
|
||||
done
|
||||
|
||||
Add
|
||||
%DEntering\ dir\ '%f',%XLeaving\ dir
|
||||
to your 'errorformat' to handle the above output.
|
||||
|
||||
Note that Vim doesn't check if the directory name in a "leave directory"
|
||||
messages is the current directory. This is why you could just use the message
|
||||
"Leaving dir".
|
||||
|
||||
=============================================================================
|
||||
9. Specific error file formats *errorformats*
|
||||
|
||||
*errorformat-Jikes*
|
||||
Jikes(TM), a source-to-bytecode Java compiler published by IBM Research,
|
||||
produces simple multi-line error messages.
|
||||
|
||||
An 'errorformat' string matching the produced messages is shown below.
|
||||
The following lines can be placed in the user's |vimrc| to overwrite Vim's
|
||||
recognized default formats, or see |:set+=| how to install this format
|
||||
additionally to the default. >
|
||||
|
||||
:set efm=%A%f:%l:%c:%*\\d:%*\\d:,
|
||||
\%C%*\\s%trror:%m,
|
||||
\%+C%*[^:]%trror:%m,
|
||||
\%C%*\\s%tarning:%m,
|
||||
\%C%m
|
||||
<
|
||||
Jikes(TM) produces a single-line error message when invoked with the option
|
||||
"+E", and can be matched with the following: >
|
||||
|
||||
:set efm=%f:%l:%v:%*\\d:%*\\d:%*\\s%m
|
||||
<
|
||||
*errorformat-javac*
|
||||
This 'errorformat' has been reported to work well for javac, which outputs a
|
||||
line with "^" to indicate the column of the error: >
|
||||
:set efm=%A%f:%l:\ %m,%-Z%p^,%-C%.%#
|
||||
or: >
|
||||
:set efm=%A%f:%l:\ %m,%+Z%p^,%+C%.%#,%-G%.%#
|
||||
<
|
||||
*errorformat-ant*
|
||||
For ant (http://jakarta.apache.org/) the above errorformat has to be modified
|
||||
to honour the leading [javac] in front of each javac output line: >
|
||||
:set efm=%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
|
||||
|
||||
The 'errorformat' can also be configured to handle ant together with either
|
||||
javac or jikes. If you're using jikes, you should tell ant to use jikes' +E
|
||||
command line switch which forces jikes to generate one-line error messages.
|
||||
This is what the second line (of a build.xml file) below does: >
|
||||
<property name = "build.compiler" value = "jikes"/>
|
||||
<property name = "build.compiler.emacs" value = "true"/>
|
||||
|
||||
The 'errorformat' which handles ant with both javac and jikes is: >
|
||||
:set efm=\ %#[javac]\ %#%f:%l:%c:%*\\d:%*\\d:\ %t%[%^:]%#:%m,
|
||||
\%A\ %#[javac]\ %f:%l:\ %m,%-Z\ %#[javac]\ %p^,%-C%.%#
|
||||
<
|
||||
*errorformat-jade*
|
||||
parsing jade (see http://www.jclark.com/) errors is simple: >
|
||||
:set efm=jade:%f:%l:%c:%t:%m
|
||||
<
|
||||
*errorformat-LaTeX*
|
||||
The following is an example how an 'errorformat' string can be specified
|
||||
for the (La)TeX typesetting system which displays error messages over
|
||||
multiple lines. The output of ":clist" and ":cc" etc. commands displays
|
||||
multi-lines in a single line, leading white space is removed.
|
||||
It should be easy to adopt the above LaTeX errorformat to any compiler output
|
||||
consisting of multi-line errors.
|
||||
|
||||
The commands can be placed in a |vimrc| file or some other Vim script file,
|
||||
eg. a script containing LaTeX related stuff which is loaded only when editing
|
||||
LaTeX sources.
|
||||
Make sure to copy all lines of the example (in the given order), afterwards
|
||||
remove the comment lines. For the '\' notation at the start of some lines see
|
||||
|line-continuation|.
|
||||
|
||||
First prepare 'makeprg' such that LaTeX will report multiple
|
||||
errors; do not stop when the first error has occurred: >
|
||||
:set makeprg=latex\ \\\\nonstopmode\ \\\\input\\{$*}
|
||||
<
|
||||
Start of multi-line error messages: >
|
||||
:set efm=%E!\ LaTeX\ %trror:\ %m,
|
||||
\%E!\ %m,
|
||||
< Start of multi-line warning messages; the first two also
|
||||
include the line number. Meaning of some regular expressions:
|
||||
- "%.%#" (".*") matches a (possibly empty) string
|
||||
- "%*\\d" ("\d\+") matches a number >
|
||||
\%+WLaTeX\ %.%#Warning:\ %.%#line\ %l%.%#,
|
||||
\%+W%.%#\ at\ lines\ %l--%*\\d,
|
||||
\%WLaTeX\ %.%#Warning:\ %m,
|
||||
< Possible continuations of error/warning messages; the first
|
||||
one also includes the line number: >
|
||||
\%Cl.%l\ %m,
|
||||
\%+C\ \ %m.,
|
||||
\%+C%.%#-%.%#,
|
||||
\%+C%.%#[]%.%#,
|
||||
\%+C[]%.%#,
|
||||
\%+C%.%#%[{}\\]%.%#,
|
||||
\%+C<%.%#>%.%#,
|
||||
\%C\ \ %m,
|
||||
< Lines that match the following patterns do not contain any
|
||||
important information; do not include them in messages: >
|
||||
\%-GSee\ the\ LaTeX%m,
|
||||
\%-GType\ \ H\ <return>%m,
|
||||
\%-G\ ...%.%#,
|
||||
\%-G%.%#\ (C)\ %.%#,
|
||||
\%-G(see\ the\ transcript%.%#),
|
||||
< Generally exclude any empty or whitespace-only line from
|
||||
being displayed: >
|
||||
\%-G\\s%#,
|
||||
< The LaTeX output log does not specify the names of erroneous
|
||||
source files per line; rather they are given globally,
|
||||
enclosed in parentheses.
|
||||
The following patterns try to match these names and store
|
||||
them in an internal stack. The patterns possibly scan over
|
||||
the same input line (one after another), the trailing "%r"
|
||||
conversion indicates the "rest" of the line that will be
|
||||
parsed in the next go until the end of line is reached.
|
||||
|
||||
Overread a file name enclosed in '('...')'; do not push it
|
||||
on a stack since the file apparently does not contain any
|
||||
error: >
|
||||
\%+O(%f)%r,
|
||||
< Push a file name onto the stack. The name is given after '(': >
|
||||
\%+P(%f%r,
|
||||
\%+P\ %\\=(%f%r,
|
||||
\%+P%*[^()](%f%r,
|
||||
\%+P[%\\d%[^()]%#(%f%r,
|
||||
< Pop the last stored file name when a ')' is scanned: >
|
||||
\%+Q)%r,
|
||||
\%+Q%*[^()])%r,
|
||||
\%+Q[%\\d%*[^()])%r
|
||||
|
||||
Note that in some cases file names in the LaTeX output log cannot be parsed
|
||||
properly. The parser might have been messed up by unbalanced parentheses
|
||||
then. The above example tries to catch the most relevant cases only.
|
||||
You can customize the given setting to suit your own purposes, for example,
|
||||
all the annoying "Overfull ..." warnings could be excluded from being
|
||||
recognized as an error.
|
||||
Alternatively to filtering the LaTeX compiler output, it is also possible
|
||||
to directly read the *.log file that is produced by the [La]TeX compiler.
|
||||
This contains even more useful information about possible error causes.
|
||||
However, to properly parse such a complex file, an external filter should
|
||||
be used. See the description further above how to make such a filter known
|
||||
by Vim.
|
||||
|
||||
*errorformat-Perl*
|
||||
In $VIMRUNTIME/tools you can find the efm_perl.pl script, which filters Perl
|
||||
error messages into a format that quickfix mode will understand. See the
|
||||
start of the file about how to use it.
|
||||
|
||||
-->
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,163 +0,0 @@
|
||||
*recover.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Recovery after a crash *crash-recovery*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
You have spent several hours typing in that text that has to be finished
|
||||
next morning, and then disaster strikes: Your computer crashes.
|
||||
|
||||
DON'T PANIC!
|
||||
|
||||
You can recover most of your changes from the files that Vim uses to store
|
||||
the contents of the file. Mostly you can recover your work with one command:
|
||||
vim -r filename
|
||||
|
||||
1. The swap file |swap-file|
|
||||
2. Recovery |recovery|
|
||||
|
||||
==============================================================================
|
||||
1. The swap file *swap-file*
|
||||
|
||||
Vim stores the things you changed in a swap file. Using the original file
|
||||
you started from plus the swap file you can mostly recover your work.
|
||||
|
||||
You can see the name of the current swap file being used with the command:
|
||||
|
||||
:sw[apname] *:sw* *:swapname*
|
||||
|
||||
The name of the swap file is normally the same as the file you are editing,
|
||||
with the extension ".swp".
|
||||
- On Unix, a '.' is prepended to swap file names in the same directory as the
|
||||
edited file. This avoids that the swap file shows up in a directory
|
||||
listing.
|
||||
- On MS-DOS machines and when the 'shortname' option is on, any '.' in the
|
||||
original file name is replaced with '_'.
|
||||
- If this file already exists (e.g., when you are recovering from a crash) a
|
||||
warning is given and another extension is used, ".swo", ".swn", etc.
|
||||
- An existing file will never be overwritten.
|
||||
- The swap file is deleted as soon as Vim stops editing the file.
|
||||
|
||||
Technical: The replacement of '.' with '_' is done to avoid problems with
|
||||
MS-DOS compatible filesystems (e.g., crossdos, multidos). If Vim
|
||||
is able to detect that the file is on an MS-DOS-like filesystem, a
|
||||
flag is set that has the same effect as the 'shortname' option.
|
||||
This flag is reset when you start editing another file.
|
||||
*E326*
|
||||
If the ".swp" file name already exists, the last character is
|
||||
decremented until there is no file with that name or ".saa" is
|
||||
reached. In the last case, no swap file is created.
|
||||
|
||||
By setting the 'directory' option you can place the swap file in another place
|
||||
than where the edited file is.
|
||||
Advantages:
|
||||
- You will not pollute the directories with ".swp" files.
|
||||
- When the 'directory' is on another partition, reduce the risk of damaging
|
||||
the file system where the file is (in a crash).
|
||||
Disadvantages:
|
||||
- You can get name collisions from files with the same name but in different
|
||||
directories (although Vim tries to avoid that by comparing the path name).
|
||||
This will result in bogus ATTENTION warning messages.
|
||||
- When you use your home directory, and somebody else tries to edit the same
|
||||
file, he will not see your swap file and will not get the ATTENTION waring
|
||||
message.
|
||||
On the Amiga you can also use a recoverable ram disk, but there is no 100%
|
||||
guarantee that this works. Putting swap files in a normal ram disk (like RAM:
|
||||
on the Amiga) or in a place that is cleared when rebooting (like /tmp on Unix)
|
||||
makes no sense, you will lose the swap file in a crash.
|
||||
|
||||
If you want to put swap files in a fixed place, put a command resembling the
|
||||
following ones in your .vimrc:
|
||||
:set dir=dh2:tmp (for Amiga)
|
||||
:set dir=~/tmp (for Unix)
|
||||
:set dir=c:\\tmp (for MS-DOS and Win32)
|
||||
This is also very handy when editing files on floppy. Of course you will have
|
||||
to create that "tmp" directory for this to work!
|
||||
|
||||
For read-only files, a swap file is not used. Unless the file is big, causing
|
||||
the amount of memory used to be higher than given with 'maxmem' or
|
||||
'maxmemtot'. And when making a change to a read-only file, the swap file is
|
||||
created anyway.
|
||||
|
||||
The 'swapfile' option can be reset to avoid creating a swapfile.
|
||||
|
||||
|
||||
Detecting an existing swap file ~
|
||||
|
||||
You can find this in the user manual, section |11.3|.
|
||||
|
||||
|
||||
Updating the swapfile ~
|
||||
|
||||
The swap file is updated after typing 200 characters or when you have not
|
||||
typed anything for four seconds. This only happens if the buffer was
|
||||
changed, not when you only moved around. The reason why it is not kept up to
|
||||
date all the time is that this would slow down normal work too much. You can
|
||||
change the 200 character count with the 'updatecount' option. You can set
|
||||
the time with the 'updatetime' option. The time is given in milliseconds.
|
||||
After writing to the swap file Vim syncs the file to disk. This takes some
|
||||
time, especially on busy Unix systems. If you don't want this you can set the
|
||||
'swapsync' option to an empty string. The risk of losing work becomes bigger
|
||||
though. On some non-Unix systems (MS-DOS, Amiga) the swap file won't be
|
||||
written at all.
|
||||
|
||||
If the writing to the swap file is not wanted, it can be switched off by
|
||||
setting the 'updatecount' option to 0. The same is done when starting Vim
|
||||
with the "-n" option. Writing can be switched back on by setting the
|
||||
'updatecount' option to non-zero. Swap files will be created for all buffers
|
||||
when doing this. But when setting 'updatecount' to zero, the existing swap
|
||||
files will not be removed, it will only affect files that will be opened
|
||||
after this.
|
||||
|
||||
If you want to make sure that your changes are in the swap file use this
|
||||
command:
|
||||
|
||||
*:pre* *:preserve* *E313* *E314*
|
||||
:pre[serve] Write all text for all buffers into swap file. The
|
||||
original file is no longer needed for recovery. {Vi:
|
||||
emergency exit}
|
||||
|
||||
A Vim swap file can be recognized by the first six characters: "b0VIM ".
|
||||
After that comes the version number, e.g., "3.0".
|
||||
|
||||
==============================================================================
|
||||
2. Recovery *recovery* *E308* *E311*
|
||||
|
||||
Basic file recovery is explained in the user manual: |usr_11.txt|.
|
||||
|
||||
Another way to do recovery is to start Vim and use the ":recover" command.
|
||||
This is easy when you start Vim to edit a file and you get the "ATTENTION:
|
||||
Found a swap file ..." message. In this case the single command ":recover"
|
||||
will do the work. You can also give the name of the file or the swap file to
|
||||
the recover command:
|
||||
*:rec* *:recover* *E305* *E306* *E307*
|
||||
:rec[over] [file] Try to recover [file] from the swap file. If [file]
|
||||
is not given use the file name for the current
|
||||
buffer. The current contents of the buffer are lost.
|
||||
This command fails if the buffer was modified.
|
||||
|
||||
:rec[over]! [file] Like ":recover", but any changes in the current
|
||||
buffer are lost.
|
||||
|
||||
*E312* *E309* *E310*
|
||||
Vim has some intelligence about what to do if the swap file is corrupt in
|
||||
some way. If Vim has doubt about what it found, it will give an error
|
||||
message and insert lines with "???" in the text. If you see an error message
|
||||
while recovering, search in the file for "???" to see what is wrong. You may
|
||||
want to cut and paste to get the text you need.
|
||||
|
||||
Be sure that the recovery was successful before overwriting the original
|
||||
file or deleting the swap file. It is good practice to write the recovered
|
||||
file elsewhere and run 'diff' to find out if the changes you want are in the
|
||||
recovered file.
|
||||
|
||||
Once you are sure the recovery is ok delete the swap file. Otherwise, you
|
||||
will continue to get warning messages that the ".swp" file already exists.
|
||||
|
||||
{Vi: recovers in another way and sends mail if there is something to recover}
|
||||
|
||||
-->
|
||||
@@ -1,188 +0,0 @@
|
||||
*remote.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Vim client-server communication *client-server*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Common functionality |clientserver|
|
||||
2. X11 specific items |x11-clientserver|
|
||||
3. MS-Windows specific items |w32-clientserver|
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
==============================================================================
|
||||
1. Common functionality *clientserver*
|
||||
|
||||
When compiled with the |+clientserver| option, Vim can act as a command
|
||||
server. It accepts messages from a client and executes them. At the same
|
||||
time, Vim can function as a client and send commands to a Vim server.
|
||||
|
||||
The following command line arguments are available:
|
||||
|
||||
argument meaning ~
|
||||
|
||||
--remote [+{cmd}] {file} ... *--remote*
|
||||
Open the file list in a remote Vim. When
|
||||
there is no Vim server, execute locally.
|
||||
The rest of the command line is taken as the
|
||||
file list. Thus any non-file arguments must
|
||||
come before this.
|
||||
You cannot edit stdin this way |--|.
|
||||
The remote Vim is raised. If you don't want
|
||||
this use >
|
||||
vim --remote-send "<C-\><C-N>:n filename<CR>"
|
||||
< --remote-silent [+{cmd}] {file} ... *--remote-silent*
|
||||
As above, but don't complain if there is no
|
||||
server.
|
||||
--remote-wait [+{cmd}] {file} ... *--remote-wait*
|
||||
As --remote, but wait for files to complete
|
||||
(unload) in remote Vim.
|
||||
--remote-wait-silent [+{cmd}] {file} ... *--remote-wait-silent*
|
||||
As --remote-wait, but don't complain if there
|
||||
is no server.
|
||||
*--servername*
|
||||
--servername {name} Become the server {name}. When used together
|
||||
with one of the --remote commands: connect to
|
||||
server {name} instead of the default (see
|
||||
below).
|
||||
*--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.
|
||||
*--serverlist*
|
||||
--serverlist Output a list of server names.
|
||||
|
||||
|
||||
Examples ~
|
||||
|
||||
Edit "file.txt" in an already running GVIM server: >
|
||||
gvim --remote file.txt
|
||||
|
||||
Edit "file.txt" in an already running server called FOOBAR: >
|
||||
gvim --servername FOOBAR --remote file.txt
|
||||
|
||||
Edit "file.txt" in server "FILES" if it exists, become server "FILES"
|
||||
otherwise: >
|
||||
gvim --servername FILES --remote-silent file.txt
|
||||
|
||||
This doesn't work, all arguments after --remote will be used as file names: >
|
||||
gvim --remote --servername FOOBAR file.txt
|
||||
|
||||
Edit file "+foo" in a remote server (note the use of "./" to avoid the special
|
||||
meaning of the leading plus): >
|
||||
vim --remote ./+foo
|
||||
|
||||
Tell the remote server "BLA" to write all files and exit: >
|
||||
vim --servername BLA --remote-send '<C-\><C-N>:wqa<CR>'
|
||||
|
||||
|
||||
SERVER NAME
|
||||
|
||||
By default Vim will try to register the name under which it was invoked (gvim,
|
||||
egvim ...). This can be overridden with the --servername argument. If the
|
||||
specified name is not available, a postfix is applied until a free name is
|
||||
encountered, ie. "gvim1" for the second invocation of gvim on a particular
|
||||
X-server. The resulting name is available in the servername builtin variable
|
||||
|v:servername|. The case of the server name is ignored, thus "gvim" and
|
||||
"GVIM" are considered equal.
|
||||
|
||||
When Vim is invoked with --remote, --remote-wait or --remote-send it will try
|
||||
to locate the server name determined by the invocation name and --servername
|
||||
argument as described above. If an exact match is not available, the first
|
||||
server with the number postfix will be used. If a name with the number
|
||||
postfix is specified with the --servername argument, it must match exactly.
|
||||
|
||||
If no server can be located and --remote or --remote-wait was used, Vim will
|
||||
start up according to the rest of the command line and do the editing by
|
||||
itself. This way it is not necessary to know whether gvim is already started
|
||||
when sending command to it.
|
||||
|
||||
The --serverlist argument will cause Vim to print a list of registered command
|
||||
servers on the standard output (stdout) and exit.
|
||||
|
||||
Win32 Note: Making the Vim server go to the foreground doesn't always work,
|
||||
because MS-Windows doesn't allow it. The client will move the server to the
|
||||
foreground when using the --remote or --remote-wait argument and the server
|
||||
name starts with "g".
|
||||
|
||||
|
||||
REMOTE EDITING
|
||||
|
||||
The --remote argument will cause a |:drop| command to be constructed from the
|
||||
rest of the command line and sent as described above.
|
||||
The --remote-wait argument does the same thing and additionally sets up to
|
||||
wait for earch of the files to have been edited. This uses the BufUnload
|
||||
event, thus as soon as a file has been unloaded, Vim assumes you are done
|
||||
editing it.
|
||||
Note that the --remote and --remote-wait arguments will consume the rest of
|
||||
the command line. Ie. all remaining arguments will be regarded as filenames.
|
||||
You can not put options there!
|
||||
|
||||
|
||||
FUNCTIONS
|
||||
*E240* *E573*
|
||||
There are a number of VimL functions for scripting the command server. See
|
||||
the description in |eval.txt| or use CTRL-] on the function name to jump to
|
||||
the full explanation.
|
||||
|
||||
synopsis explanation ~
|
||||
remote_expr( server, string, idvar) send expression
|
||||
remote_send( server, string, idvar) send key sequence
|
||||
serverlist() get a list of available servers
|
||||
remote_peek( serverid, retvar) check for reply string
|
||||
remote_read( serverid) read reply string
|
||||
server2client( serverid, string) send reply string
|
||||
remote_foreground( server) bring server to the front
|
||||
|
||||
See also the explanation of |CTRL-\_CTRL-N|. Very useful as a leading key
|
||||
sequence.
|
||||
The {serverid} for server2client() can be obtained with expand("<client>")
|
||||
|
||||
==============================================================================
|
||||
2. X11 specific items *x11-clientserver*
|
||||
*E247* *E248* *E251* *E258* *E277*
|
||||
|
||||
The communication between client and server goes through the X server. The
|
||||
display of the Vim server must be specified. The usual protection of the X
|
||||
server is used, you must be able to open a window on the X server for the
|
||||
communication to work. It is possible to communicate between different
|
||||
systems.
|
||||
|
||||
By default, a GUI Vim will register a name on the X-server by which it can be
|
||||
addressed for subsequent execution of injected strings. Vim can also act as
|
||||
a client and send strings to other instances of Vim on the same X11 display.
|
||||
|
||||
When an X11 GUI Vim (gvim) is started, it will try to register a send-server
|
||||
name on the 'VimRegistry' property on the root window.
|
||||
|
||||
A non GUI Vim with access to the X11 display (|xterm-clipboard| enabled), can
|
||||
also act as a command server if a server name is explicitly given with the
|
||||
--servername argument.
|
||||
|
||||
An empty --servername argument will cause the command server to be disabled.
|
||||
|
||||
To send commands to a Vim server from another application, read the source
|
||||
file src/if_xcmdsrv.c, it contains some hints about the protocol used.
|
||||
|
||||
==============================================================================
|
||||
2. Win32 specific items *w32-clientserver*
|
||||
|
||||
Every Win32 Vim can work as a server, also in the console. You do not need a
|
||||
version compiled with OLE. Windows messages are used, this works on any
|
||||
version of MS-Windows. But only communication within one system is possible.
|
||||
|
||||
Since MS-Windows messages are used, any other application should be able to
|
||||
communicate with a Vim server. An alternative is using the OLE functionality
|
||||
|ole-interface|.
|
||||
|
||||
When using gvim, the --remote-wait only works properly this way: >
|
||||
|
||||
start /w gvim --remote-wait file.txt
|
||||
<
|
||||
-->
|
||||
|
||||
@@ -1,528 +0,0 @@
|
||||
*repeat.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Repeating commands, Vim scripts and debugging *repeating*
|
||||
|
||||
Chapter 26 of the user manual introduces repeating |usr_26.txt|.
|
||||
|
||||
1. Single repeats |single-repeat|
|
||||
2. Multiple repeats |multi-repeat|
|
||||
3. Complex repeats |complex-repeat|
|
||||
4. Using Vim scripts |using-scripts|
|
||||
5. Debugging scripts |debug-scripts|
|
||||
|
||||
==============================================================================
|
||||
1. Single repeats *single-repeat*
|
||||
|
||||
*.*
|
||||
. Repeat last change, with count replaced with [count].
|
||||
<!--
|
||||
Also repeat a yank command, when the 'y' flag is
|
||||
included in 'cpoptions'.
|
||||
-->
|
||||
|
||||
Simple changes can be repeated with the "." command. Without a count, the
|
||||
count of the last change is used. If you enter a count, it will replace the
|
||||
last one. If the last change included a specification of a numbered register,
|
||||
the register number will be incremented. See |redo-register| for an example
|
||||
how to use this. Note that when repeating a command that used a Visual
|
||||
selection, the same SIZE of area is used, see |visual-repeat|.
|
||||
|
||||
*@:*
|
||||
@: Repeat last command-line [count] times.
|
||||
|
||||
|
||||
==============================================================================
|
||||
2. Multiple repeats *multi-repeat*
|
||||
|
||||
<!--
|
||||
*:g* *:global* *E147* *E148*
|
||||
:[range]g[lobal]/{pattern}/[cmd]
|
||||
Execute the Ex command [cmd] (default ":p") on the
|
||||
lines within [range] where {pattern} matches.
|
||||
|
||||
:[range]g[lobal]!/{pattern}/[cmd]
|
||||
Execute the Ex command [cmd] (default ":p") on the
|
||||
lines within [range] where {pattern} does NOT match.
|
||||
|
||||
*:v* *:vglobal*
|
||||
:[range]v[global]/{pattern}/[cmd]
|
||||
Same as :g!.
|
||||
|
||||
The global commands work by first scanning through the [range] lines and
|
||||
marking each line where a match occurs (for a multi-line pattern, only the
|
||||
start of the match matters).
|
||||
In a second scan the [cmd] is executed for each marked line with its line
|
||||
number prepended. For ":v" and ":g!" the command is executed for each not
|
||||
marked line. If a line is deleted its mark disappears.
|
||||
The default for [range] is the whole buffer (1,$). Use "CTRL-C" to interrupt
|
||||
the command. If an error message is given for a line, the command for that
|
||||
line is aborted and the global command continues with the next marked or
|
||||
unmarked line.
|
||||
|
||||
To repeat a non-Ex command, you can use the ":normal" command: >
|
||||
:g/pat/normal {commands}
|
||||
Make sure that {commands} ends with a whole command, otherwise Vim will wait
|
||||
for you to type the rest of the command for each match. The screen will not
|
||||
have been updated, so you don't know what you are doing. See |:normal|.
|
||||
|
||||
The undo/redo command will undo/redo the whole global command at once.
|
||||
The previous context mark will only be set once (with "''" you go back to
|
||||
where the cursor was before the global command).
|
||||
|
||||
The global command sets both the last used search pattern and the last used
|
||||
substitute pattern (this is vi compatible). This makes it easy to globally
|
||||
replace a string:
|
||||
:g/pat/s//PAT/g
|
||||
This replaces all occurrences of "pat" with "PAT". The same can be done with:
|
||||
:%s/pat/PAT/g
|
||||
Which is two characters shorter!
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
3. Complex repeats *complex-repeat*
|
||||
|
||||
*q* *recording*
|
||||
q{0-9a-zA-Z"} Record typed characters into register {0-9a-zA-Z"}
|
||||
(uppercase to append). The 'q' command is disabled
|
||||
while executing a register, and it doesn't work inside
|
||||
a mapping.
|
||||
|
||||
q Stops recording. (Implementation note: The 'q' that
|
||||
stops recording is not stored in the register, unless
|
||||
it was the result of a mapping)
|
||||
|
||||
*@*
|
||||
@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} [count]
|
||||
times. Note that register '%' (name of the current
|
||||
file) and '#' (name of the alternate file) cannot be
|
||||
used. For "@=" you are prompted to enter an
|
||||
expression. The result of the expression is then
|
||||
executed. See also |@:|.
|
||||
|
||||
*@@*
|
||||
@@ Repeat the previous @{0-9a-z":*} [count] times.
|
||||
|
||||
<!--
|
||||
:[addr]*{0-9a-z".=} *:@* *:star*
|
||||
-->
|
||||
*:@*
|
||||
:[addr]@{0-9a-z".=*} Execute the contents of register {0-9a-z".=*} as an Ex
|
||||
command. First set cursor at line [addr] (default is
|
||||
current line). When the last line in the register does
|
||||
not have a <CR> it will be added automatically when
|
||||
the 'e' flag is present in 'cpoptions'.
|
||||
<!--
|
||||
Note that the ":*" command is only recognized when the
|
||||
'*' flag is present in 'cpoptions'. This is NOT the
|
||||
default when 'nocompatible' is used.
|
||||
-->
|
||||
For ":@=" the last used expression is used. The
|
||||
result of evaluating the expression is executed as an
|
||||
Ex command.
|
||||
Mappings are not recognized in these commands.
|
||||
|
||||
*:@:*
|
||||
:[addr]@: Repeat last command-line. First set cursor at line
|
||||
[addr] (default is current line).
|
||||
|
||||
*:@@*
|
||||
:[addr]@@ Repeat the previous :@{0-9a-z"}. First set cursor at
|
||||
line [addr] (default is current line). {Vi: only in
|
||||
some versions}
|
||||
|
||||
==============================================================================
|
||||
4. Using Vim scripts *using-scripts*
|
||||
|
||||
<!--
|
||||
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 ":".
|
||||
|
||||
:so[urce]! {file} Read Vim commands from {file}. These are commands
|
||||
that are executed from Normal mode, like you type
|
||||
them.
|
||||
When used after |:global|, |:argdo|, |:windo|,
|
||||
|:bufdo|, in a loop or when another command follows
|
||||
the display won't be updated while executing the
|
||||
commands.
|
||||
|
||||
*:ru* *:runtime*
|
||||
:ru[ntime][!] {file} ..
|
||||
Read Ex commands from {file} in each directory given
|
||||
by 'runtimepath'. There is no error for non-existing
|
||||
files. Example: >
|
||||
:runtime syntax/c.vim
|
||||
|
||||
< There can be multiple {file} arguments, separated by
|
||||
spaces. Each {file} is searched for in the first
|
||||
directory from 'runtimepath', then in the second
|
||||
directory, etc. Use a backslash to include a space
|
||||
inside {file} (although it's better not to use spaces
|
||||
in file names, it causes trouble).
|
||||
|
||||
When [!] is included, all found files are sourced.
|
||||
When it is not included only the first found file is
|
||||
sourced.
|
||||
|
||||
When {file} contains wildcards it is expanded to all
|
||||
matching files. Example: >
|
||||
:runtime! plugin/*.vim
|
||||
< This is what Vim uses to load the plugin files when
|
||||
starting up. This similar command: >
|
||||
:runtime plugin/*.vim
|
||||
< would source the first file only.
|
||||
|
||||
When 'verbose' is one or higher, there is a message
|
||||
when no file could be found.
|
||||
When 'verbose' is two or higher, there is a message
|
||||
about each searched file.
|
||||
|
||||
:scripte[ncoding] [encoding] *:scripte* *:scriptencoding* *E167*
|
||||
Specify the character encoding used in the script.
|
||||
The following lines will be converted from [encoding]
|
||||
to the value of the 'encoding' option, if they are
|
||||
different. Examples: >
|
||||
scriptencoding iso-8859-5
|
||||
scriptencoding cp932
|
||||
<
|
||||
When [encoding] is empty, no conversion is done. This
|
||||
can be used to restrict conversion to a sequence of
|
||||
lines: >
|
||||
scriptencoding euc-jp
|
||||
... lines to be converted ...
|
||||
scriptencoding
|
||||
... not converted ...
|
||||
|
||||
< When conversion isn't supported by the system, there
|
||||
is no error message and no conversion is done.
|
||||
|
||||
Don't use "ucs-2" or "ucs-4", scripts cannot be in
|
||||
these encodings (they would contain NUL bytes).
|
||||
|
||||
When compiled without the |+multi_byte| feature this
|
||||
command is ignored.
|
||||
|
||||
*:scrip* *:scriptnames*
|
||||
:scrip[tnames] List all sourced script names, in the order they were
|
||||
first sourced. The number is used for the script ID
|
||||
|<SID>|.
|
||||
|
||||
*:fini* *:finish* *E168*
|
||||
:fini[sh] Stop sourcing a script. Can only be used in a Vim
|
||||
script file. This is a quick way to skip the rest of
|
||||
the file. If it is used after a |:try| but before the
|
||||
matching |:finally| (if present), the commands
|
||||
following the ":finally" up to the matching |:endtry|
|
||||
are executed first. This process applies to all
|
||||
nested ":try"s in the script. The outermost ":endtry"
|
||||
then stops sourcing the script.
|
||||
|
||||
All commands and command sequences can be repeated by putting them in a named
|
||||
register and then executing it. There are two ways to get the commands in the
|
||||
register:
|
||||
- Use the record command "q". You type the commands once, and while they are
|
||||
being executed they are stored in a register. Easy, because you can see
|
||||
what you are doing. If you make a mistake, "p"ut the register into the
|
||||
file, edit the command sequence, and then delete it into the register
|
||||
again. You can continue recording by appending to the register (use an
|
||||
uppercase letter).
|
||||
- Delete or yank the command sequence into the register.
|
||||
|
||||
Often used command sequences can be put under a function key with the ':map'
|
||||
command.
|
||||
|
||||
An alternative is to put the commands in a file, and execute them with the
|
||||
':source!' command. Useful for long command sequences. Can be combined with
|
||||
the ':map' command to put complicated commands under a function key.
|
||||
|
||||
The ':source' command reads Ex commands from a file line by line. You will
|
||||
have to type any needed keyboard input. The ':source!' command reads from a
|
||||
script file character by character, interpreting each character as if you
|
||||
typed it.
|
||||
|
||||
Example: When you give the ":!ls" command you get the |hit-enter| prompt. If
|
||||
you ':source' a file with the line "!ls" in it, you will have to type the
|
||||
<Enter> yourself. But if you ':source!' a file with the line ":!ls" in it,
|
||||
the next characters from that file are read until a <CR> is found. You will
|
||||
not have to type <CR> yourself, unless ":!ls" was the last line in the file.
|
||||
|
||||
It is possible to put ':source[!]' commands in the script file, so you can
|
||||
make a top-down hierarchy of script files. The ':source' command can be
|
||||
nested as deep as the number of files that can be opened at one time (about
|
||||
15). The ':source!' command can be nested up to 15 levels deep.
|
||||
|
||||
You can use the "<sfile>" string (literally, this is not a special key) inside
|
||||
of the sourced file, in places where a file name is expected. It will be
|
||||
replaced by the file name of the sourced file. For example, if you have a
|
||||
"other.vimrc" file in the same directory as your ".vimrc" file, you can source
|
||||
it from your ".vimrc" file with this command: >
|
||||
:source <sfile>:h/other.vimrc
|
||||
|
||||
In script files terminal-dependent key codes are represented by
|
||||
terminal-independent two character codes. This means that they can be used
|
||||
in the same way on different kinds of terminals. The first character of a
|
||||
key code is 0x80 or 128, shown on the screen as "~@". The second one can be
|
||||
found in the list |key-notation|. Any of these codes can also be entered
|
||||
with CTRL-V followed by the three digit decimal code. This does NOT work for
|
||||
the <t_xx> termcap codes, these can only be used in mappings.
|
||||
|
||||
*:source_crnl* *W15*
|
||||
MS-DOS, Win32 and OS/2: Files that are read with ":source" normally have
|
||||
<CR><NL> <EOL>s. These always work. If you are using a file with <NL> <EOL>s
|
||||
(for example, a file made on Unix), this will be recognized if 'fileformats'
|
||||
is not empty and the first line does not end in a <CR>. This fails if the
|
||||
first line has something like ":map <F1> :help^M", where "^M" is a <CR>. If
|
||||
the first line ends in a <CR>, but following ones don't, you will get an error
|
||||
message, because the <CR> from the first lines will be lost.
|
||||
|
||||
Macintosh: Files that are read with ":source" normally have <CR> <EOL>s.
|
||||
These always work. If you are using a file with <NL> <EOL>s (for example, a
|
||||
file made on Unix), this will be recognized if 'fileformats' is not empty and
|
||||
the first line does not end in a <CR>. Be careful not to use a file with <NL>
|
||||
linebreaks which has a <CR> in first line.
|
||||
|
||||
On other systems, Vim expects ":source"ed files to end in a <NL>. These
|
||||
always work. If you are using a file with <CR><NL> <EOL>s (for example, a
|
||||
file made on MS-DOS), all lines will have a trailing <CR>. This may cause
|
||||
problems for some commands (e.g., mappings). There is no automatic <EOL>
|
||||
detection, because it's common to start with a line that defines a mapping
|
||||
that ends in a <CR>, which will confuse the automaton.
|
||||
|
||||
*line-continuation*
|
||||
Long lines in a ":source"d Ex command script file can be split by inserting
|
||||
a line continuation symbol "\" (backslash) at the start of the next line.
|
||||
There can be white space before the backslash, which is ignored.
|
||||
|
||||
Example: the lines >
|
||||
:set comments=sr:/*,mb:*,el:*/,
|
||||
\://,
|
||||
\b:#,
|
||||
\:%,
|
||||
\n:>,
|
||||
\fb:-
|
||||
are interpreted as if they were given in one line:
|
||||
:set comments=sr:/*,mb:*,el:*/,://,b:#,:%,n:>,fb:-
|
||||
|
||||
All leading whitespace characters in the line before a backslash are ignored.
|
||||
Note however that trailing whitespace in the line before it cannot be
|
||||
inserted freely; it depends on the position where a command is split up
|
||||
whether additional whitespace is allowed or not.
|
||||
|
||||
There is a problem with the ":append" and ":insert" commands: >
|
||||
:1append
|
||||
\asdf
|
||||
.
|
||||
The backslash is seen as a line-continuation symbol, thus this results in the
|
||||
command: >
|
||||
:1appendasdf
|
||||
.
|
||||
To avoid this, add the 'C' flag to the 'cpoptions' option: >
|
||||
:set cpo+=C
|
||||
:1append
|
||||
\asdf
|
||||
.
|
||||
:set cpo-=C
|
||||
|
||||
Note that when the commands are inside a function, you need to add the 'C'
|
||||
flag when defining the function, it is not relevant when executing it. >
|
||||
:set cpo+=C
|
||||
:function Foo()
|
||||
:1append
|
||||
\asdf
|
||||
.
|
||||
:endfunction
|
||||
:set cpo-=C
|
||||
|
||||
Rationale:
|
||||
Most programs work with a trailing backslash to indicate line
|
||||
continuation. Using this in Vim would cause incompatibility with Vi.
|
||||
For example for this Vi mapping: >
|
||||
:map xx asdf\
|
||||
< Therefore the unusual leading backslash is used.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
5. Debugging scripts *debug-scripts*
|
||||
|
||||
<!--
|
||||
Besides the obvious messages that you can add to your scripts to find out what
|
||||
they are doing, Vim offers a debug mode. This allows you to step through a
|
||||
sourced file or user function and set breakpoints.
|
||||
|
||||
NOTE: The debugging mode is far from perfect. Debugging will have side
|
||||
effects on how Vim works. You cannot use it to debug everything. For
|
||||
example, the display is messed up by the debugging messages.
|
||||
{Vi does not have a debug mode}
|
||||
|
||||
An alternative to debug mode is setting the 'verbose' option. With a bigger
|
||||
number it will give more verbose messages about what Vim is doing.
|
||||
|
||||
|
||||
STARTING DEBUG MODE *debug-mode*
|
||||
|
||||
To enter debugging mode use one of these methods:
|
||||
1. Start Vim with the |-D| argument: >
|
||||
vim -D file.txt
|
||||
< Debugging will start as soon as the first vimrc file is sourced. This is
|
||||
useful to find out what is happening when Vim is starting up. A side
|
||||
effect is that Vim will switch the terminal mode before initialisations
|
||||
have finished, with unpredictable results.
|
||||
For a GUI-only version (Windows, Macintosh) the debugging will start as
|
||||
soon as the GUI window has been opened. To make this happen early, add a
|
||||
":gui" command in the vimrc file.
|
||||
*:debug*
|
||||
2. Run a command with ":debug" prepended. Debugging will only be done while
|
||||
this command executes. Useful for debugging a specific script or user
|
||||
function. And for scripts and functions used by autocommands. Example: >
|
||||
:debug edit test.txt.gz
|
||||
|
||||
3. Set a breakpoint in a sourced file or user function. You could do this in
|
||||
the command line: >
|
||||
vim -c "breakadd file */explorer.vim" .
|
||||
< This will run Vim and stop in the first line of the "explorer.vim" script.
|
||||
Breakpoints can also be set while in debugging mode.
|
||||
|
||||
In debugging mode every executed command is displayed before it is executed.
|
||||
Comment lines, empty lines and lines that are not executed are skipped. When
|
||||
a line contains two commands, separated by "|", each command will be displayed
|
||||
separately.
|
||||
|
||||
|
||||
DEBUG MODE
|
||||
|
||||
Once in debugging mode, the usual Ex commands can be used. For example, to
|
||||
inspect the value of a variable: >
|
||||
echo idx
|
||||
When inside a user function, this will print the value of the local variable
|
||||
"idx". Prepend "g:" to get the value of a global variable: >
|
||||
echo g:idx
|
||||
All commands are executed in the context of the current function or script.
|
||||
You can also set options, for example setting or resetting 'verbose' will show
|
||||
what happens, but you might want to set it just before executing the lines you
|
||||
are interested in: >
|
||||
:set verbose=20
|
||||
|
||||
Commands that require updating the screen should be avoided, because their
|
||||
effect won't be noticed until after leaving debug mode. For example: >
|
||||
:help
|
||||
won't be very helpful.
|
||||
|
||||
There is a separate command-line history for debug mode.
|
||||
|
||||
The line number for a function line is relative to the start of the function.
|
||||
If you have trouble figuring out where you are, edit the file that defines
|
||||
the function in another Vim, search for the start of the function and do
|
||||
"99j". Replace "99" with the line number.
|
||||
|
||||
Additionally, these commands can be used:
|
||||
*>cont*
|
||||
cont Continue execution until the next breakpoint is hit.
|
||||
*>quit*
|
||||
quit Abort execution. This is like using CTRL-C, some
|
||||
things might still be executed, doesn't abort
|
||||
everything. Still stops at the next breakpoint.
|
||||
*>next*
|
||||
next Execute the command and come back to debug mode when
|
||||
it's finished. This steps over user function calls
|
||||
and sourced files.
|
||||
*>step*
|
||||
step Execute the command and come back to debug mode for
|
||||
the next command. This steps into called user
|
||||
functions and sourced files.
|
||||
*>interrupt*
|
||||
interrupt This is like using CTRL-C, but unlike ">quit" comes
|
||||
back to debug mode for the next command that is
|
||||
executed. Useful for testing |:finally| and |:catch|
|
||||
on interrupt exceptions.
|
||||
*>finish*
|
||||
finish Finish the current script or user function and come
|
||||
back to debug mode for the command after the one that
|
||||
sourced or called it.
|
||||
|
||||
About the additional commands in debug mode:
|
||||
- There is no command-line completion.
|
||||
- You can shorten them, up to a single character: "c", "n", "s" and "f".
|
||||
- Hitting <CR> will repeat the previous one. When doing another command, this
|
||||
is reset (because it's not clear what you want to repeat).
|
||||
- When you want to use the Ex command with the same name, prepend a colon:
|
||||
":cont", ":next", ":finish" (or shorter).
|
||||
|
||||
|
||||
DEFINING BREAKPOINTS
|
||||
*:breaka* *:breakadd*
|
||||
:breaka[dd] func [lnum] {name}
|
||||
Set a breakpoint in a function. Example: >
|
||||
:breakadd func Explore
|
||||
< Doesn't check for a valid function name, thus the breakpoint
|
||||
can be set before the function is defined.
|
||||
|
||||
:breaka[dd] file [lnum] {name}
|
||||
Set a breakpoint in a sourced file. Example: >
|
||||
:breakadd file 43 .vimrc
|
||||
|
||||
The [lnum] is the line number of the breakpoint. Vim will stop at or after
|
||||
this line. When omitted line 1 is used.
|
||||
|
||||
{name} is a pattern that is matched with the file or function name. The
|
||||
pattern is like what is used for autocommands. There must be a full match (as
|
||||
if the pattern starts with "^" and ends in "$"). A "*" matches any sequence
|
||||
of characters. 'ignorecase' is not used, but "\c" can be used in the pattern
|
||||
to ignore case |/\c|. Don't include the () for the function name!
|
||||
|
||||
The match for sourced scripts is done against the full file name. Examples: >
|
||||
breakadd file explorer
|
||||
won't match, the path is missing. >
|
||||
breakadd file *explorer.vim
|
||||
matches ".../plugin/explorer.vim" and ".../plugin/iexplorer.vim". >
|
||||
breakadd file */explorer.vim
|
||||
matches ".../plugin/explorer.vim" only.
|
||||
|
||||
The match for functions is done against the name as it's shown in the output
|
||||
of ":function". For local functions this means that something like "<SNR>99_"
|
||||
is prepended.
|
||||
|
||||
|
||||
DELETING BREAKPOINTS
|
||||
*:breakd* *:breakdel* *E161*
|
||||
:breakd[el] {nr}
|
||||
Delete breakpoint {nr}. Use |:breaklist| to see the number of
|
||||
each breakpoint.
|
||||
|
||||
:breakd[el] func [lnum] {name}
|
||||
Delete a breakpoint in a function.
|
||||
|
||||
:breakd[el] file [lnum] {name}
|
||||
Delete a breakpoint in a sourced file.
|
||||
|
||||
When [lnum] is omitted, the first breakpoint in the function or file is
|
||||
deleted.
|
||||
The {name} must be exactly the same as what was typed for the ":breakadd"
|
||||
command. "explorer", "*explorer.vim" and "*explorer*" are different.
|
||||
|
||||
|
||||
LISTING BREAKPOINTS
|
||||
*:breakl* *:breaklist*
|
||||
:breakl[ist]
|
||||
List all breakpoints.
|
||||
|
||||
|
||||
OBSCURE
|
||||
|
||||
*:debugg* *:debuggreedy*
|
||||
:debugg[reedy]
|
||||
Read debug mode commands from the normal input stream, instead
|
||||
of getting them directly from the user. Only useful for test
|
||||
scripts. Example: >
|
||||
echo 'q^Mq' | vim -e -s -c debuggreedy -c 'breakadd file script.vim' -S script.vim
|
||||
|
||||
:0debugg[reedy]
|
||||
Undo ":debuggreedy": get debug mode commands directly from the
|
||||
user, don't use typeahead for debug commands.
|
||||
|
||||
-->
|
||||
@@ -1,126 +0,0 @@
|
||||
*rileft.txt* For IdeaVim version 6.2. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Right to Left display mode for Vim *rileft*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
|
||||
These functions were originally created by Avner Lottem:
|
||||
E-mail: alottem@iil.intel.com
|
||||
Phone: +972-4-8307322
|
||||
|
||||
{Vi does not have any of these commands}
|
||||
|
||||
*E26*
|
||||
This feature is only available when the |+rightleft| feature was enabled
|
||||
at compile time.
|
||||
|
||||
|
||||
Introduction
|
||||
------------
|
||||
Some languages such as Arabic, Farsi, Hebrew (among others) require the
|
||||
ability to display their text from right-to-left. Files in those languages
|
||||
are stored conventionally and the right-to-left requirement is only a
|
||||
function of the display engine (per the Unicode specification). In
|
||||
right-to-left oriented files the characters appear on the screen from
|
||||
right to left.
|
||||
|
||||
Bidirectionality (or bidi for short) is what Unicode offers as a full
|
||||
solution to these languages. Bidi offers the user the ability to view
|
||||
both right-to-left as well as left-to-right text properly at the same time
|
||||
within the same window. Vim currently, due to simplicity, does not offer
|
||||
bidi and is merely opting to present a functional means to display/enter/use
|
||||
right-to-left languages. An older hybrid solution in which direction is
|
||||
encoded for every character (or group of characters) are not supported either
|
||||
as this kind of support is out of the scope of a simple addition to an
|
||||
existing editor (and its not sanctioned by Unicode either).
|
||||
|
||||
|
||||
Highlights
|
||||
----------
|
||||
o Editing left-to-right files as in the original Vim, no change.
|
||||
|
||||
o Viewing and editing files in right-to-left windows. File orientation
|
||||
is per window, so it is possible to view the same file in right-to-left
|
||||
and left-to-right modes, simultaneously. (Useful for editing mixed files
|
||||
in which both right-to-left and left-to-right text exist).
|
||||
|
||||
o Compatibility to the original Vim. Almost all features work in
|
||||
right-to-left mode (see Bugs below).
|
||||
|
||||
o Backing from reverse insert mode to the correct place in the file
|
||||
(if possible).
|
||||
|
||||
o No special terminal with right-to-left capabilities is required. The
|
||||
right-to-left changes are completely hardware independent.
|
||||
|
||||
o Many languages use and require right-to-left support. These languages
|
||||
can quite easily be supported given the inclusion of their required
|
||||
keyboard mappings and some possible minor code change. Some of the
|
||||
current supported languages include - |arabic.txt|, |farsi.txt| and
|
||||
|hebrew.txt|.
|
||||
|
||||
|
||||
Of Interest...
|
||||
--------------
|
||||
|
||||
o Invocations
|
||||
-----------
|
||||
+ 'rightleft' ('rl') sets window orientation to right-to-left.
|
||||
+ 'delcombine' ('deco'), boolean, if editing UTF-8 encoded languages,
|
||||
allows one to remove a composing character which gets superimposed
|
||||
on those that proceeded them (some languages require this).
|
||||
+ 'rightleftcmd' ('rlc') sets the command-line within certain modes
|
||||
(such as search) to be utilized in right-to-left orientation as well.
|
||||
|
||||
o Typing backwards *ins-reverse*
|
||||
----------------
|
||||
In lieu of using full-fledged the 'rightleft' option, one can opt for
|
||||
reverse insertion. When the 'revins' (reverse insert) option is set,
|
||||
inserting happens backwards. This can be used to type right-to-left
|
||||
text. When inserting characters the cursor is not moved and the text
|
||||
moves rightwards. A <BS> deletes the character under the cursor.
|
||||
CTRL-W and CTRL-U also work in the opposite direction. <BS>, CTRL-W
|
||||
and CTRL-U do not stop at the start of insert or end of line, no matter
|
||||
how the 'backspace' option is set.
|
||||
|
||||
There is no reverse replace mode (yet).
|
||||
|
||||
If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
|
||||
in the status line when reverse Insert mode is active.
|
||||
|
||||
o Pasting when in a rightleft window
|
||||
----------------------------------
|
||||
When cutting text with the mouse and pasting it in a rightleft window
|
||||
the text will be reversed, because the characters come from the cut buffer
|
||||
from the left to the right, while inserted in the file from the right to
|
||||
the left. In order to avoid it, toggle 'revins' before pasting.
|
||||
|
||||
|
||||
Bugs
|
||||
----
|
||||
o Does not handle CTRL-A and CTRL-X commands (add and subtract) correctly
|
||||
when in rightleft window.
|
||||
|
||||
o Does not support reverse insert and rightleft modes on the command-line.
|
||||
However, functionality of the editor is not reduced, because it is
|
||||
possible to enter mappings, abbreviations and searches typed from the
|
||||
left to the right on the command-line.
|
||||
|
||||
o Somewhat slower in right-to-left mode, because right-to-left motion is
|
||||
emulated inside Vim, not by the controlling terminal.
|
||||
|
||||
o When the Athena GUI is used, the bottom scrollbar works in the wrong
|
||||
direction. This is difficult to fix.
|
||||
|
||||
o When both 'rightleft' and 'revins' are on: 'textwidth' does not work.
|
||||
Lines do not wrap at all; you just get a single, long line.
|
||||
|
||||
o There is no full bidirectionality (bidi) support.
|
||||
|
||||
-->
|
||||
|
||||
@@ -1,297 +0,0 @@
|
||||
*scroll.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Scrolling *scrolling*
|
||||
|
||||
These commands move the contents of the window. If the cursor position is
|
||||
moved off of the window, the cursor is moved onto the window (with
|
||||
'scrolloff' screen lines around it). A page is the number of lines in the
|
||||
window minus two. The mnemonics for these commands may be a bit confusing.
|
||||
Remember that the commands refer to moving the window (the part of the buffer
|
||||
that you see) upwards or downwards in the buffer. When the window moves
|
||||
upwards in the buffer, the text in the window moves downwards on your screen.
|
||||
|
||||
See section |03.7| of the user manual for an introduction.
|
||||
|
||||
1. Scrolling downwards |scroll-down|
|
||||
2. Scrolling upwards |scroll-up|
|
||||
3. Scrolling relative to cursor |scroll-cursor|
|
||||
4. Scrolling horizontally |scroll-horizontal|
|
||||
5. Scrolling synchronously |scroll-binding|
|
||||
6. Scrolling with a mouse wheel |scroll-mouse-wheel|
|
||||
|
||||
==============================================================================
|
||||
1. Scrolling downwards *scroll-down*
|
||||
|
||||
The following commands move the edit window (the part of the buffer that you
|
||||
see) downwards (this means that more lines downwards in the text buffer can be
|
||||
seen):
|
||||
|
||||
*CTRL-E*
|
||||
CTRL-E Scroll window [count] lines downwards in the buffer.
|
||||
Mnemonic: Extra lines.
|
||||
|
||||
*CTRL-D*
|
||||
CTRL-D Scroll window Downwards in the buffer. The number of
|
||||
lines comes from the 'scroll' option (default: half a
|
||||
screen). If [count] given, first set 'scroll' option
|
||||
to [count]. The cursor is moved the same number of
|
||||
lines down in the file (if possible; when lines wrap
|
||||
and when hitting the end of the file there may be a
|
||||
difference). When the cursor is on the last line of
|
||||
the buffer nothing happens and a beep is produced.
|
||||
See also 'startofline' option.
|
||||
|
||||
<S-Down> or *<S-Down>* *<kPageDown>*
|
||||
<PageDown> or *<PageDown>* *CTRL-F*
|
||||
CTRL-F Scroll window [count] pages Forwards (downwards) in
|
||||
the buffer. See also 'startofline' option.
|
||||
|
||||
*z+*
|
||||
z+ Without [count]: Redraw with the line just below the
|
||||
window at the top of the window. Put the cursor in
|
||||
that line, at the first non-blank in the line.
|
||||
With [count]: just like "z<CR>".
|
||||
|
||||
==============================================================================
|
||||
2. Scrolling upwards *scroll-up*
|
||||
|
||||
The following commands move the edit window (the part of the buffer that you
|
||||
see) upwards (this means that more lines upwards in the text buffer can be
|
||||
seen):
|
||||
|
||||
*CTRL-Y*
|
||||
CTRL-Y Scroll window [count] lines upwards in the buffer.
|
||||
Note: When using the MS-Windows key bindings CTRL-Y is
|
||||
remapped to redo.
|
||||
|
||||
*CTRL-U*
|
||||
CTRL-U Scroll window Upwards in the buffer. The number of
|
||||
lines comes from the 'scroll' option (default: half a
|
||||
screen). If [count] given, first set the 'scroll'
|
||||
option to [count]. The cursor is moved the same
|
||||
number of lines up in the file (if possible; when
|
||||
lines wrap and when hitting the end of the file there
|
||||
may be a difference). When the cursor is on the first
|
||||
line of the buffer nothing happens and a beep is
|
||||
produced. See also 'startofline' option.
|
||||
|
||||
<S-Up> or *<S-Up>* *<kPageUp>*
|
||||
<PageUp> or *<PageUp>* *CTRL-B*
|
||||
CTRL-B Scroll window [count] pages Backwards (upwards) in the
|
||||
buffer. See also 'startofline' option.
|
||||
|
||||
*z^*
|
||||
z^ Without [count]: Redraw with the line just above the
|
||||
window at the bottom of the window. Put the cursor in
|
||||
that line, at the first non-blank in the line.
|
||||
With [count]: First scroll the text to put the [count]
|
||||
line at the bottom of the window, then redraw with the
|
||||
line which is now at the top of the window at the
|
||||
bottom of the window. Put the cursor in that line, at
|
||||
the first non-blank in the line.
|
||||
|
||||
==============================================================================
|
||||
3. Scrolling relative to cursor *scroll-cursor*
|
||||
|
||||
The following commands reposition the edit window (the part of the buffer that
|
||||
you see) while keeping the cursor on the same line:
|
||||
|
||||
*z<CR>*
|
||||
z<CR> Redraw, line [count] at top of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zt*
|
||||
zt Like "z<CR>", but leave the cursor in the same
|
||||
column.
|
||||
|
||||
<!--
|
||||
*zN<CR>*
|
||||
z{height}<CR> Redraw, make window {height} lines tall. This is
|
||||
useful to make the number of lines small when screen
|
||||
updating is very slow. Cannot make the height more
|
||||
than the physical screen height.
|
||||
|
||||
-->
|
||||
*z.*
|
||||
z. Redraw, line [count] at center of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zz*
|
||||
zz Like "z.", but leave the cursor in the same column.
|
||||
Careful: If caps-lock is on, this commands becomes
|
||||
"ZZ": write buffer and exit!
|
||||
|
||||
*z-*
|
||||
z- Redraw, line [count] at bottom of window (default
|
||||
cursor line). Put cursor at first non-blank in the
|
||||
line.
|
||||
|
||||
*zb*
|
||||
zb Like "z-", but leave the cursor in the same column.
|
||||
|
||||
==============================================================================
|
||||
4. Scrolling horizontally *scroll-horizontal*
|
||||
|
||||
For the following four commands the cursor follows the screen. If the
|
||||
character that the cursor is on is moved off the screen, the cursor is moved
|
||||
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.
|
||||
|
||||
z<Left> or *zh* *z<Left>*
|
||||
zh Scroll the screen [count] characters to the right.
|
||||
|
||||
*zL*
|
||||
zL Scroll the screen half a screenwidth to the left.
|
||||
|
||||
*zH*
|
||||
zH Scroll the screen half a screenwith to the right.
|
||||
|
||||
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
|
||||
at the start (left side) of the screen.
|
||||
|
||||
*ze*
|
||||
ze Scroll the screen horizontally to position the cursor
|
||||
at the end (right side) of the screen.
|
||||
|
||||
==============================================================================
|
||||
5. Scrolling synchronously *scroll-binding*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Occasionally, it is desirable to bind two or more windows together such that
|
||||
when one window is scrolled, the other windows are scrolled also. In Vim,
|
||||
windows can be given this behavior by setting the (window-specific)
|
||||
'scrollbind' option. When a window that has 'scrollbind' set is scrolled, all
|
||||
other 'scrollbind' windows are scrolled the same amount, if possible. The
|
||||
behavior of 'scrollbind' can be modified by the 'scrollopt' option.
|
||||
|
||||
When using the scrollbars, the binding only happens when scrolling the window
|
||||
with focus (where the cursor is). You can use this to avoid scroll-binding
|
||||
for a moment without resetting options.
|
||||
|
||||
When a window also has the 'diff' option set, the scroll-binding uses the
|
||||
differences between the two buffers to synchronize the position precisely.
|
||||
Otherwise the following method is used.
|
||||
|
||||
*scrollbind-relative*
|
||||
Each 'scrollbind' window keeps track of its "relative offset," which can be
|
||||
thought of as the difference between the current window's vertical scroll
|
||||
position and the other window's vertical scroll position. When one of the
|
||||
'scrollbind' windows is asked to vertically scroll past the beginning or end
|
||||
limit of its text, the window no longer scrolls, but remembers how far past
|
||||
the limit it wishes to be. The window keeps this information so that it can
|
||||
maintain the same relative offset, regardless of its being asked to scroll
|
||||
past its buffer's limits.
|
||||
|
||||
However, if a 'scrollbind' window that has a relative offset that is past its
|
||||
buffer's limits is given the cursor focus, the other 'scrollbind' windows must
|
||||
jump to a location where the current window's relative offset is valid. This
|
||||
behavior can be changed by clearing the 'jump' flag from the 'scrollopt'
|
||||
option.
|
||||
|
||||
*syncbind* *:syncbind*
|
||||
:syncbind Force all 'scrollbind' windows to have the same
|
||||
relative offset. I.e., when any of the 'scrollbind'
|
||||
windows is scrolled to the top of its buffer, all of
|
||||
the 'scrollbind' windows will also be at the top of
|
||||
their buffers.
|
||||
|
||||
*scrollbind-quickadj*
|
||||
The 'scrollbind' flag is meaningful when using keyboard commands to vertically
|
||||
scroll a window, and also meaningful when using the vertical scrollbar of the
|
||||
window which has the cursor focus. However, when using the vertical scrollbar
|
||||
of a window which doesn't have the cursor focus, 'scrollbind' is ignored.
|
||||
This allows quick adjustment of the relative offset of 'scrollbind' windows.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
6. Scrolling with a mouse wheel *scroll-mouse-wheel*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
When your mouse has a scroll wheel, it should work with Vim in the GUI. How
|
||||
it works depends on your system. It might also work in an xterm
|
||||
|xterm-mouse-wheel|.
|
||||
|
||||
For the Win32 GUI the scroll action is hard coded. It works just like
|
||||
dragging the scrollbar of the current window. How many lines are scrolled
|
||||
depends on your mouse driver. If the scroll action causes input focus
|
||||
problems, see |intellimouse-wheel-problems|.
|
||||
|
||||
For the X11 GUIs (Motif, Athena and GTK) scrolling the wheel generates key
|
||||
presses <MouseDown> and <MouseUp>. The default action for these keys are:
|
||||
<MouseDown> scroll three lines down. *<MouseDown>*
|
||||
<S-MouseDown> scroll a full page down. *<S-MouseDown>*
|
||||
<C-MouseDown> scroll a full page down. *<C-MouseDown>*
|
||||
<MouseUp> scroll three lines up. *<MouseUp>*
|
||||
<S-MouseUp> scroll a full page up. *<S-MouseUp>*
|
||||
<C-MouseUp> scroll a full page up. *<C-MouseUp>*
|
||||
This should work in all modes, except when editing the command line.
|
||||
|
||||
Note that <MouseDown> is used for scrolling the text down, this happens when
|
||||
you turn the mouse wheel up!
|
||||
|
||||
You can modify this behavior by mapping the keys. For example, to make the
|
||||
scroll wheel move one line or half a page in Normal mode: >
|
||||
:map <MouseDown> <C-Y>
|
||||
:map <S-MouseDown> <C-U>
|
||||
:map <MouseUp> <C-E>
|
||||
:map <S-MouseUp> <C-D>
|
||||
You can also use Alt and Ctrl modifiers.
|
||||
|
||||
This only works when Vim gets the scroll wheel events, of course. You can
|
||||
check if this works with the "xev" program.
|
||||
|
||||
When using Xfree86, the /etc/XF86Config file should have the correct entry for
|
||||
your mouse. For FreeBSD, this entry works for a Logitech scrollmouse: >
|
||||
Protocol "MouseMan"
|
||||
Device "/dev/psm0"
|
||||
ZAxisMapping 4 5
|
||||
See the Xfree86 documentation for information.
|
||||
|
||||
*xterm-mouse-wheel*
|
||||
To use the mouse wheel in a new xterm you only have to make the scroll wheel
|
||||
work in your Xserver, as mentioned above.
|
||||
|
||||
To use the mouse wheel in an older xterm you must do this:
|
||||
1. Make it work in your Xserver, as mentioned above.
|
||||
2. Add translations for the xterm, so that the xterm will pass a scroll event
|
||||
to Vim as an escape sequence.
|
||||
3. Add mappings in Vim, to interpret the escape sequences as <MouseUp> or
|
||||
<MouseDown> keys.
|
||||
|
||||
You can do the translations by adding this to your ~.Xdefaults file (or other
|
||||
file where your X resources are kept): >
|
||||
|
||||
XTerm*VT100.Translations: #override \n\
|
||||
s<Btn4Down>: string("0x9b") string("[64~") \n\
|
||||
s<Btn5Down>: string("0x9b") string("[65~") \n\
|
||||
<Btn4Down>: string("0x9b") string("[62~") \n\
|
||||
<Btn5Down>: string("0x9b") string("[63~") \n\
|
||||
<Btn4Up>: \n\
|
||||
<Btn5Up>:
|
||||
|
||||
Add these mappings to your vimrc file: >
|
||||
:map <M-Esc>[62~ <MouseDown>
|
||||
:map! <M-Esc>[62~ <MouseDown>
|
||||
:map <M-Esc>[63~ <MouseUp>
|
||||
:map! <M-Esc>[63~ <MouseUp>
|
||||
:map <M-Esc>[64~ <S-MouseDown>
|
||||
:map! <M-Esc>[64~ <S-MouseDown>
|
||||
:map <M-Esc>[65~ <S-MouseUp>
|
||||
:map! <M-Esc>[65~ <S-MouseUp>
|
||||
<
|
||||
-->
|
||||
@@ -1,181 +0,0 @@
|
||||
*sign.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Sign Support Features *sign-support*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
1. Introduction |sign-intro|
|
||||
2. Commands |sign-commands|
|
||||
|
||||
{Vi does not have any of these features}
|
||||
{only available when compiled with the |+signs| feature}
|
||||
|
||||
==============================================================================
|
||||
1. Introduction *sign-intro*
|
||||
|
||||
When a debugger or other IPE tool is driving an editor it needs to be able
|
||||
to give specific highlights which quickly tell the user useful information
|
||||
about the file. One example of this would be a debugger which had an icon
|
||||
in the left-hand column denoting a breakpoint. Another example might be an
|
||||
arrow representing the Program Counter (PC). The sign features allow both
|
||||
placement of a sign, or icon, in the left-hand side of the window and
|
||||
definition of a highlight which will be applied to that line. Displaying the
|
||||
sign as an image is most likely only feasible in gvim (although Sun
|
||||
Microsystem's dtterm does support this its the only terminal emulator I know
|
||||
of which does). A text sign and the highlight should be feasible in any color
|
||||
terminal emulator.
|
||||
|
||||
Signs and highlights are not useful just for debuggers. Sun's Visual
|
||||
WorkShop uses signs and highlights to mark build errors and SourceBrowser
|
||||
hits. Additionally, the debugger supports 8 to 10 different signs and
|
||||
highlight colors. |workshop| Same for Netbeans |netbeans|.
|
||||
|
||||
There are two steps in using signs:
|
||||
|
||||
1. Define the sign. This specifies the image, text and highlighting. For
|
||||
example, you can define a "break" sign with an image of a stop roadsign and
|
||||
text "!!".
|
||||
|
||||
2. Place the sign. This specifies the file and line number where the sign is
|
||||
displayed. A defined sign can be placed several times in different lines
|
||||
and files.
|
||||
|
||||
When signs are defined for a file, Vim will automatically add a column of two
|
||||
characters to display them in. When the last sign is unplaced the column
|
||||
disappears again.
|
||||
|
||||
==============================================================================
|
||||
2. Commands *sign-commands* *:sig* *:sign*
|
||||
|
||||
Here is an example that places a sign piet, displayed with the text ">>", in
|
||||
line 23 of the current file: >
|
||||
:sign define piet text=>> texthl=Search
|
||||
:exe ":sign place 2 line=23 name=piet file=" . expand("%:p")
|
||||
|
||||
And here is the command to delete it again: >
|
||||
:sign unplace 2
|
||||
|
||||
|
||||
DEFINING A SIGN. *:sign-define* *E255* *E160* *E612*
|
||||
|
||||
:sign define {name} {argument}...
|
||||
Define a new sign or set attributes for an existing sign.
|
||||
The {name} can either be a number (all digits) or a name
|
||||
starting with a non-digit.
|
||||
About 120 different signs can be defined.
|
||||
|
||||
Accepted arguments:
|
||||
|
||||
icon={pixmap}
|
||||
Define the file name where the bitmap can be found. Should be
|
||||
a full path. The bitmap should fit in the place of two
|
||||
characters. This is not checked. If the bitmap is too big it
|
||||
will cause redraw problems. Only GTK 2 can scale the bitmap
|
||||
to fit the space available.
|
||||
toolkit supports ~
|
||||
GTK 1 pixmap (.xpm)
|
||||
GTK 2 many
|
||||
Motif pixmap (.xpm)
|
||||
|
||||
linehl={group}
|
||||
Highlighting group used for the whole line the sign is placed
|
||||
in. Most useful is defining a background color.
|
||||
|
||||
text={text} *E239*
|
||||
Define the text that is displayed when there is no icon or the
|
||||
GUI is not being used. Only printable characters are allowed
|
||||
and they must occupy one or two display cells.
|
||||
|
||||
texthl={group}
|
||||
Highlighting group used for the text item.
|
||||
|
||||
|
||||
DELETING A SIGN *:sign-undefine* *E155*
|
||||
|
||||
:sign undefine {name}
|
||||
Deletes a previously defined sign. If signs with this {name}
|
||||
are still placed this will cause trouble.
|
||||
|
||||
|
||||
LISTING SIGNS *:sign-list* *E156*
|
||||
|
||||
:sign list Lists all defined signs and their attributes.
|
||||
|
||||
:sign list {name}
|
||||
Lists one defined sign and its attributes.
|
||||
|
||||
|
||||
PLACING SIGNS *:sign-place* *E158*
|
||||
|
||||
:sign place {id} line={lnum} name={name} file={fname}
|
||||
Place sign defined as {name} at line {lnum} in file {fname}.
|
||||
The file {fname} must already be loaded in a buffer. The
|
||||
exact file name must be used, wildcards, $ENV and ~ are not
|
||||
expanded.
|
||||
|
||||
The sign is remembered under {id}, this can be used for
|
||||
further manipulation. {id} must be a number.
|
||||
It's up to the user to make sure the {id} is used only once in
|
||||
each file (if it's used several times unplacing will also have
|
||||
to be done several times and making changes may not work as
|
||||
expected).
|
||||
|
||||
:sign place {id} line={lnum} name={name} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
:sign place {id} name={name} file={fname}
|
||||
Change the placed sign {id} in file {fname} to use the defined
|
||||
sign {name}.
|
||||
This can be used to change the displayed sign without moving
|
||||
it (e.g., when the debugger has stopped at a breakpoint).
|
||||
|
||||
:sign place {id} name={name} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
|
||||
REMOVING SIGNS *:sign-unplace* *E159*
|
||||
|
||||
:sign unplace {id} file={fname}
|
||||
Remove the previously placed sign {id} from file {fname}.
|
||||
|
||||
:sign unplace {id} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
|
||||
:sign unplace {id}
|
||||
Remove the previously placed sign {id} from all files it
|
||||
appears in.
|
||||
|
||||
:sign unplace *
|
||||
Remove all placed signs.
|
||||
|
||||
:sign unplace
|
||||
Remove the placed sign at the cursor position.
|
||||
|
||||
|
||||
LISTING PLACED SIGNS
|
||||
|
||||
:sign place file={fname}
|
||||
List signs placed in file {fname}.
|
||||
|
||||
:sign place buffer={nr}
|
||||
List signs placed in buffer {nr}.
|
||||
|
||||
:sign place List placed signs in all files.
|
||||
|
||||
|
||||
JUMPING TO A SIGN *:sign-jump* *E157*
|
||||
|
||||
:sign jump {id} file={fname}
|
||||
Open the file {fname} or jump to the window that contains
|
||||
{fname} and position the cursor at sign {id}.
|
||||
If the file isn't displayed in window and the current file can
|
||||
not be |abandon|ed this fails.
|
||||
|
||||
:sign jump {id} buffer={nr}
|
||||
Same, but use buffer {nr}.
|
||||
-->
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
3905
help/txt/syntax.txt
3905
help/txt/syntax.txt
File diff suppressed because it is too large
Load Diff
@@ -1,788 +0,0 @@
|
||||
*tagsrch.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Tags and special searches *tags-and-searches*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
See section |29.1| of the user manual for an introduction.
|
||||
|
||||
1. Jump to a tag |tag-commands|
|
||||
2. Tag stack |tag-stack|
|
||||
3. Tag match list |tag-matchlist|
|
||||
4. Tags details |tag-details|
|
||||
5. Tags file format |tags-file-format|
|
||||
6. Include file searches |include-search|
|
||||
|
||||
==============================================================================
|
||||
1. Jump to a tag *tag-commands*
|
||||
|
||||
*tag* *tags*
|
||||
A tag is an identifier that appears in a "tags" file. It is a sort of label
|
||||
that can be jumped to. For example: In C programs each function name can be
|
||||
used as a tag. The "tags" file has to be generated by a program like ctags,
|
||||
before the tag commands can be used.
|
||||
|
||||
With the ":tag" command the cursor will be positioned on the tag. With the
|
||||
CTRL-] command, the keyword on which the cursor is standing is used as the
|
||||
tag. If the cursor is not on a keyword, the first keyword to the right of the
|
||||
cursor is used.
|
||||
|
||||
The ":tag" command works very well for C programs. If you see a call to a
|
||||
function and wonder what that function does, position the cursor inside of the
|
||||
function name and hit CTRL-]. This will bring you to the function definition.
|
||||
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
|
||||
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|.
|
||||
|
||||
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}
|
||||
|
||||
*v_CTRL-]*
|
||||
{Visual}CTRL-] Same as ":tag {ident}", where {ident} is the text that
|
||||
is highlighted.
|
||||
|
||||
*telnet-CTRL-]*
|
||||
CTRL-] is the default telnet escape key. When you type CTRL-] to jump to a
|
||||
tag, you will get the telnet prompt instead. Most versions of telnet allow
|
||||
changing or disabling the default escape key. See the telnet man page. You
|
||||
can 'telnet -E {Hostname}' to disable the escape character, or 'telnet -e
|
||||
{EscapeCharacter} {Hostname}' to specify another escape character. If
|
||||
possible, try to use "rsh" instead of "telnet" to avoid this problem.
|
||||
|
||||
*tag-priority*
|
||||
When there are multiple matches for a tag, this priority is used:
|
||||
1. "FSC" A full matching static tag for the current file.
|
||||
2. "F C" A full matching global tag for the current file.
|
||||
3. "F " A full matching global tag for another file.
|
||||
4. "FS " A full matching static tag for another file.
|
||||
5. " SC" An ignore-case matching static tag for the current file.
|
||||
6. " C" An ignore-case matching global tag for the current file.
|
||||
7. " " An ignore-case matching global tag for another file.
|
||||
8. " S " An ignore-case matching static tag for another file.
|
||||
|
||||
Note that when the current file changes, the priority list is mostly not
|
||||
changed, to avoid confusion when using ":tnext". It is changed when using
|
||||
":tag {ident}".
|
||||
|
||||
The ignore-case matches are not found for a ":tag" command when the
|
||||
'ignorecase' option is off. They are found when a pattern is used (starting
|
||||
with a "/") and for ":tselect", also when 'ignorecase' is off. Note that
|
||||
using ignore-case tag searching disables binary searching in the tags file,
|
||||
which causes a slowdown. This can be avoided by fold-case sorting the tag
|
||||
file. See the 'tagbsearch' option for an explanation.
|
||||
|
||||
==============================================================================
|
||||
2. Tag stack *tag-stack* *tagstack* *E425*
|
||||
|
||||
On the tag stack is remembered which tags you jumped to, and from where.
|
||||
Tags are only pushed onto the stack when the 'tagstack' option is set.
|
||||
|
||||
g<RightMouse> *g<RightMouse>*
|
||||
<C-RightMouse> *<C-RightMouse>* *CTRL-T*
|
||||
CTRL-T Jump to [count] older entry in the tag stack
|
||||
(default 1).
|
||||
|
||||
*:po* *:pop* *E555* *E556*
|
||||
:[count]po[p][!] Jump to [count] older entry in tag stack (default 1).
|
||||
See |tag-!| for [!].
|
||||
|
||||
:[count]ta[g][!] Jump to [count] newer entry in tag stack (default 1).
|
||||
See |tag-!| for [!].
|
||||
|
||||
*:tags*
|
||||
:tags Show the contents of the tag stack. The active
|
||||
entry is marked with a '>'.
|
||||
|
||||
The output of ":tags" looks like this:
|
||||
|
||||
# TO tag FROM line in file/line
|
||||
1 1 main 1 harddisk2:text/vim/test
|
||||
> 2 2 FuncA 58 i = FuncA(10);
|
||||
3 1 FuncC 357 harddisk2:text/vim/src/amiga.c
|
||||
|
||||
This list shows the tags that you jumped to and the cursor position before
|
||||
that jump. The older tags are at the top, the newer at the bottom.
|
||||
|
||||
The '>' points to the active entry. This is the tag that will be used by the
|
||||
next ":tag" command. The CTRL-T and ":pop" command will use the position
|
||||
above the active entry.
|
||||
|
||||
Below the "TO" is the number of the current match in the match list. Note
|
||||
that this doesn't change when using ":pop" or ":tag".
|
||||
|
||||
The line number and file name are remembered to be able to get back to where
|
||||
you were before the tag command. The line number will be correct, also when
|
||||
deleting/inserting lines, unless this was done by another program (e.g.
|
||||
another instance of Vim).
|
||||
|
||||
For the current file, the "file/line" column shows the text at the position.
|
||||
An indent is removed and a long line is truncated to fit in the window.
|
||||
|
||||
You can jump to previously used tags with several commands. Some examples:
|
||||
|
||||
":pop" or CTRL-T to position before previous tag
|
||||
{count}CTRL-T to position before {count} older tag
|
||||
":tag" to newer tag
|
||||
":0tag" to last used tag
|
||||
|
||||
The most obvious way to use this is while browsing through the call graph of
|
||||
a program. Consider the following call graph:
|
||||
|
||||
main ---> FuncA ---> FuncC
|
||||
---> FuncB
|
||||
|
||||
(Explanation: main calls FuncA and FuncB; FuncA calls FuncC).
|
||||
You can get from main to FuncA by using CTRL-] on the call to FuncA. Then
|
||||
you can CTRL-] to get to FuncC. If you now want to go back to main you can
|
||||
use CTRL-T twice. Then you can CTRL-] to FuncB.
|
||||
|
||||
If you issue a ":ta {ident}" or CTRL-] command, this tag is inserted at the
|
||||
current position in the stack. If the stack was full (it can hold up to 20
|
||||
entries), the oldest entry is deleted and the older entries shift one
|
||||
position up (their index number is decremented by one). If the last used
|
||||
entry was not at the bottom, the entries below the last used one are
|
||||
deleted. This means that an old branch in the call graph is lost. After the
|
||||
commands explained above the tag stack will look like this:
|
||||
|
||||
# TO tag FROM line in file
|
||||
1 main 1 harddisk2:text/vim/test
|
||||
2 FuncB 59 harddisk2:text/vim/src/main.c
|
||||
|
||||
*E73*
|
||||
When you try to use the tag stack while it doesn't contain anything you will
|
||||
get an error message.
|
||||
|
||||
==============================================================================
|
||||
3. Tag match list *tag-matchlist* *E427* *E428*
|
||||
|
||||
When there are several matching tags, these commands can be used to jump
|
||||
between them. Note that these command don't change the tag stack, they keep
|
||||
the same entry.
|
||||
|
||||
*:ts* *:tselect*
|
||||
:ts[elect][!] [ident] List the tags that match [ident], using the
|
||||
information in the tags file(s).
|
||||
When [ident] is not given, the last tag name from the
|
||||
tag stack is used.
|
||||
With a '>' in the first column is indicated which is
|
||||
the current position in the list (if there is one).
|
||||
[ident] can be a regexp pattern, see |tag-regexp|.
|
||||
See |tag-priority| for the priorities used in the
|
||||
listing.
|
||||
Example output:
|
||||
|
||||
>
|
||||
nr pri kind tag file
|
||||
1 F f mch_delay os_amiga.c
|
||||
mch_delay(msec, ignoreinput)
|
||||
> 2 F f mch_delay os_msdos.c
|
||||
mch_delay(msec, ignoreinput)
|
||||
3 F f mch_delay os_unix.c
|
||||
mch_delay(msec, ignoreinput)
|
||||
Enter nr of choice (<CR> to abort):
|
||||
<
|
||||
See |tag-priority| for the "pri" column. Note that
|
||||
this depends on the current file, thus using
|
||||
":tselect xxx" can produce different results.
|
||||
The "kind" column gives the kind of tag, if this was
|
||||
included in the tags file.
|
||||
The "info" column shows information that could be
|
||||
found in the tags file. It depends on the program
|
||||
that produced the tags file.
|
||||
When the list is long, you may get the |more-prompt|.
|
||||
If you already see the tag you want to use, you can
|
||||
type 'q' and enter the number.
|
||||
|
||||
*:sts* *:stselect*
|
||||
:sts[elect][!] [ident] Does ":tselect[!] [ident]" and splits the window for
|
||||
the selected tag.
|
||||
|
||||
*g]*
|
||||
g] Like CTRL-], but use ":tselect" instead of ":tag".
|
||||
|
||||
*v_g]*
|
||||
{Visual}g] Same as "g]", but use the highlighted text as the
|
||||
identifier.
|
||||
|
||||
*:tj* *:tjump*
|
||||
:tj[ump][!] [ident] Like ":tselect", but jump to the tag directly when
|
||||
there is only one match.
|
||||
|
||||
*:stj* *:stjump*
|
||||
:stj[ump][!] [ident] Does ":tjump[!] [ident]" and splits the window for the
|
||||
selected tag.
|
||||
|
||||
*g_CTRL-]*
|
||||
g CTRL-] Like CTRL-], but use ":tjump" instead of ":tag".
|
||||
|
||||
*v_g_CTRL-]*
|
||||
{Visual}g CTRL-] Same as "g CTRL-]", but use the highlighted text as
|
||||
the identifier.
|
||||
|
||||
*:tn* *:tnext*
|
||||
:[count]tn[ext][!] Jump to [count] next matching tag (default 1). See
|
||||
|tag-!| for [!].
|
||||
|
||||
*:tp* *:tprevious*
|
||||
:[count]tp[revious][!] Jump to [count] previous matching tag (default 1).
|
||||
See |tag-!| for [!].
|
||||
|
||||
*:tN* *:tNext*
|
||||
:[count]tN[ext][!] Same as ":tprevious".
|
||||
|
||||
*:tr* *:trewind*
|
||||
:[count]tr[ewind][!] Jump to first matching tag. If [count] is given, jump
|
||||
to [count]th matching tag. See |tag-!| for [!]. {not
|
||||
in Vi}
|
||||
|
||||
*:tf* *:tfirst*
|
||||
:[count]tf[irst][!] Same as ":trewind".
|
||||
|
||||
*:tl* *:tlast*
|
||||
:tl[ast][!] Jump to last matching tag. 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: >
|
||||
tag 1 of 3 or more
|
||||
The " or more" is used to indicate that Vim didn't try all the tags files yet.
|
||||
When using ":tnext" a few times, or with ":tlast", more matches may be found.
|
||||
|
||||
When you didn't see this message because of some other message, or you just
|
||||
want to know where you are, this command will show it again (and jump to the
|
||||
same tag as last time): >
|
||||
:0tn
|
||||
<
|
||||
*tag-skip-file*
|
||||
When a matching tag is found for which the file doesn't exist, this match is
|
||||
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.
|
||||
|
||||
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}
|
||||
|
||||
*:pts* *:ptselect*
|
||||
:pts[elect][!] [ident] Does ":tselect[!] [ident]" and shows the new tag in a
|
||||
"Preview" window. See |:ptag| for more info.
|
||||
|
||||
*:ptj* *:ptjump*
|
||||
:ptj[ump][!] [ident] Does ":tjump[!] [ident]" and shows the new tag in a
|
||||
"Preview" window. See |:ptag| for more info.
|
||||
|
||||
*:ptn* *:ptnext*
|
||||
:[count]ptn[ext][!] ":tnext" in the preview window. See |:ptag|.
|
||||
|
||||
*:ptp* *:ptprevious*
|
||||
:[count]ptp[revious][!] ":tprevious" in the preview window. See |:ptag|.
|
||||
|
||||
*:ptN* *:ptNext*
|
||||
:[count]ptN[ext][!] Same as ":ptprevious".
|
||||
|
||||
*:ptr* *:ptrewind*
|
||||
:[count]ptr[ewind][!] ":trewind" in the preview window. See |:ptag|.
|
||||
|
||||
*:ptf* *:ptfirst*
|
||||
:[count]ptf[irst][!] Same as ":ptrewind".
|
||||
|
||||
*:ptl* *:ptlast*
|
||||
:ptl[ast][!] ":tlast" in the preview window. See |:ptag|.
|
||||
|
||||
==============================================================================
|
||||
4. Tags details *tag-details*
|
||||
|
||||
*static-tag*
|
||||
A static tag is a tag that is defined for a specific file. In a C program
|
||||
this could be a static function.
|
||||
|
||||
In Vi jumping to a tag sets the current search pattern. This means that
|
||||
the "n" command after jumping to a tag does not search for the same pattern
|
||||
that it did before jumping to the tag. Vim does not do this as we consider it
|
||||
to be a bug. You can still find the tag search pattern in the search history.
|
||||
If you really want the old Vi behavior, set the 't' flag in 'cpoptions'.
|
||||
|
||||
*tag-binary-search*
|
||||
Vim uses binary searching in the tags file to find the desired tag quickly
|
||||
(when enabled at compile time |+tag_binary|). But this only works if the
|
||||
tags file was sorted on ASCII byte value. Therefore, if no match was found,
|
||||
another try is done with a linear search. If you only want the linear search,
|
||||
reset the 'tagbsearch' option. Or better: Sort the tags file!
|
||||
|
||||
Note that the binary searching is disabled when not looking for a tag with a
|
||||
specific name. This happens when ignoring case and when a regular expression
|
||||
is used that doesn't start with a fixed string. Tag searching can be a lot
|
||||
slower then. The former can be avoided by case-fold sorting the tags file.
|
||||
See 'tagbsearch' for details.
|
||||
|
||||
*tag-regexp*
|
||||
The ":tag" and "tselect" commands accept a regular expression argument. See
|
||||
|pattern| for the special characters that can be used.
|
||||
When the argument starts with '/', it is used as a pattern. If the argument
|
||||
does not start with '/', it is taken literally, as a full tag name.
|
||||
Examples: >
|
||||
:tag main
|
||||
< jumps to the tag "main" that has the highest priority. >
|
||||
:tag /^get
|
||||
< jumps to the tag that starts with "get" and has the highest priority. >
|
||||
:tag /norm
|
||||
< lists all the tags that contain "norm", including "id_norm".
|
||||
When the argument both exists literally, and match when used as a regexp, a
|
||||
literal match has a higher priority. For example, ":tag /open" matches "open"
|
||||
before "open_file" and "file_open".
|
||||
|
||||
*tag-!*
|
||||
If the tag is in the current file this will always work. Otherwise the
|
||||
performed actions depend on whether the current file was changed, whether a !
|
||||
is added to the command and on the 'autowrite' option:
|
||||
|
||||
tag in file autowrite ~
|
||||
current file changed ! option action ~
|
||||
-----------------------------------------------------------------------------
|
||||
yes x x x goto tag
|
||||
no no x x read other file, goto tag
|
||||
no yes yes x abandon current file, read other file, goto
|
||||
tag
|
||||
no yes no on write current file, read other file, goto
|
||||
tag
|
||||
no yes no off fail
|
||||
-----------------------------------------------------------------------------
|
||||
|
||||
- If the tag is in the current file, the command will always work.
|
||||
- If the tag is in another file and the current file was not changed, the
|
||||
other file will be made the current file and read into the buffer.
|
||||
- If the tag is in another file, the current file was changed and a ! is
|
||||
added to the command, the changes to the current file are lost, the other
|
||||
file will be made the current file and read into the buffer.
|
||||
- If the tag is in another file, the current file was changed and the
|
||||
'autowrite' option is on, the current file will be written, the other
|
||||
file will be made the current file and read into the buffer.
|
||||
- If the tag is in another file, the current file was changed and the
|
||||
'autowrite' option is off, the command will fail. If you want to save
|
||||
the changes, use the ":w" command and then use ":tag" without an argument.
|
||||
This works because the tag is put on the stack anyway. If you want to lose
|
||||
the changes you can use the ":tag!" command.
|
||||
|
||||
*tag-security*
|
||||
Note that Vim forbids some commands, for security reasons. This works like
|
||||
using the 'secure' option for exrc/vimrc files in the current directory. See
|
||||
|trojan-horse| and |sandbox|.
|
||||
When the {tagaddress} changes a buffer, you will get a warning message:
|
||||
"WARNING: tag command changed a buffer!!!"
|
||||
In a future version changing the buffer will be impossible. All this for
|
||||
security reasons: Somebody might hide a nasty command in the tags file, which
|
||||
would otherwise go unnoticed. Example: >
|
||||
:$d|/tag-function-name/
|
||||
{this security prevention is not present in Vi}.
|
||||
|
||||
In Vi the ":tag" command sets the last search pattern when the tag is searched
|
||||
for. In Vim this is not done, the previous search pattern is still remembered,
|
||||
unless the 't' flag is present in 'cpoptions'. The search pattern is always
|
||||
put in the search history, so you can modify it if searching fails.
|
||||
|
||||
*emacs-tags* *emacs_tags* *E430*
|
||||
Emacs style tag files are only supported if Vim was compiled with the
|
||||
|+emacs_tags| feature enabled. Sorry, there is no explanation about Emacs tag
|
||||
files here, it is only supported for backwards compatibility :-).
|
||||
|
||||
*tags-option*
|
||||
The 'tags' option is a list of file names. Each of these files is searched
|
||||
for the tag. This can be used to use a different tags file than the default
|
||||
file "tags". It can also be used to access a common tags file.
|
||||
|
||||
The next file in the list is not used when:
|
||||
- A matching static tag for the current buffer has been found.
|
||||
- A matching global tag has been found.
|
||||
This also depends on the 'ignorecase' option. If it is off, and the tags file
|
||||
only has a match without matching case, the next tags file is searched for a
|
||||
match with matching case. If no tag with matching case is found, the first
|
||||
match without matching case is used. If 'ignorecase' is on, and a matching
|
||||
global tag with or without matching case is found, this one is used, no
|
||||
further tags files are searched.
|
||||
|
||||
When a tag file name starts with "./", the '.' is replaced with the path of
|
||||
the current file. This makes it possible to use a tags file in the directory
|
||||
where the current file is (no matter what the current directory is). The idea
|
||||
of using "./" is that you can define which tag file is searched first: In the
|
||||
current directory ("tags,./tags") or in the directory of the current file
|
||||
("./tags,tags").
|
||||
|
||||
For example: >
|
||||
:set tags=./tags,tags,/home/user/commontags
|
||||
|
||||
In this example the tag will first be searched for in the file "tags" in the
|
||||
directory where the current file is. Next the "tags" file in the current
|
||||
directory. If it is not found there, then the file "/home/user/commontags"
|
||||
will be searched for the tag.
|
||||
|
||||
This can be switched off by including the 'd' flag in 'cpoptions', to make
|
||||
it Vi compatible. "./tags" will than be the tags file in the current
|
||||
directory, instead of the tags file in the directory where the current file
|
||||
is.
|
||||
|
||||
Instead of the comma a space may be used. Then a backslash is required for
|
||||
the space to be included in the string option: >
|
||||
:set tags=tags\ /home/user/commontags
|
||||
|
||||
To include a space in a file name use three backslashes. To include a comma
|
||||
in a file name use two backslashes. For example, use: >
|
||||
:set tags=tag\\\ file,/home/user/common\\,tags
|
||||
|
||||
for the files "tag file" and "/home/user/common,tags". The 'tags' option will
|
||||
have the value "tag\ file,/home/user/common\,tags".
|
||||
|
||||
If the 'tagrelative' option is on (which is the default) and using a tag file
|
||||
in another directory, file names in that tag file are relative to the
|
||||
directory where the tag file is.
|
||||
|
||||
==============================================================================
|
||||
5. Tags file format *tags-file-format* *E431*
|
||||
|
||||
*ctags* *jtags*
|
||||
A tags file can be created with an external command, for example "ctags". It
|
||||
will contain a tag for each function. Some versions of "ctags" will also make
|
||||
a tag for each "#defined" macro, typedefs, enums, etc.
|
||||
|
||||
Some programs that generate tags files:
|
||||
ctags As found on most Unix systems. Only supports C. Only
|
||||
does the basic work.
|
||||
exuberant ctags This a very good one. It works for C, C++, Java,
|
||||
Fortran, Eiffel and others. It can generate tags for
|
||||
many items. See http://ctags.sourceforge.net.
|
||||
etags Connected to Emacs. Supports many languages.
|
||||
JTags For Java, in Java. It can be found at
|
||||
http://www.fleiner.com/jtags/.
|
||||
ptags.py For Python, in Python. Found in your Python source
|
||||
directory at Tools/scripts/ptags.py.
|
||||
ptags For Perl, in Perl. It can be found at
|
||||
http://www.eleves.ens.fr:8080/home/nthiery/Tags/.
|
||||
|
||||
|
||||
The lines in the tags file must have one of these three formats:
|
||||
|
||||
1. {tagname} {TAB} {tagfile} {TAB} {tagaddress}
|
||||
2. {tagfile}:{tagname} {TAB} {tagfile} {TAB} {tagaddress}
|
||||
3. {tagname} {TAB} {tagfile} {TAB} {tagaddress} {term} {field} ..
|
||||
|
||||
The first is a normal tag, which is completely compatible with Vi. It is the
|
||||
only format produced by traditional ctags implementations. This is often used
|
||||
for functions that are global, also referenced in other files.
|
||||
|
||||
The lines in the tags file can end in <LF> or <CR><LF>. On the Macintosh <CR>
|
||||
also works. The <CR> and <NL> characters can never appear inside a line.
|
||||
|
||||
*tag-old-static*
|
||||
The second format is for a static tag only. It is obsolete now, replaced by
|
||||
the third format. It is only supported by Elvis 1.x and Vim and a few
|
||||
versions of ctags. A static tag is often used for functions that are local,
|
||||
only referenced in the file {tagfile}. Note that for the static tag, the two
|
||||
occurrences of {tagfile} must be exactly the same. Also see |tags-option|
|
||||
below, for how static tags are used.
|
||||
|
||||
The third format is new. It includes additional information in optional
|
||||
fields at the end of each line. It is backwards compatible with Vi. It is
|
||||
only supported by new versions of ctags (such as Exuberant ctags).
|
||||
|
||||
{tagname} The identifier. Normally the name of a function, but it can
|
||||
be any identifier. It cannot contain a <Tab>.
|
||||
{TAB} One <Tab> character. Note: previous versions allowed any
|
||||
white space here. This has been abandoned to allow spaces in
|
||||
{tagfile}. It can be re-enabled by including the
|
||||
|+tag_any_white| feature at compile time. *tag-any-white*
|
||||
{tagfile} The file that contains the definition of {tagname}. It can
|
||||
have an absolute or relative path. It may contain environment
|
||||
variables and wildcards (although the use of wildcards is
|
||||
doubtful). It cannot contain a <Tab>.
|
||||
{tagaddress} The Ex command that positions the cursor on the tag. It can
|
||||
be any Ex command, although restrictions apply (see
|
||||
|tag-security|). Posix only allows line numbers and search
|
||||
commands, which are mostly used.
|
||||
{term} ;" The two characters semicolon and double quote. This is
|
||||
interpreted by Vi as the start of a comment, which makes the
|
||||
following be ignored. This is for backwards compatibility
|
||||
with Vi, it ignores the following fields.
|
||||
{field} .. A list of optional fields. Each field has the form:
|
||||
|
||||
<Tab>{fieldname}:{value}
|
||||
|
||||
The {fieldname} identifies the field, and can only contain
|
||||
alphabetical characters [a-zA-Z].
|
||||
The {value} is any string, but cannot contain a <Tab>.
|
||||
These characters are special:
|
||||
"\t" stands for a <Tab>
|
||||
"\r" stands for a <CR>
|
||||
"\n" stands for a <NL>
|
||||
"\\" stands for a single '\' character
|
||||
|
||||
There is one field that doesn't have a ':'. This is the kind
|
||||
of the tag. It is handled like it was preceded with "kind:".
|
||||
See the documentation of ctags for the kinds it produces.
|
||||
|
||||
The only other field currently recognized by Vim is "file:"
|
||||
(with an empty value). It is used for a static tag.
|
||||
|
||||
The first lines in the tags file can contain lines that start with
|
||||
!_TAG_
|
||||
These are sorted to the first lines, only rare tags that start with "!" can
|
||||
sort to before them. Vim only recognizes the line that indicates if the file
|
||||
was sorted. When this line is found, Vim uses binary searching for the tags
|
||||
file: >
|
||||
!_TAG_FILE_SORTED<Tab>1
|
||||
<
|
||||
A tag file may be case-fold sorted to avoid a linear search when 'ignorecase'
|
||||
is on. See 'tagbsearch' for details. The value '2' should be used then: >
|
||||
!_TAG_FILE_SORTED<Tab>2
|
||||
<
|
||||
*tag-search*
|
||||
The command can be any Ex command, but often it is a search command.
|
||||
Examples: >
|
||||
tag1 file1 /^main(argc, argv)/
|
||||
tag2 file2 108
|
||||
|
||||
The command is always executed with 'magic' not set. The only special
|
||||
characters in a search pattern are "^" (begin-of-line) and "$" (<EOL>).
|
||||
See |pattern|. Note that you must put a backslash before each backslash in
|
||||
the search text. This is for backwards compatibility with Vi.
|
||||
|
||||
*E434* *E435*
|
||||
If the command is a normal search command (it starts and ends with "/" or
|
||||
"?"), some special handling is done:
|
||||
- Searching starts on line 1 of the file.
|
||||
The direction of the search is forward for "/", backward for "?".
|
||||
Note that 'wrapscan' does not matter, the whole file is always searched. {Vi
|
||||
does use 'wrapscan', which caused tags sometimes not be found). {Vi starts
|
||||
searching in line 2 of another file. It does not find a tag in line 1 of
|
||||
another file when 'wrapscan' is not set}
|
||||
- If the search fails, another try is done ignoring case. If that fails too,
|
||||
a search is done for:
|
||||
"^tagname[ \t]*("
|
||||
(the tag with '^' prepended and "[ \t]*(" appended). When using function
|
||||
names, this will find the function name when it is in column 0. This will
|
||||
help when the arguments to the function have changed since the tags file was
|
||||
made. If this search also fails another search is done with:
|
||||
"^[#a-zA-Z_].*\<tagname[ \t]*("
|
||||
This means: A line starting with '#' or an identifier and containing the tag
|
||||
followed by white space and a '('. This will find macro names and function
|
||||
names with a type prepended.
|
||||
|
||||
==============================================================================
|
||||
6. Include file searches *include-search* *definition-search*
|
||||
*E387* *E388* *E389*
|
||||
|
||||
These commands look for a string in the current file and in all encountered
|
||||
included files (recursively). This can be used to find the definition of a
|
||||
variable, function or macro. If you only want to search in the current
|
||||
buffer, use the commands listed at |pattern-searches|.
|
||||
|
||||
These commands are not available when the |+find_in_path| feature was disabled
|
||||
at compile time.
|
||||
|
||||
When a line is encountered that includes another file, that file is searched
|
||||
before continuing in the current buffer. Files included by included files are
|
||||
also searched. When an include file could not be found it is silently
|
||||
ignored. Use the |:checkpath| command to discover which files could not be
|
||||
found, possibly your 'path' option is not set up correctly. Note: the
|
||||
included file is searched, not a buffer that may be editing that file. Only
|
||||
for the current file the lines in the buffer are used.
|
||||
|
||||
The string can be any keyword or a defined macro. For the keyword any match
|
||||
will be found. For defined macros only lines that match with the 'define'
|
||||
option will be found. The default is "^#\s*define", which is for C programs.
|
||||
For other languages you probably want to change this. See 'define' for an
|
||||
example for C++. The string cannot contain an end-of-line, only matches
|
||||
within a line are found.
|
||||
|
||||
When a match is found for a defined macro, the displaying of lines continues
|
||||
with the next line when a line ends in a backslash.
|
||||
|
||||
The commands that start with "[" start searching from the start of the current
|
||||
file. The commands that start with "]" start at the current cursor position.
|
||||
|
||||
The 'include' option is used to define a line that includes another file. The
|
||||
default is "\^#\s*include", which is for C programs. Note: Vim does not
|
||||
recognize C syntax, if the 'include' option matches a line inside
|
||||
"#ifdef/#endif" or inside a comment, it is searched anyway. The 'isfname'
|
||||
option is used to recognize the file name that comes after the matched
|
||||
pattern.
|
||||
|
||||
The 'path' option is used to find the directory for the include files that
|
||||
do not have an absolute path.
|
||||
|
||||
The 'comments' option is used for the commands that display a single line or
|
||||
jump to a line. It defines patterns that may start a comment. Those lines
|
||||
are ignored for the search, unless [!] is used. One exception: When the line
|
||||
matches the pattern "^# *define" it is not considered to be a comment.
|
||||
|
||||
If you want to list matches, and then select one to jump to, you could use a
|
||||
mapping to do that for you. Here is an example: >
|
||||
|
||||
:map <F4> [I:let nr = input("Which one: ")<Bar>exe "normal " . nr ."[\t"<CR>
|
||||
<
|
||||
*[i*
|
||||
[i Display the first line that contains the keyword
|
||||
under the cursor. The search starts at the beginning
|
||||
of the file. Lines that look like a comment are
|
||||
ignored (see 'comments' option). If a count is given,
|
||||
the count'th matching line is displayed, and comment
|
||||
lines are not ignored.
|
||||
|
||||
*]i*
|
||||
]i like "[i", but start at the current cursor position.
|
||||
|
||||
*:is* *:isearch*
|
||||
:[range]is[earch][!] [count] [/]pattern[/]
|
||||
Like "[i" and "]i", but search in [range] lines
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*[I*
|
||||
[I Display all lines that contain the keyword under the
|
||||
cursor. Filenames and line numbers are displayed
|
||||
for the found lines. The search starts at the
|
||||
beginning of the file.
|
||||
|
||||
*]I*
|
||||
]I like "[I", but start at the current cursor position.
|
||||
|
||||
*:il* *:ilist*
|
||||
:[range]il[ist][!] [/]pattern[/]
|
||||
Like "[I" and "]I", but search in [range] lines
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*[_CTRL-I*
|
||||
[ CTRL-I Jump to the first line that contains the keyword
|
||||
under the cursor. The search starts at the beginning
|
||||
of the file. Lines that look like a comment are
|
||||
ignored (see 'comments' option). If a count is given,
|
||||
the count'th matching line is jumped to, and comment
|
||||
lines are not ignored.
|
||||
|
||||
*]_CTRL-I*
|
||||
] CTRL-I like "[ CTRL-I", but start at the current cursor
|
||||
position.
|
||||
|
||||
*:ij* *:ijump*
|
||||
:[range]ij[ump][!] [count] [/]pattern[/]
|
||||
Like "[ CTRL-I" and "] CTRL-I", but search in
|
||||
[range] lines (default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
CTRL-W CTRL-I *CTRL-W_CTRL-I* *CTRL-W_i*
|
||||
CTRL-W i Open a new window, with the cursor on the first line
|
||||
that contains the keyword under the cursor. The
|
||||
search starts at the beginning of the file. Lines
|
||||
that look like a comment line are ignored (see
|
||||
'comments' option). If a count is given, the count'th
|
||||
matching line is jumped to, and comment lines are not
|
||||
ignored.
|
||||
|
||||
*:isp* *:isplit*
|
||||
:[range]isp[lit][!] [count] [/]pattern[/]
|
||||
Like "CTRL-W i" and "CTRL-W i", but search in
|
||||
[range] lines (default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*[d*
|
||||
[d Display the first macro definition that contains the
|
||||
macro under the cursor. The search starts from the
|
||||
beginning of the file. If a count is given, the
|
||||
count'th matching line is displayed.
|
||||
|
||||
*]d*
|
||||
]d like "[d", but start at the current cursor position.
|
||||
|
||||
*:ds* *:dsearch*
|
||||
:[range]ds[earch][!] [count] [/]string[/]
|
||||
Like "[d" and "]d", but search in [range] lines
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*[D*
|
||||
[D Display all macro definitions that contain the macro
|
||||
under the cursor. Filenames and line numbers are
|
||||
displayed for the found lines. The search starts
|
||||
from the beginning of the file.
|
||||
|
||||
*]D*
|
||||
]D like "[D", but start at the current cursor position.
|
||||
|
||||
*:dl* *:dlist*
|
||||
:[range]dl[ist][!] [/]string[/]
|
||||
Like "[D" and "]D", but search in [range] lines
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*[_CTRL-D*
|
||||
[ CTRL-D Jump to the first macro definition that contains the
|
||||
keyword under the cursor. The search starts from
|
||||
the beginning of the file. If a count is given, the
|
||||
count'th matching line is jumped to.
|
||||
|
||||
*]_CTRL-D*
|
||||
] CTRL-D like "[ CTRL-D", but start at the current cursor
|
||||
position.
|
||||
|
||||
*:dj* *:djump*
|
||||
:[range]dj[ump][!] [count] [/]string[/]
|
||||
Like "[ CTRL-D" and "] CTRL-D", but search in
|
||||
[range] lines (default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
CTRL-W CTRL-D *CTRL-W_CTRL-D* *CTRL-W_d*
|
||||
CTRL-W d Open a new window, with the cursor on the first
|
||||
macro definition line that contains the keyword
|
||||
under the cursor. The search starts from the
|
||||
beginning of the file. If a count is given, the
|
||||
count'th matching line is jumped to.
|
||||
|
||||
*:dsp* *:dsplit*
|
||||
:[range]dsp[lit][!] [count] [/]string[/]
|
||||
Like "CTRL-W d", but search in [range] lines
|
||||
(default: whole file).
|
||||
See |:search-args| for [/] and [!].
|
||||
|
||||
*:che* *:checkpath*
|
||||
:che[ckpath] List all the included files that could not be found.
|
||||
|
||||
:che[ckpath]! List all the included files.
|
||||
|
||||
*:search-args*
|
||||
Common arguments for the commands above:
|
||||
[!] When included, find matches in lines that are recognized as comments.
|
||||
When excluded, a match is ignored when the line is recognized as a
|
||||
comment (according to 'comments'), or the match is in a C comment (after
|
||||
"//" or inside /* */). Note that a match may be missed if a line is
|
||||
recognized as a comment, but the comment ends halfway the line.
|
||||
And if the line is a comment, but it is not recognized (according to
|
||||
'comments') a match may be found in it anyway. Example: >
|
||||
/* comment
|
||||
foobar */
|
||||
< A match for "foobar" is found, because this line is not recognized as a
|
||||
comment (even though syntax highlighting does recognize it).
|
||||
Note: Since a macro definition mostly doesn't look like a comment, the
|
||||
[!] makes no difference for ":dlist", ":dsearch" and ":djump".
|
||||
[/] A pattern can be surrounded by '/'. Without '/' only whole words are
|
||||
matched, using the pattern "\<pattern\>". Only after the second '/' a
|
||||
next command can be appended with '|'. Example: >
|
||||
:isearch /string/ | echo "the last one"
|
||||
< For a ":djump", ":dsplit", ":dlist" and ":dsearch" command the pattern
|
||||
is used as a literal string, not as a search pattern.
|
||||
-->
|
||||
|
||||
@@ -1,812 +0,0 @@
|
||||
*term.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Terminal information *terminal-info*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Vim uses information about the terminal you are using to fill the screen and
|
||||
recognize what keys you hit. If this information is not correct the screen
|
||||
may be messed up or keys may not be recognized. The actions which have to be
|
||||
performed on the screen are accomplished by outputting a string of
|
||||
characters. Special keys produce a string of characters. These strings are
|
||||
stored in the terminal options, see |terminal-options|.
|
||||
|
||||
NOTE: Most of this is not used when running the |GUI|.
|
||||
|
||||
1. Startup |startup-terminal|
|
||||
2. Terminal options |terminal-options|
|
||||
3. Window size |window-size|
|
||||
4. Slow and fast terminals |slow-fast-terminal|
|
||||
5. Using the mouse |mouse-using|
|
||||
|
||||
==============================================================================
|
||||
1. Startup *startup-terminal*
|
||||
|
||||
When Vim is started a default terminal type is assumed. For the Amiga this is
|
||||
a standard CLI window, for MS-DOS the pc terminal, for Unix an ansi terminal.
|
||||
A few other terminal types are always available, see below |builtin-terms|.
|
||||
|
||||
You can give the terminal name with the '-T' Vim argument. If it is not given
|
||||
Vim will try to get the name from the TERM environment variable.
|
||||
|
||||
*termcap* *terminfo* *E557* *E558* *E559*
|
||||
On Unix the terminfo database or termcap file is used. This is referred to as
|
||||
"termcap" in all the documentation. At compile time, when running configure,
|
||||
the choice whether to use terminfo or termcap is done automatically. When
|
||||
running Vim the output of ":version" will show |+terminfo| if terminfo is
|
||||
used. Also see |xterm-screens|.
|
||||
|
||||
On non-Unix systems a termcap is only available if Vim was compiled with
|
||||
TERMCAP defined.
|
||||
|
||||
*builtin-terms* *builtin_terms*
|
||||
Which builtin terminals are available depends on a few defines in feature.h,
|
||||
which needs to be set at compile time:
|
||||
define output of ":version" terminals builtin ~
|
||||
NO_BUILTIN_TCAPS -builtin_terms none
|
||||
SOME_BUILTIN_TCAPS +builtin_terms most common ones (default)
|
||||
ALL_BUILTIN_TCAPS ++builtin_terms all available
|
||||
|
||||
You can see a list of available builtin terminals with ":set term=xxx" (when
|
||||
not running the GUI). Also see |+builtin_terms|.
|
||||
|
||||
If the termcap code is included Vim will try to get the strings for the
|
||||
terminal you are using from the termcap file and the builtin termcaps. Both
|
||||
are always used, if an entry for the terminal you are using is present. Which
|
||||
one is used first depends on the 'ttybuiltin' option:
|
||||
|
||||
'ttybuiltin' on 1: builtin termcap 2: external termcap
|
||||
'ttybuiltin' off 1: external termcap 2: builtin termcap
|
||||
|
||||
If an option is missing in one of them, it will be obtained from the other
|
||||
one. If an option is present in both, the one first encountered is used.
|
||||
|
||||
Which external termcap file is used varies from system to system and may
|
||||
depend on the environment variables "TERMCAP" and "TERMPATH". See "man
|
||||
tgetent".
|
||||
|
||||
Settings depending on terminal *term-dependent-settings*
|
||||
|
||||
If you want to set options or mappings, depending on the terminal name, you
|
||||
can do this best in your .vimrc. Example: >
|
||||
|
||||
if &term == "xterm"
|
||||
... xterm maps and settings ...
|
||||
elseif &term =~ "vt10."
|
||||
... vt100, vt102 maps and settings ...
|
||||
endif
|
||||
<
|
||||
*raw-terminal-mode*
|
||||
For normal editing the terminal will be put into "raw" mode. The strings
|
||||
defined with 't_ti' and 't_ks' will be sent to the terminal. Normally this
|
||||
puts the terminal in a state where the termcap codes are valid and activates
|
||||
the cursor and function keys. When Vim exits the terminal will be put back
|
||||
into the mode it was before Vim started. The strings defined with 't_te' and
|
||||
't_ke' will be sent to the terminal. On the Amiga with commands that execute
|
||||
an external command (e.g., "!!") the terminal will be put into Normal mode for
|
||||
a moment. This means that you can stop the output to the screen by hitting a
|
||||
printing key. Output resumes when you hit <BS>.
|
||||
|
||||
*cs7-problem*
|
||||
Note: If the terminal settings are changed after running Vim, you might have
|
||||
an illegal combination of settings. This has been reported on Solaris 2.5
|
||||
with "stty cs8 parenb", which is restored as "stty cs7 parenb". Use
|
||||
"stty cs8 -parenb -istrip" instead, this is restored correctly.
|
||||
|
||||
Some termcap entries are wrong in the sense that after sending 't_ks' the
|
||||
cursor keys send codes different from the codes defined in the termcap. To
|
||||
avoid this you can set 't_ks' (and 't_ke') to empty strings. This must be
|
||||
done during initialization (see |initialization|), otherwise it's too late.
|
||||
|
||||
Some termcap entries assume that the highest bit is always reset. For
|
||||
example: The cursor-up entry for the amiga could be ":ku=\EA:". But the Amiga
|
||||
really sends "\233A". This works fine if the highest bit is reset, e.g., when
|
||||
using an Amiga over a serial line. If the cursor keys don't work, try the
|
||||
entry ":ku=\233A:".
|
||||
|
||||
Some termcap entries have the entry ":ku=\E[A:". But the Amiga really sends
|
||||
"\233A". On output "\E[" and "\233" are often equivalent, on input they
|
||||
aren't. You will have to change the termcap entry, or change the key code with
|
||||
the :set command to fix this.
|
||||
|
||||
Many cursor key codes start with an <Esc>. Vim must find out if this a single
|
||||
hit of the <Esc> key or the start of a cursor key sequence. It waits for a
|
||||
next character to arrive. If it does not arrive within one second a single
|
||||
<Esc> is assumed. On very slow systems this may fail, causing cursor keys not
|
||||
to work sometimes. If you discover this problem reset the 'timeout' option.
|
||||
Vim will wait for the next character to arrive after an <Esc>. If you want to
|
||||
enter a single <Esc> you must type it twice. Resetting the 'esckeys' option
|
||||
avoids this problems in Insert mode, but you lose the possibility to use
|
||||
cursor and function keys in Insert mode.
|
||||
|
||||
On the Amiga the recognition of window resizing is activated only when the
|
||||
terminal name is "amiga" or "builtin_amiga".
|
||||
|
||||
Some terminals have confusing codes for the cursor keys. The televideo 925 is
|
||||
such a terminal. It sends a CTRL-H for cursor-left. This would make it
|
||||
impossible to distinguish a backspace and cursor-left. To avoid this problem
|
||||
CTRL-H is never recognized as cursor-left.
|
||||
|
||||
*vt100-cursor-keys* *xterm-cursor-keys*
|
||||
Other terminals (e.g., vt100 and xterm) have cursor keys that send <Esc>OA,
|
||||
<Esc>OB, etc. Unfortunately these are valid commands in insert mode: Stop
|
||||
insert, Open a new line above the new one, start inserting 'A', 'B', etc.
|
||||
Instead of performing these commands Vim will erroneously recognize this typed
|
||||
key sequence as a cursor key movement. To avoid this and make Vim do what you
|
||||
want in either case you could use these settings:
|
||||
:set notimeout " don't timeout on mappings
|
||||
:set ttimeout " do timeout on terminal key codes
|
||||
:set timeoutlen=100 " timeout in 100 msec
|
||||
This requires the key-codes to be sent within 100msec in order to recognize
|
||||
them as a cursor key. When you type you normally are not that fast, so they
|
||||
are recognized as individual typed commands, even though Vim receives the same
|
||||
sequence of bytes.
|
||||
|
||||
*vt100-function-keys* *xterm-function-keys*
|
||||
An xterm can send function keys F1 to F4 in two modes: vt100 compatible or
|
||||
not. Because Vim cannot know what the xterm is sending, both types of keys
|
||||
are recognized. The same happens for the <Home> and <End> keys.
|
||||
normal vt100 ~
|
||||
<F1> t_k1 <Esc>[11~ <xF1> <Esc>OP *<xF1>-xterm*
|
||||
<F2> t_k2 <Esc>[12~ <xF2> <Esc>OQ *<xF2>-xterm*
|
||||
<F3> t_k3 <Esc>[13~ <xF3> <Esc>OR *<xF3>-xterm*
|
||||
<F4> t_k4 <Esc>[14~ <xF4> <Esc>OS *<xF4>-xterm*
|
||||
<Home> t_kh <Esc>[7~ <xHome> <Esc>OH *<xHome>-xterm*
|
||||
<End> t_@7 <Esc>[4~ <xEnd> <Esc>OF *<xEnd>-xterm*
|
||||
|
||||
When Vim starts, <xF1> is mapped to <F1>, <xF2> to <F2> etc. This means that
|
||||
by default both codes to the same thing. If you make a mapping for <xF2>,
|
||||
because your terminal does have two keys, the default mapping is overwritten,
|
||||
thus you can use the <F2> and <xF2> keys for something different.
|
||||
|
||||
*xterm-shifted-keys*
|
||||
Newer versions of xterm support shifted function keys and special keys. Vim
|
||||
recognizes most of them. Use ":set termcap" to check which are supported and
|
||||
what the codes are. Mostly these are not in a termcap, they are only
|
||||
supported by the builtin_xterm termcap.
|
||||
|
||||
*xterm-scroll-region*
|
||||
The default termcap entry for xterm on sun and other platforms does not
|
||||
contain the entry for scroll regions. Add ":cs=\E[%i%d;%dr:" to the xterm
|
||||
entry in /etc/termcap and everything should work.
|
||||
|
||||
*xterm-end-home-keys*
|
||||
On some systems (at least on FreeBSD with X386 3.1.2) the codes that the <End>
|
||||
and <Home> keys send contain a <Nul> character. To make these keys send the
|
||||
proper key code, add these lines to your ~/.Xdefaults file:
|
||||
|
||||
*VT100.Translations: #override \n\
|
||||
<Key>Home: string("0x1b") string("[7~") \n\
|
||||
<Key>End: string("0x1b") string("[8~")
|
||||
|
||||
*xterm-8bit* *xterm-8-bit*
|
||||
Xterm can be run in a mode where it uses 8-bit escape sequences. The CSI code
|
||||
is used instead of <Esc>[. The advantage is that an <Esc> can quickly be
|
||||
recognized in Insert mode, because it can't be confused with the start of a
|
||||
special key.
|
||||
For the builtin termcap entries, Vim checks if the 'term' option contains
|
||||
"8bit" anywhere. It then uses 8-bit characters for the termcap entries, the
|
||||
mouse and a few other things. You would normally set $TERM in your shell to
|
||||
"xterm-8bit" and Vim picks this up and adjusts to the 8-bit setting
|
||||
automatically.
|
||||
When Vim receives a response to the |t_RV| (request version) sequence and it
|
||||
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*
|
||||
|
||||
The terminal options can be set just like normal options. But they are not
|
||||
shown with the ":set all" command. Instead use ":set termcap".
|
||||
|
||||
It is always possible to change individual strings by setting the
|
||||
appropriate option. For example: >
|
||||
:set t_ce=^V^[[K (CTRL-V, <Esc>, [, K)
|
||||
|
||||
{Vi: no terminal options. You have to exit Vi, edit the termcap entry and
|
||||
try again}
|
||||
|
||||
The options are listed below. The associated termcap code is always equal to
|
||||
the last two characters of the option name. Only one termcap codes is
|
||||
required: Cursor positioning.
|
||||
|
||||
The options 't_da', 't_db', 't_ms', 't_xs' represent flags in the termcap.
|
||||
When the termcap flag is present, the option will be set to "y". But any
|
||||
non-empty string means that the flag is set. An empty string means that the
|
||||
flag is not set. 't_CS' works like this too, but it isn't a termcap flag.
|
||||
|
||||
OUTPUT CODES
|
||||
option meaning ~
|
||||
|
||||
t_AB set background color (ANSI) *t_AB* *'t_AB'*
|
||||
t_AF set foreground color (ANSI) *t_AF* *'t_AF'*
|
||||
t_AL add number of blank lines *t_AL* *'t_AL'*
|
||||
t_al add new blank line *t_al* *'t_al'*
|
||||
t_bc backspace character *t_bc* *'t_bc'*
|
||||
t_cd clear to end of screen *t_cd* *'t_cd'*
|
||||
t_ce clear to end of line *t_ce* *'t_ce'*
|
||||
t_cl clear screen *t_cl* *'t_cl'*
|
||||
t_cm cursor motion (required!) *E437* *t_cm* *'t_cm'*
|
||||
t_Co number of colors *t_Co* *'t_Co'*
|
||||
t_CS if non-empty, cursor relative to scroll region *t_CS* *'t_CS'*
|
||||
t_cs define scrolling region *t_cs* *'t_cs'*
|
||||
t_CV define vertical scrolling region *t_CV* *'t_CV'*
|
||||
t_da if non-empty, lines from above scroll down *t_da* *'t_da'*
|
||||
t_db if non-empty, lines from below scroll up *t_db* *'t_db'*
|
||||
t_DL delete number of lines *t_DL* *'t_DL'*
|
||||
t_dl delete line *t_dl* *'t_dl'*
|
||||
t_fs set window title end (from status line) *t_fs* *'t_fs'*
|
||||
t_ke out of "keypad transmit" mode *t_ke* *'t_ke'*
|
||||
t_ks put terminal in "keypad transmit" mode *t_ks* *'t_ks'*
|
||||
t_le move cursor one char left *t_le* *'t_le'*
|
||||
t_mb blinking mode *t_mb* *'t_mb'*
|
||||
t_md bold mode *t_md* *'t_md'*
|
||||
t_me Normal mode (undoes t_mr, t_mb, t_md and color) *t_me* *'t_me'*
|
||||
t_mr reverse (invert) mode *t_mr* *'t_mr'*
|
||||
*t_ms* *'t_ms'*
|
||||
t_ms if non-empty, cursor can be moved in standout/inverse mode
|
||||
t_nd non destructive space character *t_nd* *'t_nd'*
|
||||
t_op reset to original color pair *t_op* *'t_op'*
|
||||
t_RI cursor number of chars right *t_RI* *'t_RI'*
|
||||
t_Sb set background color *t_Sb* *'t_Sb'*
|
||||
t_Sf set foreground color *t_Sf* *'t_Sf'*
|
||||
t_se standout end *t_se* *'t_se'*
|
||||
t_so standout mode *t_so* *'t_so'*
|
||||
t_sr scroll reverse (backward) *t_sr* *'t_sr'*
|
||||
t_te out of "termcap" mode *t_te* *'t_te'*
|
||||
t_ti put terminal in "termcap" mode *t_ti* *'t_ti'*
|
||||
t_ts set window title start (to status line) *t_ts* *'t_ts'*
|
||||
t_ue underline end *t_ue* *'t_ue'*
|
||||
t_us underline mode *t_us* *'t_us'*
|
||||
t_ut clearing uses the current background color *t_ut* *'t_ut'*
|
||||
t_vb visual bell *t_vb* *'t_vb'*
|
||||
t_ve cursor visible *t_ve* *'t_ve'*
|
||||
t_vi cursor invisible *t_vi* *'t_vi'*
|
||||
t_vs cursor very visible *t_vs* *'t_vs'*
|
||||
*t_xs* *'t_xs'*
|
||||
t_xs if non-empty, standout not erased by overwriting (hpterm)
|
||||
t_ZH italics mode *t_ZH* *'t_ZH'*
|
||||
t_ZR italics end *t_ZR* *'t_ZR'*
|
||||
|
||||
Added by Vim (there are no standard codes for these):
|
||||
t_IS set icon text start *t_IS* *'t_IS'*
|
||||
t_IE set icon text end *t_IE* *'t_IE'*
|
||||
t_WP set window position (Y, X) in pixels *t_WP* *'t_WP'*
|
||||
t_WS set window size (height, width) in characters *t_WS* *'t_WS'*
|
||||
t_RV request terminal version string (for xterm) *t_RV* *'t_RV'*
|
||||
|xterm-8bit| |v:termresponse| |'ttymouse'| |xterm-codes|
|
||||
|
||||
KEY CODES
|
||||
Note: Use the <> form if possible
|
||||
|
||||
option name meaning ~
|
||||
|
||||
t_ku <Up> arrow up *t_ku* *'t_ku'*
|
||||
t_kd <Down> arrow down *t_kd* *'t_kd'*
|
||||
t_kr <Right> arrow right *t_kr* *'t_kr'*
|
||||
t_kl <Left> arrow left *t_kl* *'t_kl'*
|
||||
<S-Up> shift arrow up
|
||||
<S-Down> shift arrow down
|
||||
t_%i <S-Right> shift arrow right *t_%i* *'t_%i'*
|
||||
t_#4 <S-Left> shift arrow left *t_#4* *'t_#4'*
|
||||
t_k1 <F1> function key 1 *t_k1* *'t_k1'*
|
||||
<xF1> alternate F1 *<xF1>*
|
||||
t_k2 <F2> function key 2 *<F2>* *t_k2* *'t_k2'*
|
||||
<xF2> alternate F2 *<xF2>*
|
||||
t_k3 <F3> function key 3 *<F3>* *t_k3* *'t_k3'*
|
||||
<xF3> alternate F3 *<xF3>*
|
||||
t_k4 <F4> function key 4 *<F4>* *t_k4* *'t_k4'*
|
||||
<xF4> alternate F4 *<xF4>*
|
||||
t_k5 <F5> function key 5 *<F5>* *t_k5* *'t_k5'*
|
||||
t_k6 <F6> function key 6 *<F6>* *t_k6* *'t_k6'*
|
||||
t_k7 <F7> function key 7 *<F7>* *t_k7* *'t_k7'*
|
||||
t_k8 <F8> function key 8 *<F8>* *t_k8* *'t_k8'*
|
||||
t_k9 <F9> function key 9 *<F9>* *t_k9* *'t_k9'*
|
||||
t_k; <F10> function key 10 *<F10>* *t_k;* *'t_k;'*
|
||||
t_F1 <F11> function key 11 *<F11>* *t_F1* *'t_F1'*
|
||||
t_F2 <F12> function key 12 *<F12>* *t_F2* *'t_F2'*
|
||||
t_F3 <F13> function key 13 *<F13>* *t_F3* *'t_F3'*
|
||||
t_F4 <F14> function key 14 *<F14>* *t_F4* *'t_F4'*
|
||||
t_F5 <F15> function key 15 *<F15>* *t_F5* *'t_F5'*
|
||||
t_F6 <F16> function key 16 *<F16>* *t_F6* *'t_F6'*
|
||||
t_F7 <F17> function key 17 *<F17>* *t_F7* *'t_F7'*
|
||||
t_F8 <F18> function key 18 *<F18>* *t_F8* *'t_F8'*
|
||||
t_F9 <F19> function key 19 *<F19>* *t_F9* *'t_F9'*
|
||||
<S-F1> shifted function key 1
|
||||
<S-xF1> alternate <S-F1> *<S-xF1>*
|
||||
<S-F2> shifted function key 2 *<S-F2>*
|
||||
<S-xF2> alternate <S-F2> *<S-xF2>*
|
||||
<S-F3> shifted function key 3 *<S-F3>*
|
||||
<S-xF3> alternate <S-F3> *<S-xF3>*
|
||||
<S-F4> shifted function key 4 *<S-F4>*
|
||||
<S-xF4> alternate <S-F4> *<S-xF4>*
|
||||
<S-F5> shifted function key 5 *<S-F5>*
|
||||
<S-F6> shifted function key 6 *<S-F6>*
|
||||
<S-F7> shifted function key 7 *<S-F7>*
|
||||
<S-F8> shifted function key 8 *<S-F8>*
|
||||
<S-F9> shifted function key 9 *<S-F9>*
|
||||
<S-F10> shifted function key 10 *<S-F10>*
|
||||
<S-F11> shifted function key 11 *<S-F11>*
|
||||
<S-F12> shifted function key 12 *<S-F12>*
|
||||
<S-Tab> shifted Tab key *<S-Tab>*
|
||||
t_%1 <Help> help key *t_%1* *'t_%1'*
|
||||
t_&8 <Undo> undo key *t_&8* *'t_&8'*
|
||||
t_kI <Insert> insert key *t_kI* *'t_kI'*
|
||||
t_kD <Del> delete key *t_kD* *'t_kD'*
|
||||
t_kb <BS> backspace key *t_kb* *'t_kb'*
|
||||
t_kB <S-Tab> back-tab (shift-tab) *t_kB* *'t_kB'*
|
||||
t_kh <Home> home key *t_kh* *'t_kh'*
|
||||
t_#2 <S-Home> shifted home key *<S-Home>* *t_#2* *'t_#2'*
|
||||
<xHome> alternate home key *<xHome>*
|
||||
t_@7 <End> end key *t_@7* *'t_@7'*
|
||||
t_*7 <S-End> shifted end key *<S-End>* *t_star7* *'t_star7'*
|
||||
<xEnd> alternate end key *<xEnd>*
|
||||
t_kP <PageUp> page-up key *t_kP* *'t_kP'*
|
||||
t_kN <PageDown> page-down key *t_kN* *'t_kN'*
|
||||
t_K1 <kHome> keypad home key *t_K1* *'t_K1'*
|
||||
t_K4 <kEnd> keypad end key *t_K4* *'t_K4'*
|
||||
t_K3 <kPageUp> keypad page-up key *t_K3* *'t_K3'*
|
||||
t_K5 <kPageDown> keypad page-down key *t_K5* *'t_K5'*
|
||||
t_K6 <kPlus> keypad plus key *<kPlus>* *t_K6* *'t_K6'*
|
||||
t_K7 <kMinus> keypad minus key *<kMinus>* *t_K7* *'t_K7'*
|
||||
t_K8 <kDivide> keypad divide *<kDivide>* *t_K8* *'t_K8'*
|
||||
t_K9 <kMultiply> keypad multiply *<kMultiply>* *t_K9* *'t_K9'*
|
||||
t_KA <kEnter> keypad enter key *<kEnter>* *t_KA* *'t_KA'*
|
||||
t_KB <kPoint> keypad decimal point *<kPoint>* *t_KB* *'t_KB'*
|
||||
t_KC <k0> keypad 0 *<k0>* *t_KC* *'t_KC'*
|
||||
t_KD <k1> keypad 1 *<k1>* *t_KD* *'t_KD'*
|
||||
t_KE <k2> keypad 2 *<k2>* *t_KE* *'t_KE'*
|
||||
t_KF <k3> keypad 3 *<k3>* *t_KF* *'t_KF'*
|
||||
t_KG <k4> keypad 4 *<k4>* *t_KG* *'t_KG'*
|
||||
t_KH <k5> keypad 5 *<k5>* *t_KH* *'t_KH'*
|
||||
t_KI <k6> keypad 6 *<k6>* *t_KI* *'t_KI'*
|
||||
t_KJ <k7> keypad 7 *<k7>* *t_KJ* *'t_KJ'*
|
||||
t_KK <k8> keypad 8 *<k8>* *t_KK* *'t_KK'*
|
||||
t_KL <k9> keypad 9 *<k9>* *t_KL* *'t_KL'*
|
||||
<Mouse> leader of mouse code *<Mouse>*
|
||||
|
||||
Note about t_so and t_mr: When the termcap entry "so" is not present the
|
||||
entry for "mr" is used. And vice versa. The same is done for "se" and "me".
|
||||
If your terminal supports both inversion and standout mode, you can see two
|
||||
different modes. If you terminal supports only one of the modes, both will
|
||||
look the same.
|
||||
|
||||
The keypad keys, when they are not mapped, behave like the equivalent normal
|
||||
key.
|
||||
*xterm-codes*
|
||||
There is a special trick to obtain the key codes which currently only works
|
||||
for xterm. When |t_RV| is defined and a response is received which indicates
|
||||
an xterm with patchlevel 141 or higher, Vim uses special escape sequences to
|
||||
request the key codes directly from the xterm. The responses are used to
|
||||
adjust the various t_ codes. This avoids the problem that the xterm can
|
||||
produce different codes, depending on the mode it is in (8-bit, VT102,
|
||||
VT220, etc.). The result is that codes like <xF1> are no longer needed.
|
||||
Note: This is only done on startup. If the xterm options are changed after
|
||||
Vim has started, the escape sequences may not be recognized any more.
|
||||
|
||||
*termcap-colors*
|
||||
Note about colors: The 't_Co' option tells Vim the number of colors available.
|
||||
When it is non-zero, the 't_AB' and 't_AF' options are used to set the color.
|
||||
If one of these is not available, 't_Sb' and 't_Sf' are used. 't_me' is used
|
||||
to reset to the default colors.
|
||||
|
||||
*termcap-title*
|
||||
The 't_ts' and 't_fs' options are used to set the window title if the terminal
|
||||
allows title setting via sending strings. They are sent before and after the
|
||||
title string, respectively. Similar 't_IS' and 't_IE' are used to set the
|
||||
icon text. These are Vim-internal extensions of the Unix termcap, so they
|
||||
cannot be obtained from an external termcap. However, the builtin termcap
|
||||
contains suitable entries for xterm and iris-ansi, so you don't need to set
|
||||
them here.
|
||||
*hpterm*
|
||||
If inversion or other highlighting does not work correctly, try setting the
|
||||
't_xs' option to a non-empty string. This makes the 't_ce' code be used to
|
||||
remove highlighting from a line. This is required for "hpterm". Setting the
|
||||
'weirdinvert' option has the same effect as making 't_xs' non-empty, and vice
|
||||
versa.
|
||||
|
||||
*scroll-region*
|
||||
Some termcaps do not include an entry for 'cs' (scroll region), although the
|
||||
terminal does support it. For example: xterm on a sun. You can use the
|
||||
builtin_xterm or define t_cs yourself. For example: >
|
||||
:set t_cs=^V^[[%i%d;%dr
|
||||
|
||||
The vertical scroll region t_CV is not a standard termcap code. Vim uses it
|
||||
internally in the GUI. But it can also be defined for a terminal, if you can
|
||||
find one that supports it. The two arguments are the left and right column of
|
||||
the region which to restrict the scrolling to. Just like t_cs defines the top
|
||||
and bottom lines. Defining t_CV will make scrolling in vertically split
|
||||
windows a lot faster. Don't set t_CV when t_da or t_db is set (text isn't
|
||||
cleared when scrolling).
|
||||
|
||||
Where ^V is CTRL-V and ^[ is <Esc>.
|
||||
|
||||
Unfortunately it is not possible to deduce from the termcap how cursor
|
||||
positioning should be done when using a scrolling region: Relative to the
|
||||
beginning of the screen or relative to the beginning of the scrolling region.
|
||||
Most terminals use the first method. A known exception is the MS-DOS console
|
||||
(pcterm). The 't_CS' option should be set to any string when cursor
|
||||
positioning is relative to the start of the scrolling region. It should be
|
||||
set to an empty string otherwise. It is default "yes" when 'term' is
|
||||
"pcterm".
|
||||
|
||||
Note for xterm users: The shifted cursor keys normally don't work. You can
|
||||
make them work with the xmodmap command and some mappings in Vim.
|
||||
|
||||
Give these commands in the xterm:
|
||||
xmodmap -e "keysym Up = Up F13"
|
||||
xmodmap -e "keysym Down = Down F16"
|
||||
xmodmap -e "keysym Left = Left F18"
|
||||
xmodmap -e "keysym Right = Right F19"
|
||||
|
||||
And use these mappings in Vim:
|
||||
:map <t_F3> <S-Up>
|
||||
:map! <t_F3> <S-Up>
|
||||
:map <t_F6> <S-Down>
|
||||
:map! <t_F6> <S-Down>
|
||||
:map <t_F8> <S-Left>
|
||||
:map! <t_F8> <S-Left>
|
||||
:map <t_F9> <S-Right>
|
||||
:map! <t_F9> <S-Right>
|
||||
|
||||
Instead of, say, <S-Up> you can use any other command that you want to use the
|
||||
shift-cursor-up key for. (Note: To help people that have a Sun keyboard with
|
||||
left side keys F14 is not used because it is confused with the undo key; F15
|
||||
is not used, because it does a window-to-front; F17 is not used, because it
|
||||
closes the window. On other systems you can probably use them)
|
||||
|
||||
==============================================================================
|
||||
3. Window size *window-size*
|
||||
|
||||
[This is about the size of the whole window Vim is using, not a window that is
|
||||
created with the :split command]
|
||||
|
||||
If you are running Vim on an Amiga and the terminal name is "amiga" or
|
||||
"builtin_amiga", the amiga-specific window resizing will be enabled. On Unix
|
||||
systems three methods are tried to get the window size:
|
||||
|
||||
- an ioctl call (TIOCGSIZE or TIOCGWINSZ, depends on your system)
|
||||
- the environment variables "LINES" and "COLUMNS"
|
||||
- from the termcap entries "li" and "co"
|
||||
|
||||
If everything fails a default size of 24 lines and 80 columns is assumed. If
|
||||
a window-resize signal is received the size will be set again. If the window
|
||||
size is wrong you can use the 'lines' and 'columns' options to set the
|
||||
correct values.
|
||||
|
||||
One command can be used to set the screen size:
|
||||
|
||||
*:mod* *:mode* *E359* *E362*
|
||||
:mod[e] [mode]
|
||||
|
||||
Without argument this only detects the screen size and redraws the screen.
|
||||
With MS-DOS it is possible to switch screen mode. [mode] can be one of these
|
||||
values:
|
||||
"bw40" 40 columns black&white
|
||||
"c40" 40 columns color
|
||||
"bw80" 80 columns black&white
|
||||
"c80" 80 columns color (most people use this)
|
||||
"mono" 80 columns monochrome
|
||||
"c4350" 43 or 50 lines EGA/VGA mode
|
||||
number mode number to use, depends on your video card
|
||||
|
||||
==============================================================================
|
||||
4. Slow and fast terminals *slow-fast-terminal*
|
||||
*slow-terminal*
|
||||
|
||||
If you have a fast terminal you may like to set the 'ruler' option. The
|
||||
cursor position is shown in the status line. If you are using horizontal
|
||||
scrolling ('wrap' option off) consider setting 'sidescroll' to a small
|
||||
number.
|
||||
|
||||
If you have a slow terminal you may want to reset the 'showcmd' option.
|
||||
The command characters will not be shown in the status line. If the terminal
|
||||
scrolls very slowly, set the 'scrolljump' to 5 or so. If the cursor is moved
|
||||
off the screen (e.g., with "j") Vim will scroll 5 lines at a time. Another
|
||||
possibility is to reduce the number of lines that Vim uses with the command
|
||||
"z{height}<CR>".
|
||||
|
||||
If the characters from the terminal are arriving with more than 1 second
|
||||
between them you might want to set the 'timeout' and/or 'ttimeout' option.
|
||||
See the "Options" chapter |options|.
|
||||
|
||||
If your terminal does not support a scrolling region, but it does support
|
||||
insert/delete line commands, scrolling with multiple windows may make the
|
||||
lines jump up and down. If you don't want this set the 'ttyfast' option.
|
||||
This will redraw the window instead of scroll it.
|
||||
|
||||
If your terminal scrolls very slowly, but redrawing is not slow, set the
|
||||
'ttyscroll' option to a small number, e.g., 3. This will make Vim redraw the
|
||||
screen instead of scrolling, when there are more than 3 lines to be scrolled.
|
||||
|
||||
If you are using a color terminal that is slow, use this command: >
|
||||
hi NonText cterm=NONE ctermfg=NONE
|
||||
This avoid spaces are sent when they have different attributes. On most
|
||||
terminals you can't see this anyway.
|
||||
|
||||
If you are using Vim over a slow serial line, you might want to try running
|
||||
Vim inside the "screen" program. Screen will optimize the terminal I/O quite
|
||||
a bit.
|
||||
|
||||
If you are testing termcap options, but you cannot see what is happening,
|
||||
you might want to set the 'writedelay' option. When non-zero, one character
|
||||
is sent to the terminal at a time (does not work for MS-DOS). This makes the
|
||||
screen updating a lot slower, making it possible to see what is happening.
|
||||
|
||||
==============================================================================
|
||||
5. Using the mouse *mouse-using*
|
||||
|
||||
This section is about using the mouse on a terminal or a terminal window. How
|
||||
to use the mouse in a GUI window is explained in |gui-mouse|. For scrolling
|
||||
with a mouse wheel see |scroll-mouse-wheel|.
|
||||
|
||||
Don't forget to enable the mouse with this commands: >
|
||||
:set mouse=a
|
||||
Otherwise Vim won't recognize the mouse in all modes (See 'mouse').
|
||||
|
||||
Currently the mouse is supported for Unix in an xterm window, in a Linux
|
||||
console (with GPM |gpm-mouse|), for MS-DOS and in a Windows console.
|
||||
Mouse clicks can be used to position the cursor, select an area and paste.
|
||||
|
||||
These characters in the 'mouse' option tell in which situations the mouse will
|
||||
be used by Vim:
|
||||
n Normal mode
|
||||
v Visual mode
|
||||
i Insert mode
|
||||
c Command-line mode
|
||||
h all previous modes when in a help file
|
||||
a all previous modes
|
||||
r for |hit-enter| prompt
|
||||
A auto-select in Visual mode
|
||||
|
||||
The default for 'mouse' is empty, the mouse is not used. Normally you would
|
||||
do: >
|
||||
:set mouse=a
|
||||
to start using the mouse (this is equivalent to setting 'mouse' to "nvich").
|
||||
If you only want to use the mouse in a few modes or also want to use it for
|
||||
the two questions you will have to concatenate the letters for those modes.
|
||||
For example: >
|
||||
:set mouse=nv
|
||||
Will make the mouse work in Normal mode and Visual mode. >
|
||||
:set mouse=h
|
||||
Will make the mouse work in help files only (so you can use "g<LeftMouse>" to
|
||||
jump to tags).
|
||||
|
||||
Whether the selection that is started with the mouse is in Visual mode or
|
||||
Select mode depends on whether "mouse" is included in the 'selectmode'
|
||||
option.
|
||||
|
||||
In an xterm, with the currently active mode included in the 'mouse' option,
|
||||
normal mouse clicks are used by Vim, mouse clicks with the shift or ctrl key
|
||||
pressed go to the xterm. With the currently active mode not included in
|
||||
'mouse' all mouse clicks go to the xterm.
|
||||
|
||||
*xterm-clipboard*
|
||||
In the Athena and Motif GUI versions, when running in a terminal and there is
|
||||
access to the X-server (DISPLAY is set), the copy and paste will behave like
|
||||
in the GUI. If not, the middle mouse button will insert the unnamed register.
|
||||
In that case, here is how you copy and paste a piece of text:
|
||||
|
||||
Copy/paste with the mouse and Visual mode ('mouse' option must be set, see
|
||||
above):
|
||||
1. Press left mouse button on first letter of text, move mouse pointer to last
|
||||
letter of the text and release the button. This will start Visual mode and
|
||||
highlight the selected area.
|
||||
2. Press "y" to yank the Visual text in the unnamed register.
|
||||
3. Click the left mouse button at the insert position.
|
||||
4. Click the middle mouse button.
|
||||
|
||||
Shortcut: If the insert position is on the screen at the same time as the
|
||||
Visual text, you can do 2, 3 and 4 all in one: Click the middle mouse button
|
||||
at the insert position.
|
||||
|
||||
Note: When the |-X| command line argument is used, Vim will not connect to the
|
||||
X server and copy/paste to the X clipboard (selection) will not work. Use the
|
||||
shift key with the mouse buttons to let the xterm do the selection.
|
||||
|
||||
*xterm-command-server*
|
||||
When the X-server clipboard is available, the command server described in
|
||||
|x11-clientserver| can be enabled with the --servername command line argument.
|
||||
|
||||
*xterm-copy-paste*
|
||||
NOTE: In some (older) xterms, it's not possible to move the cursor past column
|
||||
95. This is an xterm problem, not Vim's. Get a newer xterm |color-xterm|.
|
||||
|
||||
Copy/paste in xterm with (current mode NOT included in 'mouse'):
|
||||
1. Press left mouse button on first letter of text, move mouse pointer to last
|
||||
letter of the text and release the button.
|
||||
2. Use normal Vim commands to put the cursor at the insert position.
|
||||
3. Press "a" to start Insert mode.
|
||||
4. Click the middle mouse button.
|
||||
5. Press ESC to end Insert mode.
|
||||
(The same can be done with anything in 'mouse' if you keep the shift key
|
||||
pressed while using the mouse)
|
||||
|
||||
Note: if you lose the 8th bit when pasting (special characters are translated
|
||||
into other characters), you may have to do "stty cs8 -istrip -parenb" in your
|
||||
shell before starting Vim.
|
||||
|
||||
Thus in an xterm the shift and ctrl keys cannot be used with the mouse. To
|
||||
make it possible to do the mouse commands that require the ctrl modifier, the
|
||||
"g" key can be typed before using the mouse:
|
||||
"g<LeftMouse>" is "<C-LeftMouse> (jump to tag under mouse click)
|
||||
"g<RightMouse>" is "<C-RightMouse> ("CTRL-T")
|
||||
|
||||
*mouse-mode-table* *mouse-overview*
|
||||
A short overview of what the mouse buttons do, when 'mousemodel' is "extend":
|
||||
|
||||
Normal Mode:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<LeftMouse> yes end yes
|
||||
<C-LeftMouse> yes end yes "CTRL-]" (2)
|
||||
<S-LeftMouse> yes no change yes "*" (2) *<S-LeftMouse>*
|
||||
<LeftDrag> yes start or extend (1) no *<LeftDrag>*
|
||||
<LeftRelease> yes start or extend (1) no
|
||||
<MiddleMouse> yes if not active no put
|
||||
<MiddleMouse> yes if active no yank and put
|
||||
<RightMouse> yes start or extend yes
|
||||
<S-RightMouse> yes no change yes "#" (2) *<S-RightMouse>*
|
||||
<C-RightMouse> no no change no "CTRL-T"
|
||||
<RightDrag> yes extend no *<RightDrag>*
|
||||
<RightRelease> yes extend no *<RightRelease>*
|
||||
|
||||
Insert or Replace Mode:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<LeftMouse> yes (cannot be active) yes
|
||||
<C-LeftMouse> yes (cannot be active) yes "CTRL-O^]" (2)
|
||||
<S-LeftMouse> yes (cannot be active) yes "CTRL-O*" (2)
|
||||
<LeftDrag> yes start or extend (1) no like CTRL-O (1)
|
||||
<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
|
||||
<S-RightMouse> yes (cannot be active) yes "CTRL-O#" (2)
|
||||
<C-RightMouse> no (cannot be active) no "CTRL-O CTRL-T"
|
||||
|
||||
In a help window:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<2-LeftMouse> yes (cannot be active) no "^]" (jump to help tag)
|
||||
|
||||
When 'mousemodel' is "popup", these are different:
|
||||
|
||||
Normal Mode:
|
||||
event position selection change action ~
|
||||
cursor window ~
|
||||
<S-LeftMouse> yes start or extend (1) no
|
||||
<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)
|
||||
<RightMouse> no popup menu no
|
||||
|
||||
(1) only if mouse pointer moved since press
|
||||
(2) only if click is in same buffer
|
||||
|
||||
Clicking the left mouse button causes the cursor to be positioned. If the
|
||||
click is in another window that window is made the active window. When
|
||||
editing the command-line the cursor can only be positioned on the
|
||||
command-line. When in Insert mode Vim remains in Insert mode. If 'scrolloff'
|
||||
is set, and the cursor is positioned within 'scrolloff' lines from the window
|
||||
border, the text is scrolled.
|
||||
|
||||
A selection can be started by pressing the left mouse button on the first
|
||||
character, moving the mouse to the last character, then releasing the mouse
|
||||
button. You will not always see the selection until you release the button,
|
||||
only in some versions (GUI, MS-DOS, WIN32) will the dragging be shown
|
||||
immediately. Note that you can make the text scroll by moving the mouse at
|
||||
least one character in the first/last line in the window when 'scrolloff' is
|
||||
non-zero.
|
||||
|
||||
In Normal, Visual and Select mode clicking the right mouse button causes the
|
||||
Visual area to be extended. When 'mousemodel' is "popup", the left button has
|
||||
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.
|
||||
|
||||
*double-click*
|
||||
Double, triple and quadruple clicks are supported when the GUI is active,
|
||||
for MS-DOS and Win32, and for an xterm (if the gettimeofday() function is
|
||||
available). For selecting text, extra clicks extend the selection:
|
||||
click select ~
|
||||
double word or % match *<2-LeftMouse>*
|
||||
triple line *<3-LeftMouse>*
|
||||
quadruple rectangular block *<4-LeftMouse>*
|
||||
Exception: In a Help window a double click jumps to help for the word that is
|
||||
clicked on.
|
||||
A double click on a word selects that word. 'iskeyword' is used to specify
|
||||
which characters are included in a word. A double click on a character
|
||||
that has a match selects until that match (like using "v%"). If the match is
|
||||
a #if/#else/#endif block, the selection becomes linewise.
|
||||
For MS-DOS and xterm the time for double clicking can be set with the
|
||||
'mousetime' option. For the other systems this time is defined outside of
|
||||
Vim.
|
||||
An example, for using a double click to jump to the tag under the cursor: >
|
||||
:map <2-LeftMouse> :exe "tag ". expand("<cword>")<CR>
|
||||
|
||||
Dragging the mouse with a double click (button-down, button-up, button-down
|
||||
and then drag) will result in whole words to be selected. This continues
|
||||
until the button is released, the selection is per character again.
|
||||
|
||||
*gpm-mouse*
|
||||
The GPM mouse is only supported when the |+mouse_gpm| feature was enabled at
|
||||
compile time. The GPM mouse driver (Linux console) does not support quadruple
|
||||
clicks.
|
||||
|
||||
In Insert mode, when a selection is started, Vim goes into Normal mode
|
||||
temporarily. When Visual or Select mode ends, it returns to Insert mode.
|
||||
This is like using CTRL-O in Insert mode. Select mode is used when the
|
||||
'selectmode' option contains "mouse".
|
||||
|
||||
*drag-status-line*
|
||||
When working with several windows, the size of the windows can be changed by
|
||||
dragging the status line with the mouse. Point the mouse at a status line,
|
||||
press the left button, move the mouse to the new position of the status line,
|
||||
release the button. Just clicking the mouse in a status line makes that window
|
||||
the current window, without moving the cursor. If by selecting a window it
|
||||
will change position or size, the dragging of the status line will look
|
||||
confusing, but it will work (just try it).
|
||||
|
||||
*<MiddleRelease>* *<MiddleDrag>*
|
||||
Mouse clicks can be mapped. The codes for mouse clicks are:
|
||||
code mouse button normal action ~
|
||||
<LeftMouse> left pressed set cursor position
|
||||
<LeftDrag> left moved while pressed extend selection
|
||||
<LeftRelease> left released set selection end
|
||||
<MiddleMouse> middle pressed paste text at cursor position
|
||||
<MiddleDrag> middle moved while pressed -
|
||||
<MiddleRelease> middle released -
|
||||
<RightMouse> right pressed extend selection
|
||||
<RightDrag> right moved while pressed extend selection
|
||||
<RightRelease> right released set selection end
|
||||
<X1Mouse> X1 button pressed - *X1Mouse*
|
||||
<X1Drag> X1 moved while pressed - *X1Drag*
|
||||
<X1Release> X1 button release - *X1Release*
|
||||
<X2Mouse> X2 button pressed - *X2Mouse*
|
||||
<X2Drag> X2 moved while pressed - *X2Drag*
|
||||
<X2Release> X2 button release - *X2Release*
|
||||
|
||||
The X1 and X2 buttons refer to the extra buttons found on some mice. The
|
||||
'Microsoft Explorer' mouse has these buttons available to the right thumb.
|
||||
Currently X1 and X2 only work on Win32 environments.
|
||||
|
||||
Examples: >
|
||||
:noremap <MiddleMouse> <LeftMouse><MiddleMouse>
|
||||
Paste at the position of the middle mouse button click (otherwise the paste
|
||||
would be done at the cursor position). >
|
||||
|
||||
:noremap <LeftRelease> <LeftRelease>y
|
||||
Immediately yank the selection, when using Visual mode.
|
||||
|
||||
Note the use of ":noremap" instead of "map" to avoid a recursive mapping.
|
||||
>
|
||||
:map <X1Mouse> <C-O>
|
||||
:map <X2Mouse> <C-I>
|
||||
Map the X1 and X2 buttons to go forward and backwards in the jump list, see
|
||||
|CTRL-O| and |CTRL-I|.
|
||||
|
||||
*mouse-swap-buttons*
|
||||
To swap the meaning of the left and right mouse buttons: >
|
||||
:noremap <LeftMouse> <RightMouse>
|
||||
:noremap <LeftDrag> <RightDrag>
|
||||
:noremap <LeftRelease> <RightRelease>
|
||||
:noremap <RightMouse> <LeftMouse>
|
||||
:noremap <RightDrag> <LeftDrag>
|
||||
:noremap <RightRelease> <LeftRelease>
|
||||
:noremap g<LeftMouse> <C-RightMouse>
|
||||
:noremap g<RightMouse> <C-LeftMouse>
|
||||
:noremap! <LeftMouse> <RightMouse>
|
||||
:noremap! <LeftDrag> <RightDrag>
|
||||
:noremap! <LeftRelease> <RightRelease>
|
||||
:noremap! <RightMouse> <LeftMouse>
|
||||
:noremap! <RightDrag> <LeftDrag>
|
||||
:noremap! <RightRelease> <LeftRelease>
|
||||
<
|
||||
-->
|
||||
|
||||
@@ -1,453 +0,0 @@
|
||||
*tips.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Tips and ideas for using Vim *tips*
|
||||
|
||||
Don't forget to browse the user manual, it also contains lots of useful tips
|
||||
|usr_toc.txt|.
|
||||
|
||||
Editing Java programs |Java-editing|
|
||||
<!--
|
||||
Finding where identifiers are used |ident-search|
|
||||
Switching screens in an xterm |xterm-screens|
|
||||
Scrolling in Insert mode |scroll-insert|
|
||||
Smooth scrolling |scroll-smooth|
|
||||
Correcting common typing mistakes |type-mistakes|
|
||||
Counting words, lines, etc. |count-items|
|
||||
Restoring the cursor position |restore-position|
|
||||
Renaming files |rename-files|
|
||||
Speeding up external commands |speed-up|
|
||||
Useful mappings |useful-mappings|
|
||||
Compressing the help files |gzip-helpfile|
|
||||
Hex editing |hex-editing|
|
||||
Executing shell commands in a window |shell-window|
|
||||
Using <> notation in autocommands |autocmd-<>|
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
Editing Java programs *Java-editing*
|
||||
|
||||
There are quite a few features in Vim to help you edit Java program files. Here
|
||||
is an overview with tags to jump to:
|
||||
|
||||
|usr_29.txt| Moving through programs chapter in the user manual.
|
||||
|usr_30.txt| Editing programs chapter in the user manual.
|
||||
<!--
|
||||
|C-indenting| Automatically set the indent of a line while typing
|
||||
text.
|
||||
-->
|
||||
|==| Re-indent a few lines.
|
||||
<!--
|
||||
|format-comments| Format comments.
|
||||
|
||||
|:checkpath| Show all recursively included files.
|
||||
-->
|
||||
<!--
|
||||
|[i| Search for identifier under cursor in current and
|
||||
included files.
|
||||
|[_CTRL-I| Jump to match for "[i"
|
||||
|[I| List all lines in current and included files where
|
||||
identifier under the cursor matches.
|
||||
|[d| Search for define under cursor in current and included
|
||||
files.
|
||||
|
||||
|CTRL-]| Jump to tag under cursor (e.g., definition of a
|
||||
function).
|
||||
|CTRL-T| Jump back to before a CTRL-] command.
|
||||
|:tselect| Select one tag out of a list of matching tags.
|
||||
-->
|
||||
|
||||
|gd| Go to Declaration of variable under cursor.
|
||||
<!--
|
||||
|gD| Go to Declaration of global variable under cursor.
|
||||
|
||||
|gf| Go to file name under the cursor.
|
||||
-->
|
||||
|
||||
|%| Go to matching (), {}, [], /* */, #if, #else, #endif.
|
||||
<!--
|
||||
|[/| Go to previous start of comment.
|
||||
|]/| Go to next end of comment.
|
||||
|[#| Go back to unclosed #if, #ifdef, or #else.
|
||||
|]#| Go forward to unclosed #else or #endif.
|
||||
-->
|
||||
|[(| Go back to unclosed '('
|
||||
|])| Go forward to unclosed ')'
|
||||
|[{| Go back to unclosed '{'
|
||||
|]}| Go forward to unclosed '}'
|
||||
<!--
|
||||
|
||||
|v_ab| Select "a block" from "[(" to "])", including braces
|
||||
|v_ib| Select "inner block" from "[(" to "])"
|
||||
|v_aB| Select "a block" from "[{" to "]}", including brackets
|
||||
|v_iB| Select "inner block" from "[{" to "]}"
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
<!--
|
||||
Finding where identifiers are used *ident-search*
|
||||
|
||||
You probably already know that |tags| can be used to jump to the place where a
|
||||
function or variable is defined. But sometimes you wish you could jump to all
|
||||
the places where a function or variable is being used. This is possible in
|
||||
two ways:
|
||||
1. Using the |:grep| command. This should work on most Unix systems,
|
||||
but can be slow (it reads all files) and only searches in one directory.
|
||||
2. Using ID utils. This is fast and works in multiple directories. It uses a
|
||||
database to store locations. You will need some additional programs for
|
||||
this to work. And you need to keep the database up to date.
|
||||
|
||||
Using the GNU id-tools:
|
||||
|
||||
What you need:
|
||||
- The GNU id-tools installed (mkid is needed to create ID and lid is needed to
|
||||
use the macros).
|
||||
- An identifier database file called "ID" in the current directory. You can
|
||||
create it with the shell command "mkid file1 file2 ..".
|
||||
|
||||
Put this in your .vimrc: >
|
||||
map _u :call ID_search()<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
map _n :n<Bar>execute "/\\<" . g:word . "\\>"<CR>
|
||||
|
||||
function ID_search()
|
||||
let g:word = expand("<cword>")
|
||||
let x = system("lid --key=none ". g:word)
|
||||
let x = substitute(x, "\n", " ", "g")
|
||||
execute "next " . x
|
||||
endfun
|
||||
|
||||
To use it, place the cursor on a word, type "_u" and vim will load the file
|
||||
that contains the word. Search for the next occurrence of the word in the
|
||||
same file with "n". Go to the next file with "_n".
|
||||
|
||||
This has been tested with id-utils-3.2 (which is the name of the id-tools
|
||||
archive file on your closest gnu-ftp-mirror).
|
||||
|
||||
[the idea for this comes from Andreas Kutschera]
|
||||
|
||||
==============================================================================
|
||||
Switching screens in an xterm *xterm-screens* *xterm-save-screen*
|
||||
|
||||
(From comp.editors, by Juergen Weigert, in reply to a question)
|
||||
|
||||
:> Another question is that after exiting vim, the screen is left as it
|
||||
:> was, i.e. the contents of the file I was viewing (editing) was left on
|
||||
:> the screen. The output from my previous like "ls" were lost,
|
||||
:> ie. no longer in the scrolling buffer. I know that there is a way to
|
||||
:> restore the screen after exiting vim or other vi like editors,
|
||||
:> I just don't know how. Helps are appreciated. Thanks.
|
||||
:
|
||||
:I imagine someone else can answer this. I assume though that vim and vi do
|
||||
:the same thing as each other for a given xterm setup.
|
||||
|
||||
They not necessarily do the same thing, as this may be a termcap vs.
|
||||
terminfo problem. You should be aware that there are two databases for
|
||||
describing attributes of a particular type of terminal: termcap and
|
||||
terminfo. This can cause differences when the entries differ AND when of
|
||||
the programs in question one uses terminfo and the other uses termcap
|
||||
(also see |+terminfo|).
|
||||
|
||||
In your particular problem, you are looking for the control sequences
|
||||
^[[?47h and ^[[?47l. These switch between xterms alternate and main screen
|
||||
buffer. As a quick workaround a command sequence like >
|
||||
echo -n "^[[?47h"; vim ... ; echo -n "^[[?47l"
|
||||
may do what you want. (My notation ^[ means the ESC character, further down
|
||||
you'll see that the databases use \E instead).
|
||||
|
||||
On startup, vim echoes the value of the termcap variable ti (terminfo:
|
||||
smcup) to the terminal. When exiting, it echoes te (terminfo: rmcup). Thus
|
||||
these two variables are the correct place where the above mentioned control
|
||||
sequences should go.
|
||||
|
||||
Compare your xterm termcap entry (found in /etc/termcap) with your xterm
|
||||
terminfo entry (retrieved with /usr/5bin/infocmp -C xterm). Both should
|
||||
contain entries similar to: >
|
||||
:te=\E[2J\E[?47l\E8:ti=\E7\E[?47h:
|
||||
|
||||
PS: If you find any difference, someone (your sysadmin?) should better check
|
||||
the complete termcap and terminfo database for consistency.
|
||||
|
||||
NOTE 1: If you recompile Vim with FEAT_XTERM_SAVE defined in feature.h, the
|
||||
builtin xterm will include the mentioned "te" and "ti" entries.
|
||||
|
||||
NOTE 2: If you want to disable the screen switching, and you don't want to
|
||||
change your termcap, you can add these lines to your .vimrc: >
|
||||
:set t_ti= t_te=
|
||||
|
||||
==============================================================================
|
||||
Scrolling in Insert mode *scroll-insert*
|
||||
|
||||
If you are in insert mode and you want to see something that is just off the
|
||||
screen, you can use CTRL-X CTRL-E and CTRL-X CTRL-Y to scroll the screen.
|
||||
|i_CTRL-X_CTRL-E|
|
||||
|
||||
To make this easier, you could use these mappings: >
|
||||
:inoremap <C-E> <C-X><C-E>
|
||||
:inoremap <C-Y> <C-X><C-Y>
|
||||
(Type this literally, make sure the '<' flag is not in 'cpoptions').
|
||||
You then lose the ability to copy text from the line above/below the cursor
|
||||
|i_CTRL-E|.
|
||||
|
||||
Also consider setting 'scrolloff' to a larger value, so that you can always see
|
||||
some context around the cursor. If 'scrolloff' is bigger than half the window
|
||||
height, the cursor will always be in the middle and the text is scrolled when
|
||||
the cursor is moved up/down.
|
||||
|
||||
==============================================================================
|
||||
Smooth scrolling *scroll-smooth*
|
||||
|
||||
If you like the scrolling to go a bit smoother, you can use these mappings: >
|
||||
:map <C-U> <C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y><C-Y>
|
||||
:map <C-D> <C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E><C-E>
|
||||
|
||||
(Type this literally, make sure the '<' flag is not in 'cpoptions').
|
||||
|
||||
==============================================================================
|
||||
Correcting common typing mistakes *type-mistakes*
|
||||
|
||||
When there are a few words that you keep on typing in the wrong way, make
|
||||
abbreviations that correct them. For example: >
|
||||
:ab teh the
|
||||
:ab fro for
|
||||
|
||||
==============================================================================
|
||||
Counting words, lines, etc. *count-items*
|
||||
|
||||
To count how often any pattern occurs in a buffer, set 'report' to 0, and use
|
||||
the substitute command to replace the pattern with itself. The reported
|
||||
number of substitutions is the number of items. Examples: >
|
||||
|
||||
:set report=0
|
||||
:%s/./&/g characters
|
||||
:%s/\i\+/&/g words
|
||||
:%s/^ lines
|
||||
:%s/the/&/g "the" anywhere
|
||||
:%s/\<the\>/&/g "the" as a word
|
||||
|
||||
You might want to reset 'hlsearch' or do ":nohlsearch".
|
||||
|
||||
This does not work if the 'modifiable' option is off. An alternative is using
|
||||
|v_g_CTRL-G| in Visual mode.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
Restoring the cursor position *restore-position*
|
||||
|
||||
Sometimes you want to write a mapping that makes a change somewhere in the
|
||||
file and restores the cursor position, without scrolling the text. For
|
||||
example, to change the date mark in a file: >
|
||||
:map <F2> msHmtgg/Last [cC]hange:\s*/e+1<CR>"_D"=strftime("%Y %b %d")<CR>p'tzt`s
|
||||
|
||||
Breaking up saving the position:
|
||||
ms store cursor position in the 's' mark
|
||||
H go to the first line in the window
|
||||
mt store this position in the 't' mark
|
||||
|
||||
Breaking up restoring the position:
|
||||
't go to the line previously at the top of the window
|
||||
zt scroll to move this line to the top of the window
|
||||
`s jump to the original position of the cursor
|
||||
|
||||
==============================================================================
|
||||
<!--
|
||||
Renaming files *rename-files*
|
||||
|
||||
Say I have a directory with the following files in them (directory picked at
|
||||
random :-):
|
||||
|
||||
buffer.c
|
||||
charset.c
|
||||
digraph.c
|
||||
...
|
||||
|
||||
and I want to rename *.c *.bla. I'd do it like this: >
|
||||
|
||||
$ vim
|
||||
:r! ls *.c
|
||||
:%s/\(.*\).c/mv & \1.bla
|
||||
:w !sh
|
||||
:q!
|
||||
|
||||
==============================================================================
|
||||
Speeding up external commands *speed-up*
|
||||
|
||||
In some situations, execution of an external command can be very slow. This
|
||||
can also slow down wildcard expansion on Unix. Here are a few suggestions to
|
||||
increase the speed.
|
||||
|
||||
If your .cshrc (or other file, depending on the shell used) is very long, you
|
||||
should separate it into a section for interactive use and a section for
|
||||
non-interactive use (often called secondary shells). When you execute a
|
||||
command from Vim like ":!ls", you do not need the interactive things (for
|
||||
example, setting the prompt). Put the stuff that is not needed after these
|
||||
lines: >
|
||||
|
||||
if ($?prompt == 0) then
|
||||
exit 0
|
||||
endif
|
||||
|
||||
Another way is to include the "-f" flag in the 'shell' option, e.g.: >
|
||||
|
||||
:set shell=csh\ -f
|
||||
|
||||
(the backslash is needed to include the space in the option).
|
||||
This will make csh completely skip the use of the .cshrc file. This may cause
|
||||
some things to stop working though.
|
||||
|
||||
==============================================================================
|
||||
Useful mappings *useful-mappings*
|
||||
|
||||
Here are a few mappings that some people like to use.
|
||||
|
||||
*map-backtick* >
|
||||
:map ' `
|
||||
Make the single quote work like a backtick. Puts the cursor on the column of
|
||||
a mark, instead of going to the first non-blank character in the line.
|
||||
|
||||
*emacs-keys*
|
||||
For Emacs-style editing on the command-line: >
|
||||
" start of line
|
||||
:cnoremap <C-A> <Home>
|
||||
" back one character
|
||||
:cnoremap <C-B> <Left>
|
||||
" delete character under cursor
|
||||
:cnoremap <C-D> <Del>
|
||||
" end of line
|
||||
:cnoremap <C-E> <End>
|
||||
" forward one character
|
||||
:cnoremap <C-F> <Right>
|
||||
" recall newer command-line
|
||||
:cnoremap <C-N> <Down>
|
||||
" recall previous (older) command-line
|
||||
:cnoremap <C-P> <Up>
|
||||
" back one word
|
||||
:cnoremap <Esc><C-B> <S-Left>
|
||||
" forward one word
|
||||
:cnoremap <Esc><C-F> <S-Right>
|
||||
|
||||
NOTE: This requires that the '<' flag is excluded from 'cpoptions'. |<>|
|
||||
|
||||
*format-bullet-list*
|
||||
This mapping will format any bullet list. It requires that there is an empty
|
||||
line above and below each list entry. The expression commands are used to
|
||||
be able to give comments to the parts of the mapping. >
|
||||
|
||||
:let m = ":map _f :set ai<CR>" " need 'autoindent' set
|
||||
:let m = m . "{O<Esc>" " add empty line above item
|
||||
:let m = m . "}{)^W" " move to text after bullet
|
||||
:let m = m . "i <CR> <Esc>" " add space for indent
|
||||
:let m = m . "gq}" " format text after the bullet
|
||||
:let m = m . "{dd" " remove the empty line
|
||||
:let m = m . "5lDJ" " put text after bullet
|
||||
:execute m |" define the mapping
|
||||
|
||||
(<> notation |<>|. Note that this is all typed literally. ^W is "^" "W", not
|
||||
CTRL-W. You can copy/paste this into Vim if '<' is not included in
|
||||
'cpoptions')
|
||||
|
||||
Note that the last comment starts with |", because the ":execute" command
|
||||
doesn't accept a comment directly.
|
||||
|
||||
You also need to set 'textwidth' to a non-zero value, e.g., >
|
||||
:set tw=70
|
||||
|
||||
A mapping that does about the same, but takes the indent for the list from the
|
||||
first line (Note: this mapping is a single long line with a lot of spaces): >
|
||||
:map _f :set ai<CR>}{a <Esc>WWmmkD`mi<CR><Esc>kkddpJgq}'mJO<Esc>j
|
||||
<
|
||||
*collapse*
|
||||
These two mappings reduce a sequence of empty (;b) or blank (;n) lines into a
|
||||
single line >
|
||||
:map ;b GoZ<Esc>:g/^$/.,/./-j<CR>Gdd
|
||||
:map ;n GoZ<Esc>:g/^[ <Tab>]*$/.,/[^ <Tab>]/-j<CR>Gdd
|
||||
|
||||
==============================================================================
|
||||
Compressing the help files *gzip-helpfile*
|
||||
|
||||
For those of you who are really short on disk space, you can compress the help
|
||||
files and still be able to view them with Vim. This makes accessing the help
|
||||
files a bit slower and requires the "gzip" program.
|
||||
|
||||
(1) Compress all the help files: "gzip doc/*.txt".
|
||||
|
||||
(2) Edit "doc/tags" and change the ".txt" to ".txt.gz": >
|
||||
:%s=\(\t.*\.txt\)\t=\1.gz\t=
|
||||
|
||||
(3) Add this line to your vimrc: >
|
||||
set helpfile={dirname}/help.txt.gz
|
||||
|
||||
Where {dirname} is the directory where the help files are. The |gzip| plugin
|
||||
will take care of decompressing the files.
|
||||
You must make sure that $VIMRUNTIME is set to where the other Vim files are,
|
||||
when they are not in the same location as the compressed "doc" directory. See
|
||||
|$VIMRUNTIME|.
|
||||
|
||||
==============================================================================
|
||||
Executing shell commands in a window *shell-window*
|
||||
|
||||
There have been questions for the possibility to execute a shell in a window
|
||||
inside Vim. The answer: you can't! Including this would add a lot of code to
|
||||
Vim, which is a good reason not to do this. After all, Vim is an editor, it
|
||||
is not supposed to do non-editing tasks. However, to get something like this,
|
||||
you might try splitting your terminal screen or display window with the
|
||||
"splitvt" program. You can probably find it on some ftp server. The person
|
||||
that knows more about this is Sam Lantinga <slouken@cs.ucdavis.edu>.
|
||||
An alternative is the "window" command, found on BSD Unix systems, which
|
||||
supports multiple overlapped windows. Or the "screen" program, found at
|
||||
www.uni-erlangen.de, which supports a stack of windows.
|
||||
|
||||
==============================================================================
|
||||
Hex editing *hex-editing* *using-xxd*
|
||||
|
||||
See section |23.4| of the user manual.
|
||||
|
||||
If one has a particular extension that one uses for binary files (such as exe,
|
||||
bin, etc), you may find it helpful to automate the process with the following
|
||||
bit of autocmds for your <.vimrc>. Change that "*.bin" to whatever
|
||||
comma-separated list of extension(s) you find yourself wanting to edit: >
|
||||
|
||||
" vim -b : edit binary using xxd-format!
|
||||
augroup Binary
|
||||
au!
|
||||
au BufReadPre *.bin let &bin=1
|
||||
au BufReadPost *.bin if &bin | %!xxd
|
||||
au BufReadPost *.bin set ft=xxd | endif
|
||||
au BufWritePre *.bin if &bin | %!xxd -r
|
||||
au BufWritePre *.bin endif
|
||||
au BufWritePost *.bin if &bin | %!xxd
|
||||
au BufWritePost *.bin set nomod | endif
|
||||
augroup END
|
||||
|
||||
==============================================================================
|
||||
Using <> notation in autocommands *autocmd-<>*
|
||||
|
||||
The <> notation is not recognized in the argument of an :autocmd. To avoid
|
||||
having to use special characters, you could use a self-destroying mapping to
|
||||
get the <> notation and then call the mapping from the autocmd. Example:
|
||||
|
||||
*map-self-destroy* >
|
||||
" This is for automatically adding the name of the file to the menu list.
|
||||
" It uses a self-destroying mapping!
|
||||
" 1. use a line in the buffer to convert the 'dots' in the file name to \.
|
||||
" 2. store that in register '"'
|
||||
" 3. add that name to the Buffers menu list
|
||||
" WARNING: this does have some side effects, like overwriting the
|
||||
" current register contents and removing any mapping for the "i" command.
|
||||
"
|
||||
autocmd BufNewFile,BufReadPre * nmap i :nunmap i<CR>O<C-R>%<Esc>:.g/\./s/\./\\./g<CR>0"9y$u:menu Buffers.<C-R>9 :buffer <C-R>%<C-V><CR><CR>
|
||||
autocmd BufNewFile,BufReadPre * normal i
|
||||
|
||||
Another method, perhaps better, is to use the ":execute" command. In the
|
||||
string you can use the <> notation by preceding it with a backslash. Don't
|
||||
forget to double the number of existing backslashes and put a backslash before
|
||||
'"'.
|
||||
>
|
||||
autocmd BufNewFile,BufReadPre * exe "normal O\<C-R>%\<Esc>:.g/\\./s/\\./\\\\./g\<CR>0\"9y$u:menu Buffers.\<C-R>9 :buffer \<C-R>%\<C-V>\<CR>\<CR>"
|
||||
|
||||
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.
|
||||
-->
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
*todo.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 29
|
||||
|
||||
|
||||
VIM REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
TODO list for IdeaVim *todo*
|
||||
|
||||
|
||||
*known-bugs*
|
||||
-------------------- Known bugs and current work -----------------------
|
||||
|
||||
- :dig doesn't bring up the window (it flashes a split second).
|
||||
- Split text when typing fast after o command.
|
||||
- Replace mode - fix caret. Can't figure out how to keep block caret.
|
||||
- Repeating a last change doesn't include text inserted by the IDE using code
|
||||
completion.
|
||||
|
||||
--------------------- extensions and improvements ----------------------
|
||||
*extensions-improvements*
|
||||
|
||||
- Support Select mode
|
||||
- Show message after shifting lines with :< or :>
|
||||
- Backspace in Replace mode deletes instead of restoring
|
||||
- Support incsearch option
|
||||
- Support U (line undo)
|
||||
- Modify FileGroup.openFile to support ~ in filename, and files outside roots
|
||||
- :write doesn't support a range or arguments
|
||||
- Support :global
|
||||
- Support gf
|
||||
- Ctrl-w and Ctrl-u in insert mode flaky near end of line or end of file
|
||||
- Support all the other Vim commands that make sense under the IDE.
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
*undo.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
|
||||
IdeaVim REFERENCE MANUAL by Rick Maddy
|
||||
|
||||
|
||||
Undo and redo *undo-redo*
|
||||
|
||||
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|
|
||||
|
||||
==============================================================================
|
||||
1. Undo and redo commands *undo-commands*
|
||||
|
||||
<Undo> or *undo* *<Undo>* *u*
|
||||
u Undo [count] changes.
|
||||
|
||||
*:u* *:un* *:undo*
|
||||
:u[ndo] Undo one change.
|
||||
|
||||
*CTRL-R*
|
||||
CTRL-R Redo [count] changes which were undone.
|
||||
screen}
|
||||
|
||||
*:red* *:redo* *redo*
|
||||
:red[o] Redo one change which was undone.
|
||||
|
||||
<!--
|
||||
*U*
|
||||
U Undo all latest changes on one line. {Vi: while not
|
||||
moved off of it}
|
||||
|
||||
-->
|
||||
The last changes are remembered. You can use the undo and redo commands above
|
||||
to revert the text to how it was before each change. You can also apply the
|
||||
changes again, getting back the text before the undo.
|
||||
|
||||
<!--
|
||||
The "U" command is treated by undo/redo just like any other command. Thus a
|
||||
"u" command undos a "U" command and a 'CTRL-R' command redoes it again. When
|
||||
mixing "U", "u" and 'CTRL-R' you will notice that the "U" command will
|
||||
restore the situation of a line to before the previous "U" command. This may
|
||||
be confusing. Try it out to get used to it.
|
||||
The "U" command will always mark the buffer as changed. When "U" changes the
|
||||
buffer back to how it was without changes, it is still considered changed.
|
||||
Use "u" to undo changes until the buffer becomes unchanged.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
2. Two ways of undo *undo-two-ways*
|
||||
|
||||
<!--
|
||||
How undo and redo commands work depends on the 'u' flag in 'cpoptions'.
|
||||
There is the Vim way ('u' excluded) and the vi-compatible way ('u' included).
|
||||
In the Vim way, "uu" undoes two changes. In the Vi-compatible way, "uu" does
|
||||
nothing (undoes an undo).
|
||||
|
||||
'u' excluded, the Vim way:
|
||||
-->
|
||||
You can go back in time with the undo command. You can then go forward again
|
||||
with the redo command. If you make a new change after the undo command,
|
||||
the redo will not be possible anymore.
|
||||
<!--
|
||||
|
||||
'u' included, the Vi-compatible way:
|
||||
The undo command undoes the previous change, and also the previous undo command.
|
||||
The redo command repeats the previous undo command. It does NOT repeat a
|
||||
change command, use "." for that.
|
||||
|
||||
Examples Vim way Vi-compatible way ~
|
||||
"uu" two times undo no-op
|
||||
"u CTRL-R" no-op two times undo
|
||||
|
||||
Rationale: Nvi uses the "." command instead of CTRL-R. Unfortunately, this
|
||||
is not Vi compatible. For example "dwdwu." in Vi deletes two
|
||||
words, in Nvi it does nothing.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
3. 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
|
||||
undo is possible. Use this if you are running out of memory.
|
||||
|
||||
Marks for the buffer ('a to 'z) are also saved and restored, together with the
|
||||
text.
|
||||
|
||||
When all changes have been undone, the buffer is not considered to be changed.
|
||||
Note that this is relative to the last write of the file. Typing "u"
|
||||
after ":w" actually changes the buffer, compared to what was written, so the
|
||||
buffer is considered changed then.
|
||||
|
||||
<!--
|
||||
When manual |folding| is being used, the folds are not saved and restored.
|
||||
Only changes completely within a fold will keep the fold as it was, because
|
||||
the first and last line of the fold don't change.
|
||||
|
||||
-->
|
||||
The numbered registers can also be used for undoing deletes. Each time you
|
||||
delete text, it is put into register "1. The contents of register "1 are
|
||||
shifted to "2, etc. The contents of register "9 are lost. You can now get
|
||||
back the most recent deleted text with the put command: '"1P'. (also, if the
|
||||
deleted text was the result of the last delete or copy operation, 'P' or 'p'
|
||||
also works as this puts the contents of the unnamed register). You can get
|
||||
back the text of three deletes ago with '"3P'.
|
||||
|
||||
*redo-register*
|
||||
If you want to get back more than one part of deleted text, you can use a
|
||||
special feature of the repeat command ".". It will increase the number of the
|
||||
register used. So if you first do ""1P", the following "." will result in a
|
||||
'"2P'. Repeating this will result in all numbered registers being inserted.
|
||||
|
||||
Example: If you deleted text with 'dd....' it can be restored with
|
||||
'"1P....'.
|
||||
|
||||
If you don't know in which register the deleted text is, you can use the
|
||||
:display command. An alternative is to try the first register with '"1P', and
|
||||
if it is not what you want do 'u.'. This will remove the contents of the
|
||||
first put, and repeat the put command for the second register. Repeat the
|
||||
'u.' until you got what you want.
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
*usr_01.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
About the manuals
|
||||
|
||||
|
||||
This chapter introduces the manuals available with IdeaVim. Read this to know the
|
||||
conditions under which the commands are explained.
|
||||
|
||||
|01.1| Two manuals
|
||||
|01.2| IdeaVim installed
|
||||
|01.3| Using the IdeaVim tutor
|
||||
|01.4| Copyright
|
||||
|
||||
Next chapter: |usr_02.txt| The first steps in IdeaVim
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*01.1* Two manuals
|
||||
|
||||
The IdeaVim documentation consists of two parts:
|
||||
|
||||
1. The User manual
|
||||
Task oriented explanations, from simple to complex. Reads from start to
|
||||
end like a book.
|
||||
|
||||
2. The Reference manual
|
||||
Precise description of how everything in IdeaVim works.
|
||||
|
||||
The notation used in these manuals is explained here: |notation|
|
||||
|
||||
|
||||
JUMPING AROUND
|
||||
|
||||
The text contains hyperlinks between the two parts, allowing you to quickly
|
||||
jump between the description of an editing task and a precise explanation of
|
||||
the commands and options used for it. Use these two actions:
|
||||
|
||||
Click to jump to a subject under the cursor.
|
||||
Click < to jump back (repeat to go further back).
|
||||
|
||||
Many links are in vertical bars, like this: |bars|. An option name, like
|
||||
'number', a command in double quotes like ":write" and any other word can also
|
||||
be used as a link. Try it out: Move the cursor to CTRL-] and press CTRL-]
|
||||
on it.
|
||||
|
||||
Other subjects can be found with the ":help" command, see |help.txt|.
|
||||
|
||||
==============================================================================
|
||||
*01.2* IdeaVim installed
|
||||
|
||||
Most of the manuals assume that IdeaVim has been properly installed. If you
|
||||
didn't do that yet, or if IdeaVim doesn't run properly (e.g., files can't be found
|
||||
or in the GUI the menus do not show up) first read the chapter on
|
||||
installation: |usr_90.txt|.
|
||||
<!--
|
||||
*not-compatible*
|
||||
The manuals often assume you are using Vim with Vi-compatibility switched
|
||||
off. For most commands this doesn't matter, but sometimes it is important,
|
||||
e.g., for multi-level undo. An easy way to make sure you are using the right
|
||||
setup, copy the example vimrc file. By doing this inside Vim you don't have
|
||||
to check out where it is located. How to do this depends on the system you
|
||||
are using:
|
||||
|
||||
Unix: >
|
||||
:!cp -i $VIMRUNTIME/vimrc_example.vim ~/.vimrc
|
||||
MS-DOS, MS-Windows, OS/2: >
|
||||
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/_vimrc
|
||||
Amiga: >
|
||||
:!copy $VIMRUNTIME/vimrc_example.vim $VIM/.vimrc
|
||||
|
||||
If the file already exists you probably want to keep it.
|
||||
|
||||
If you start Vim now, the 'compatible' option should be off. You can check it
|
||||
with this command: >
|
||||
|
||||
:set compatible?
|
||||
|
||||
If it responds with "nocompatible" you are doing well. If the response is
|
||||
"compatible" you are in trouble. You will have to find out why the option is
|
||||
still set. Perhaps the file you wrote above is not found. Use this command
|
||||
to find out: >
|
||||
|
||||
:scriptnames
|
||||
|
||||
If your file is not in the list, check its location and name. If it is in the
|
||||
list, there must be some other place where the 'compatible' option is switched
|
||||
back on.
|
||||
|
||||
For more info see |vimrc| and |compatible-default|.
|
||||
|
||||
Note:
|
||||
This manual is about using Vim in the normal way. There is an
|
||||
alternative called "evim" (easy Vim). This is still Vim, but used in
|
||||
a way that resembles a click-and-type editor like Notepad. It always
|
||||
stays in Insert mode, thus it feels very different. It is not
|
||||
explained in the user manual, since it should be mostly self
|
||||
explanatory. See |evim-keys| for details.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*01.3* Using the Vim tutor *tutor* *vimtutor*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Instead of reading the text (boring!) you can use the vimtutor to learn your
|
||||
first Vim commands. This is a 30 minute tutorial that teaches the most basic
|
||||
Vim functionality hands-on.
|
||||
|
||||
On Unix and MS-Windows, if Vim has been properly installed, you can start it
|
||||
from the shell:
|
||||
>
|
||||
vimtutor
|
||||
|
||||
This will make a copy of the tutor file, so that you can edit it without
|
||||
the risk of damaging the original.
|
||||
There are a few translated versions of the tutor. To find out if yours is
|
||||
available, use the two-letter language code. For French: >
|
||||
|
||||
vimtutor fr
|
||||
|
||||
For OpenVMS, if Vim has been properly installed, you can start vimtutor from a
|
||||
VMS prompt with: >
|
||||
|
||||
@VIM:vimtutor
|
||||
|
||||
Optionally add the two-letter language code as above.
|
||||
|
||||
|
||||
On other systems, you have to do a little work:
|
||||
|
||||
1. Copy the tutor file. You can do this with Vim (it knows where to find it):
|
||||
>
|
||||
vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor' -c 'w! TUTORCOPY' -c 'q'
|
||||
<
|
||||
This will write the file "TUTORCOPY" in the current directory. To use a
|
||||
translated version of the tutor, append the two-letter language code to the
|
||||
filename. For French:
|
||||
>
|
||||
vim -u NONE -c 'e $VIMRUNTIME/tutor/tutor.fr' -c 'w! TUTORCOPY' -c 'q'
|
||||
<
|
||||
2. Edit the copied file with Vim:
|
||||
>
|
||||
vim -u NONE -c "set nocp" TUTORCOPY
|
||||
<
|
||||
The extra arguments make sure Vim is started in a good mood.
|
||||
|
||||
3. Delete the copied file when you are finished with it:
|
||||
>
|
||||
del TUTORCOPY
|
||||
<
|
||||
-->
|
||||
==============================================================================
|
||||
*01.4* Copyright *manual-copyright*
|
||||
|
||||
The IdeaVim user manual and reference manual are derived from the original Vim
|
||||
manuals. They have been copied and modified as appropriate for IdeaVim.
|
||||
|
||||
The Vim user manual and reference manual are Copyright (c) 1988-2003 by Bram
|
||||
Moolenaar. This material may be distributed only subject to the terms and
|
||||
conditions set forth in the Open Publication License, v1.0 or later. The
|
||||
latest version is presently available at:
|
||||
http://www.opencontent.org/openpub/
|
||||
|
||||
People who contribute to the manuals must agree with the above copyright
|
||||
notice.
|
||||
*frombook*
|
||||
Parts of the user manual come from the book "Vi IMproved - Vim" by Steve
|
||||
Oualline (published by New Riders Publishing, ISBN: 0735710015). The Open
|
||||
Publication License applies to this book. Only selected parts are included
|
||||
and these have been modified (e.g., by removing the pictures, updating the
|
||||
text for Vim 6.0 and fixing mistakes). The omission of the |frombook| tag
|
||||
does not mean that the text does not come from the book.
|
||||
|
||||
Many thanks to Steve Oualline and New Riders for creating this book and
|
||||
publishing it under the OPL! It has been a great help while writing the user
|
||||
manual. Not only by providing literal text, but also by setting the tone and
|
||||
style.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_02.txt| The first steps in Vim
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,517 +0,0 @@
|
||||
*usr_02.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
The first steps in IdeaVim
|
||||
|
||||
|
||||
This chapter provides just enough information to edit a file with IdeaVim. Not
|
||||
well or fast, but you can edit. Take some time to practice with these
|
||||
commands, they form the base for what follows.
|
||||
|
||||
|02.1| Running IdeaVim for the First Time
|
||||
|02.2| Inserting text
|
||||
|02.3| Moving around
|
||||
|02.4| Deleting characters
|
||||
|02.5| Undo and Redo
|
||||
|02.6| Other editing commands
|
||||
|02.7| Getting out
|
||||
|02.8| Finding help
|
||||
|
||||
Next chapter: |usr_03.txt| Moving around
|
||||
Previous chapter: |usr_01.txt| About the manuals
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*02.1* Running IdeaVim for the First Time
|
||||
|
||||
Since IdeaVim runs within IDE you run IdeaVim by starting IDE.
|
||||
<!--
|
||||
To start Vim, enter this command: >
|
||||
|
||||
gvim file.txt
|
||||
|
||||
In UNIX you can type this at any command prompt. If you are running Microsoft
|
||||
Windows, open an MS-DOS prompt window and enter the command.
|
||||
In either case, Vim starts editing a file called file.txt. Because this
|
||||
is a new file, you get a blank window. This is what your screen will look
|
||||
like:
|
||||
|
||||
+---------------------------------------+
|
||||
|# |
|
||||
|~ |
|
||||
|~ |
|
||||
|~ |
|
||||
|~ |
|
||||
|"file.txt" [New file] |
|
||||
+---------------------------------------+
|
||||
('#" is the cursor position.)
|
||||
|
||||
The tilde (~) lines indicate lines not in the file. In other words, when Vim
|
||||
runs out of file to display, it displays tilde lines. At the bottom of the
|
||||
screen, a message line indicates the file is named file.txt and shows that you
|
||||
are creating a new file. The message information is temporary and other
|
||||
information overwrites it.
|
||||
|
||||
|
||||
THE VIM COMMAND
|
||||
|
||||
The gvim command causes the editor to create a new window for editing. If you
|
||||
use this command: >
|
||||
|
||||
vim file.txt
|
||||
|
||||
the editing occurs inside your command window. In other words, if you are
|
||||
running inside an xterm, the editor uses your xterm window. If you are using
|
||||
an MS-DOS command prompt window under Microsoft Windows, the editing occurs
|
||||
inside this window. The text in the window will look the same for both
|
||||
versions, but with gvim you have extra features, like a menu bar. More about
|
||||
that later.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*02.2* Inserting text
|
||||
|
||||
The IdeaVim editor is a modal editor. That means that the editor behaves
|
||||
differently, depending on which mode you are in. The two basic modes are
|
||||
called Normal mode and Insert mode. In Normal mode the characters you type
|
||||
are commands. In Insert mode the characters are inserted as text.
|
||||
Since you have just started IdeaVim it will be in Normal mode. To start Insert
|
||||
mode you type the "i" command (i for Insert). Then you can enter
|
||||
the text. It will be inserted into the file. Do not worry if you make
|
||||
mistakes; you can correct them later. To enter the following programmer's
|
||||
limerick, this is what you type: >
|
||||
|
||||
iA very intelligent turtle
|
||||
Found programming UNIX a hurdle
|
||||
|
||||
After typing "turtle" you press the <Enter> key to start a new line. Finally
|
||||
you press the <Esc> key to stop Insert mode and go back to Normal mode. You
|
||||
now have two lines of text in your editor:
|
||||
|
||||
+---------------------------------------+
|
||||
|A very intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
+---------------------------------------+
|
||||
|
||||
|
||||
WHAT IS THE MODE?
|
||||
|
||||
To be able to see what mode you are in, type this command: >
|
||||
|
||||
:set showmode
|
||||
|
||||
You will notice that when typing the colon IdeaVim moves the cursor to the last
|
||||
line of the window. That's where you type colon commands (commands that start
|
||||
with a colon). Finish this command by pressing the <Enter> key (all commands
|
||||
that start with a colon are finished this way).
|
||||
Now, if you type the "i" command IdeaVim will display VIM - INSERT in the
|
||||
status bar. This indicates you are in Insert mode.
|
||||
|
||||
+---------------------------------------+
|
||||
|A very intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
|VIM - INSERT |
|
||||
+---------------------------------------+
|
||||
|
||||
If you press <Esc> to go back to Normal mode the last line will be made blank.
|
||||
|
||||
|
||||
GETTING OUT OF TROUBLE
|
||||
|
||||
One of the problems for Vim novices is mode confusion, which is caused by
|
||||
forgetting which mode you are in or by accidentally typing a command that
|
||||
switches modes. To get back to Normal mode, no matter what mode you are in,
|
||||
press the <Esc> key. Sometimes you have to press it twice. If Vim beeps back
|
||||
at you, you already are in Normal mode.
|
||||
|
||||
==============================================================================
|
||||
*02.3* Moving around
|
||||
|
||||
After you return to Normal mode, you can move around by using these keys:
|
||||
|
||||
h left *hjkl*
|
||||
j down
|
||||
k up
|
||||
l right
|
||||
|
||||
At first, it may appear that these commands were chosen at random. After all,
|
||||
who ever heard of using l for right? But actually, there is a very good
|
||||
reason for these choices: Moving the cursor is the most common thing you do in
|
||||
an editor, and these keys are on the home row of your right hand. In other
|
||||
words, these commands are placed where you can type them the fastest
|
||||
(especially when you type with ten fingers).
|
||||
|
||||
Note:
|
||||
You can also move the cursor by using the arrow keys. If you do,
|
||||
however, you greatly slow down your editing because to press the arrow
|
||||
keys, you must move your hand from the text keys to the arrow keys.
|
||||
Considering that you might be doing it hundreds of times an hour, this
|
||||
can take a significant amount of time.
|
||||
Also, there are keyboards which do not have arrow keys, or which
|
||||
locate them in unusual places; therefore, knowing the use of the hjkl
|
||||
keys helps in those situations.
|
||||
|
||||
One way to remember these commands is that h is on the left, l is on the
|
||||
right and j points down. In a picture: >
|
||||
|
||||
k
|
||||
h l
|
||||
j
|
||||
|
||||
The best way to learn these commands is by using them. Use the "i" command to
|
||||
insert some more lines of text. Then use the hjkl keys to move around and
|
||||
insert a word somewhere. Don't forget to press <Esc> to go back to Normal
|
||||
mode. The |vimtutor| is also a nice way to learn by doing.
|
||||
|
||||
For Japanse users, Hiroshi Iwatani suggested using this:
|
||||
|
||||
Komsomolsk
|
||||
^
|
||||
|
|
||||
Huan Ho <--- ---> Los Angeles
|
||||
(Yellow river) |
|
||||
v
|
||||
Java (the island, not the programming language)
|
||||
|
||||
==============================================================================
|
||||
*02.4* Deleting characters
|
||||
|
||||
To delete a character, move the cursor over it and type "x". (This is a
|
||||
throwback to the old days of the typewriter, when you deleted things by typing
|
||||
xxxx over them.) Move the cursor to the beginning of the first line, for
|
||||
example, and type xxxxxxx (seven x's) to delete "A very ". The result should
|
||||
look like this:
|
||||
|
||||
+---------------------------------------+
|
||||
|intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
+---------------------------------------+
|
||||
|
||||
Now you can insert new text, for example by typing: >
|
||||
|
||||
iA young <Esc>
|
||||
|
||||
This begins an insert (the i), inserts the words "A young", and then exits
|
||||
insert mode (the final <Esc>). The result:
|
||||
|
||||
+---------------------------------------+
|
||||
|A young intelligent turtle |
|
||||
|Found programming UNIX a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
+---------------------------------------+
|
||||
|
||||
|
||||
DELETING A LINE
|
||||
|
||||
To delete a whole line use the "dd" command. The following line will
|
||||
then move up to fill the gap:
|
||||
|
||||
+---------------------------------------+
|
||||
|Found programming UNIX a hurdle |
|
||||
|~ |
|
||||
|~ |
|
||||
|~ |
|
||||
| |
|
||||
+---------------------------------------+
|
||||
|
||||
|
||||
DELETING A LINE BREAK
|
||||
|
||||
In Vim you can join two lines together, which means that the line break
|
||||
between them is deleted. The "J" command does this.
|
||||
Take these two lines:
|
||||
|
||||
A young intelligent ~
|
||||
turtle ~
|
||||
|
||||
Move the cursor to the first line and press "J":
|
||||
|
||||
A young intelligent turtle ~
|
||||
|
||||
==============================================================================
|
||||
*02.5* Undo and Redo
|
||||
|
||||
Suppose you delete too much. Well, you can type it in again, but an easier
|
||||
way exists. The "u" command undoes the last edit. Take a look at this in
|
||||
action: After using "dd" to delete the first line, "u" brings it back.
|
||||
Another one: Move the cursor to the A in the first line:
|
||||
|
||||
A young intelligent turtle ~
|
||||
|
||||
Now type xxxxxxx to delete "A young". The result is as follows:
|
||||
|
||||
intelligent turtle ~
|
||||
|
||||
Type "u" to undo the last delete. That delete removed the g, so the undo
|
||||
restores the character.
|
||||
|
||||
g intelligent turtle ~
|
||||
|
||||
The next u command restores the next-to-last character deleted:
|
||||
|
||||
ng intelligent turtle ~
|
||||
|
||||
The next u command gives you the u, and so on:
|
||||
|
||||
ung intelligent turtle ~
|
||||
oung intelligent turtle ~
|
||||
young intelligent turtle ~
|
||||
young intelligent turtle ~
|
||||
A young intelligent turtle ~
|
||||
|
||||
Note:
|
||||
If you type "u" twice, and the result is that you get the same text
|
||||
back, you have Vim configured to work Vi compatible. Look here to fix
|
||||
this: |not-compatible|.
|
||||
This text assumes you work "The Vim Way". You might prefer to use
|
||||
the good old Vi way, but you will have to watch out for small
|
||||
differences in the text then.
|
||||
|
||||
|
||||
REDO
|
||||
|
||||
If you undo too many times, you can press CTRL-R (redo) to reverse the
|
||||
preceding command. In other words, it undoes the undo. To see this in
|
||||
action, press CTRL-R twice. The character A and the space after it disappear:
|
||||
|
||||
young intelligent turtle ~
|
||||
|
||||
<!--
|
||||
There's a special version of the undo command, the "U" (undo line) command.
|
||||
The undo line command undoes all the changes made on the last line that was
|
||||
edited. Typing this command twice cancels the preceding "U".
|
||||
|
||||
A very intelligent turtle ~
|
||||
xxxx Delete very
|
||||
|
||||
A intelligent turtle ~
|
||||
xxxxxx Delete turtle
|
||||
|
||||
A intelligent ~
|
||||
Restore line with "U"
|
||||
A very intelligent turtle ~
|
||||
Undo "U" with "u"
|
||||
A intelligent ~
|
||||
|
||||
The "U" command is a change by itself, which the "u" command undoes and CTRL-R
|
||||
redoes. This might be a bit confusing. Don't worry, with "u" and CTRL-R you
|
||||
can go to any of the situations you had.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
*02.6* Other editing commands
|
||||
|
||||
IdeaVim has a large number of commands to change the text. See |Q_in| and below.
|
||||
Here are a few often used ones.
|
||||
|
||||
|
||||
APPENDING
|
||||
|
||||
The "i" command inserts a character before the character under the cursor.
|
||||
That works fine; but what happens if you want to add stuff to the end of the
|
||||
line? For that you need to insert text after the cursor. This is done with
|
||||
the "a" (append) command.
|
||||
For example, to change the line
|
||||
|
||||
and that's not saying much for the turtle. ~
|
||||
to
|
||||
and that's not saying much for the turtle!!! ~
|
||||
|
||||
move the cursor over to the dot at the end of the line. Then type "x" to
|
||||
delete the period. The cursor is now positioned at the end of the line on the
|
||||
e in turtle. Now type >
|
||||
|
||||
a!!!<Esc>
|
||||
|
||||
to append three exclamation points after the e in turtle:
|
||||
|
||||
and that's not saying much for the turtle!!! ~
|
||||
|
||||
|
||||
OPENING UP A NEW LINE
|
||||
|
||||
The "o" command creates a new, empty line below the cursor and puts Vim in
|
||||
Insert mode. Then you can type the text for the new line.
|
||||
Suppose the cursor is somewhere in the first of these two lines:
|
||||
|
||||
A very intelligent turtle ~
|
||||
Found programming UNIX a hurdle ~
|
||||
|
||||
If you now use the "o" command and type new text: >
|
||||
|
||||
oThat liked using Vim<Esc>
|
||||
|
||||
The result is:
|
||||
|
||||
A very intelligent turtle ~
|
||||
That liked using Vim ~
|
||||
Found programming UNIX a hurdle ~
|
||||
|
||||
The "O" command (uppercase) opens a line above the cursor.
|
||||
|
||||
|
||||
USING A COUNT
|
||||
|
||||
Suppose you want to move up nine lines. You can type "kkkkkkkkk" or you can
|
||||
enter the command "9k". In fact, you can precede many commands with a number.
|
||||
Earlier in this chapter, for instance, you added three exclamation points to
|
||||
the end of a line by typing "a!!!<Esc>". Another way to do this is to use the
|
||||
command "3a!<Esc>". The count of 3 tells the command that follows to triple
|
||||
its effect. Similarly, to delete three characters, use the command "3x". The
|
||||
count always comes before the command it applies to.
|
||||
|
||||
==============================================================================
|
||||
*02.7* Getting out
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
To exit, use the "ZZ" command. This command writes the file and exits.
|
||||
|
||||
Note:
|
||||
Unlike many other editors, Vim does not automatically make a backup
|
||||
file. If you type "ZZ", your changes are committed and there's no
|
||||
turning back. You can configure the Vim editor to produce backup
|
||||
files, see |07.4|.
|
||||
|
||||
DISCARDING CHANGES
|
||||
|
||||
Sometimes you will make a sequence of changes and suddenly realize you were
|
||||
better off before you started. Not to worry; Vim has a
|
||||
quit-and-throw-things-away command. It is: >
|
||||
|
||||
:q!
|
||||
|
||||
Don't forget to press <Enter> to finish the command.
|
||||
|
||||
For those of you interested in the details, the three parts of this command
|
||||
are the colon (:), which enters Command-line mode; the q command, which tells
|
||||
the editor to quit; and the override command modifier (!).
|
||||
The override command modifier is needed because Vim is reluctant to throw
|
||||
away changes. If you were to just type ":q", Vim would display an error
|
||||
message and refuse to exit:
|
||||
|
||||
E37: No write since last change (use ! to override) ~
|
||||
|
||||
By specifying the override, you are in effect telling Vim, "I know that what
|
||||
I'm doing looks stupid, but I'm a big boy and really want to do this."
|
||||
|
||||
If you want to continue editing with Vim: The ":e!" command reloads the
|
||||
original version of the file.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*02.8* Finding help
|
||||
|
||||
Everything you always wanted to know can be found in the IdeaVim help files.
|
||||
Don't be afraid to ask!
|
||||
To get generic help use this command: >
|
||||
|
||||
:help
|
||||
|
||||
You could also use the first function key <F1>. If your keyboard has a <Help>
|
||||
key it might work as well.
|
||||
If you don't supply a subject, ":help" displays the general help window.
|
||||
<!--
|
||||
The creators of Vim did something very clever (or very lazy) with the help
|
||||
system: They made the help window a normal editing window. You can use all
|
||||
the normal Vim commands to move through the help information. Therefore h, j,
|
||||
k, and l move left, down, up and right.
|
||||
To get out of the help window, use the same command you use to get out of
|
||||
the editor: "ZZ". This will only close the help window, not exit Vim.
|
||||
-->
|
||||
|
||||
As you read the help text, you will notice some text enclosed in vertical bars
|
||||
(for example, |help|). This indicates a hyperlink. If you position the mouse
|
||||
cursor anywhere between the bars and click the left mouse button, the help
|
||||
system takes you to the indicated subject. (For reasons not discussed here,
|
||||
the Vim terminology for a hyperlink is tag. So left-click jumps to the location
|
||||
of the tag given by the word under the cursor.)
|
||||
After a few jumps, you might want to go back. Mouse click on the < button to
|
||||
go back to the preceding position. Mouse click on the > button to go forward
|
||||
again.
|
||||
At the top of the help screen, there is the notation *help.txt*. This name
|
||||
between "*" characters is used by the help system to define a tag (hyperlink
|
||||
destination).
|
||||
<!--
|
||||
See |29.1| for details about using tags.
|
||||
-->
|
||||
|
||||
To get help on a given subject, use the following command: >
|
||||
|
||||
:help {subject}
|
||||
|
||||
To get help on the "x" command, for example, enter the following: >
|
||||
|
||||
:help x
|
||||
|
||||
To find out how to delete text, use this command: >
|
||||
|
||||
:help deleting
|
||||
|
||||
To get a complete index of all Vim commands, use the following command: >
|
||||
|
||||
:help index
|
||||
|
||||
When you need to get help for a control character command (for example,
|
||||
CTRL-A), you need to spell it with the prefix "CTRL-". >
|
||||
|
||||
:help CTRL-A
|
||||
|
||||
The IdeaVim editor has many different modes. By default, the help system displays
|
||||
the normal-mode commands. For example, the following command displays help
|
||||
for the normal-mode CTRL-H command: >
|
||||
|
||||
:help CTRL-H
|
||||
|
||||
To identify other modes, use a mode prefix. If you want the help for the
|
||||
insert-mode version of a command, use "i_". For CTRL-H this gives you the
|
||||
following command: >
|
||||
|
||||
:help i_CTRL-H
|
||||
|
||||
<!--
|
||||
When you start the IdeaVim editor, you can use several command-line arguments.
|
||||
These all begin with a dash (-). To find what the -t argument does, for
|
||||
example, use the command: >
|
||||
|
||||
:help -t
|
||||
|
||||
-->
|
||||
The IdeaVim editor has a number of options that enable you to configure and
|
||||
customize the editor. If you want help for an option, you need to enclose it
|
||||
in single quotation marks. To find out what the 'number' option does, for
|
||||
example, use the following command: >
|
||||
|
||||
:help 'number'
|
||||
|
||||
The table with all mode prefixes can be found here: |help-context|.
|
||||
|
||||
Special keys are enclosed in angle brackets. To find help on the up-arrow key
|
||||
in Insert mode, for instance, use this command: >
|
||||
|
||||
:help i_<Up>
|
||||
|
||||
If you see an error message that you don't understand, for example:
|
||||
|
||||
E37: No write since last change (use ! to override) ~
|
||||
|
||||
You can use the error ID at the start to find help about it: >
|
||||
|
||||
:help E37
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_03.txt| Moving around
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,671 +0,0 @@
|
||||
*usr_03.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 31
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Moving around
|
||||
|
||||
|
||||
Before you can insert or delete text the cursor has to be moved to the right
|
||||
place. IdeaVim has a large number of commands to position the cursor. This
|
||||
chapter shows you how to use the most important ones. You can find a list of
|
||||
these commands below |Q_lr|.
|
||||
|
||||
|03.1| Word movement
|
||||
|03.2| Moving to the start or end of a line
|
||||
|03.3| Moving to a character
|
||||
|03.4| Matching a paren
|
||||
|03.5| Moving to a specific line
|
||||
|03.6| Telling where you are
|
||||
|03.7| Scrolling around
|
||||
|03.8| Simple searches
|
||||
|03.9| Simple search patterns
|
||||
|03.10| Using marks
|
||||
|
||||
Next chapter: |usr_04.txt| Making small changes
|
||||
Previous chapter: |usr_02.txt| The first steps in Vim
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*03.1* Word movement
|
||||
|
||||
To move the cursor forward one word, use the "w" command. Like most IdeaVim
|
||||
commands, you can use a numeric prefix to move past multiple words. For
|
||||
example, "3w" moves three words. This figure shows how it works:
|
||||
|
||||
This is a line with example text ~
|
||||
--->-->->----------------->
|
||||
w w w 3w
|
||||
|
||||
Notice that "w" moves to the start of the next word if it already is at the
|
||||
start of a word.
|
||||
The "b" command moves backward to the start of the previous word:
|
||||
|
||||
This is a line with example text ~
|
||||
<----<--<-<---------<---
|
||||
b b b 2b b
|
||||
|
||||
There is also the "e" command that moves to the next end of a word and "ge",
|
||||
which moves to the previous end of a word:
|
||||
|
||||
This is a line with example text ~
|
||||
<- <--- -----> ---->
|
||||
ge ge e e
|
||||
|
||||
If you are at the last word of a line, the "w" command will take you to the
|
||||
first word in the next line. Thus you can use this to move through a
|
||||
paragraph, much faster than using "l". "b" does the same in the other
|
||||
direction.
|
||||
|
||||
A word ends at a non-word character, such as a ".", "-" or ")".
|
||||
<!--
|
||||
To change what Vim considers to be a word, see the 'iskeyword' option.
|
||||
-->
|
||||
It is also possible to move by white-space separated WORDs. This is not a
|
||||
word in the normal sense, that's why the uppercase is used. The commands for
|
||||
moving by WORDs are also uppercase, as this figure shows:
|
||||
|
||||
ge b w e
|
||||
<- <- ---> --->
|
||||
This is-a line, with special/separated/words (and some more). ~
|
||||
<----- <----- --------------------> ----->
|
||||
gE B W E
|
||||
|
||||
With this mix of lowercase and uppercase commands, you can quickly move
|
||||
forward and backward through a paragraph.
|
||||
|
||||
<!--
|
||||
TODO - add [w, ]w, etc. (camel hump)
|
||||
-->
|
||||
==============================================================================
|
||||
*03.2* Moving to the start or end of a line
|
||||
|
||||
The "$" command moves the cursor to the end of a line. If your keyboard has
|
||||
an <End> key it will do the same thing.
|
||||
|
||||
The "^" command moves to the first non-blank character of the line. The "0"
|
||||
command (zero) moves to the very first character of the line. The <Home> key
|
||||
does the same thing. In a picture:
|
||||
|
||||
^
|
||||
<------------
|
||||
.....This is a line with example text ~
|
||||
<----------------- --------------->
|
||||
0 $
|
||||
|
||||
(the "....." indicates blanks here)
|
||||
|
||||
The "$" command takes a count, like most movement commands. But moving to
|
||||
the end of the line several times doesn't make sense. Therefore it causes the
|
||||
editor to move to the end of another line. For example, "1$" moves you to
|
||||
the end of the first line (the one you're on), "2$" to the end of the next
|
||||
line, and so on.
|
||||
The "0" command doesn't take a count argument, because the "0" would be
|
||||
part of the count. Unexpectedly, using a count with "^" doesn't have any
|
||||
effect.
|
||||
|
||||
==============================================================================
|
||||
*03.3* Moving to a character
|
||||
|
||||
One of the most useful movement commands is the single-character search
|
||||
command. The command "fx" searches forward in the line for the single
|
||||
character x. Hint: "f" stands for "Find".
|
||||
For example, you are at the beginning of the following line. Suppose you
|
||||
want to go to the h of human. Just execute the command "fh" and the cursor
|
||||
will be positioned over the h:
|
||||
|
||||
To err is human. To really foul up you need a computer. ~
|
||||
---------->--------------->
|
||||
fh fy
|
||||
|
||||
This also shows that the command "fy" moves to the end of the word really.
|
||||
You can specify a count; therefore, you can go to the "l" of "foul" with
|
||||
"3fl":
|
||||
|
||||
To err is human. To really foul up you need a computer. ~
|
||||
--------------------->
|
||||
3fl
|
||||
|
||||
The "F" command searches to the left:
|
||||
|
||||
To err is human. To really foul up you need a computer. ~
|
||||
<---------------------
|
||||
Fh
|
||||
|
||||
The "tx" command works like the "fx" command, except it stops one character
|
||||
before the searched character. Hint: "t" stands for "To". The backward
|
||||
version of this command is "Tx".
|
||||
|
||||
To err is human. To really foul up you need a computer. ~
|
||||
<------------ ------------->
|
||||
Th tn
|
||||
|
||||
These four commands can be repeated with ";". "," repeats in the other
|
||||
direction. The cursor is never moved to another line. Not even when the
|
||||
sentence continues.
|
||||
|
||||
Sometimes you will start a search, only to realize that you have typed the
|
||||
wrong command. You type "f" to search backward, for example, only to realize
|
||||
that you really meant "F". To abort a search, press <Esc>. So "f<Esc>" is an
|
||||
aborted forward search and doesn't do anything. Note: <Esc> cancels most
|
||||
operations, not just searches.
|
||||
|
||||
==============================================================================
|
||||
*03.4* Matching a paren
|
||||
|
||||
When writing a program you often end up with nested () constructs. Then the
|
||||
"%" command is very handy: It moves to the matching paren. If the cursor is
|
||||
on a "(" it will move to the matching ")". If it's on a ")" it will move to
|
||||
the matching "(".
|
||||
|
||||
%
|
||||
<----->
|
||||
if (a == (b * c) / d) ~
|
||||
<---------------->
|
||||
%
|
||||
|
||||
This also works for [] and {} pairs. (This can be defined with the
|
||||
'matchpairs' option.)
|
||||
|
||||
When the cursor is not on a useful character, "%" will search forward to find
|
||||
one. Thus if the cursor is at the start of the line of the previous example,
|
||||
"%" will search forward and find the first "(". Then it moves to its match:
|
||||
|
||||
if (a == (b * c) / d) ~
|
||||
---+---------------->
|
||||
%
|
||||
|
||||
==============================================================================
|
||||
*03.5* Moving to a specific line
|
||||
|
||||
If you are a C or C++ programmer, you are familiar with error messages such as
|
||||
the following:
|
||||
|
||||
prog.c:33: j undeclared (first use in this function) ~
|
||||
|
||||
This tells you that you might want to fix something on line 33. So how do you
|
||||
find line 33? One way is to do "9999k" to go to the top of the file and "32j"
|
||||
to go down thirtytwo lines. It is not a good way, but it works. A much
|
||||
better way of doing things is to use the "G" command. With a count, this
|
||||
command positions you at the given line number. For example, "33G" puts you
|
||||
on line 33.
|
||||
<!--
|
||||
(For a better way of going through a compiler's error list, see
|
||||
|usr_30.txt|, for information on the :make command.)
|
||||
-->
|
||||
With no argument, "G" positions you at the end of the file. A quick way to
|
||||
go to the start of a file use "gg". "1G" will do the same, but is a tiny bit
|
||||
more typing.
|
||||
|
||||
| first line of a file ^
|
||||
| text text text text |
|
||||
| text text text text | gg
|
||||
7G | text text text text |
|
||||
| text text text text
|
||||
| text text text text
|
||||
V text text text text |
|
||||
text text text text | G
|
||||
text text text text |
|
||||
last line of a file V
|
||||
|
||||
Another way to move to a line is using the "%" command with a count. For
|
||||
example "50%" moves you to halfway the file. "90%" goes to near the end.
|
||||
|
||||
The previous assumes that you want to move to a line in the file, no matter if
|
||||
it's currently visible or not. What if you want to move to one of the lines
|
||||
you can see? This figure shows the three commands you can use:
|
||||
|
||||
+---------------------------+
|
||||
H --> | text sample text |
|
||||
| sample text |
|
||||
| text sample text |
|
||||
| sample text |
|
||||
M --> | text sample text |
|
||||
| sample text |
|
||||
| text sample text |
|
||||
| sample text |
|
||||
L --> | text sample text |
|
||||
+---------------------------+
|
||||
|
||||
Hints: "H" stands for Home, "M" for Middle and "L" for Last.
|
||||
|
||||
==============================================================================
|
||||
*03.6* Telling where you are
|
||||
|
||||
To see where you are in a file, there are three ways:
|
||||
|
||||
1. Use the CTRL-G command. You get a message like this (assuming the 'ruler'
|
||||
option is off):
|
||||
|
||||
"usr_03.txt" line 233 of 650 --35%-- col 45-52~
|
||||
|
||||
This shows the name of the file you are editing, the line number where the
|
||||
cursor is, the total number of lines, the percentage of the way through
|
||||
the file and the column of the cursor.
|
||||
Sometimes you will see a split column number. For example, "col 2-9".
|
||||
This indicates that the cursor is positioned on the second character, but
|
||||
because character one is a tab, occupying eight spaces worth of columns,
|
||||
the screen column is 9.
|
||||
|
||||
<!--
|
||||
2. Set the 'number' option. This will display a line number in front of
|
||||
every line: >
|
||||
|
||||
:set number
|
||||
<
|
||||
To switch this off again: >
|
||||
|
||||
:set nonumber
|
||||
<
|
||||
Since 'number' is a boolean option, prepending "no" to its name has the
|
||||
effect of switching it off. A boolean option has only these two values,
|
||||
it is either on or off.
|
||||
Vim has many options. Besides the boolean ones there are options with
|
||||
a numerical value and string options. You will see examples of this where
|
||||
they are used.
|
||||
|
||||
3. Set the 'ruler' option. This will display the cursor position in the
|
||||
lower right corner of the Vim window: >
|
||||
|
||||
:set ruler
|
||||
|
||||
Using the 'ruler' option has the advantage that it doesn't take much room,
|
||||
thus there is more space for your text.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*03.7* Scrolling around
|
||||
|
||||
The CTRL-U command scrolls down half a screen of text. Think of looking
|
||||
through a viewing window at the text and moving this window up by half the
|
||||
height of the window. Thus the window moves up over the text, which is
|
||||
backward in the file. Don't worry if you have a little trouble remembering
|
||||
which end is up. Most users have the same problem.
|
||||
The CTRL-D command moves the viewing window down half a screen in the file,
|
||||
thus scrolls the text up half a screen.
|
||||
|
||||
+----------------+
|
||||
| some text |
|
||||
| some text |
|
||||
| some text |
|
||||
+---------------+ | some text |
|
||||
| some text | CTRL-U --> | |
|
||||
| | | 123456 |
|
||||
| 123456 | +----------------+
|
||||
| 7890 |
|
||||
| | +----------------+
|
||||
| example | CTRL-D --> | 7890 |
|
||||
+---------------+ | |
|
||||
| example |
|
||||
| example |
|
||||
| example |
|
||||
| example |
|
||||
+----------------+
|
||||
|
||||
To scroll one line at a time use CTRL-E (scroll up) and CTRL-Y (scroll down).
|
||||
Think of CTRL-E to give you one line Extra.
|
||||
<!--
|
||||
(If you use MS-Windows compatible
|
||||
key mappings CTRL-Y will redo a change instead of scroll.)
|
||||
-->
|
||||
|
||||
To scroll forward by a whole screen (except for two lines) use CTRL-F. The
|
||||
other way is backward, CTRL-B is the command to use. Fortunately CTRL-F is
|
||||
Forward and CTRL-B is Backward, that's easy to remember.
|
||||
|
||||
A common issue is that after moving down many lines with "j" your cursor is at
|
||||
the bottom of the screen. You would like to see the context of the line with
|
||||
the cursor. That's done with the "zz" command.
|
||||
|
||||
+------------------+ +------------------+
|
||||
| some text | | some text |
|
||||
| some text | | some text |
|
||||
| some text | | some text |
|
||||
| some text | zz --> | line with cursor |
|
||||
| some text | | some text |
|
||||
| some text | | some text |
|
||||
| line with cursor | | some text |
|
||||
+------------------+ +------------------+
|
||||
|
||||
The "zt" command puts the cursor line at the top, "zb" at the bottom. There
|
||||
are a few more scrolling commands, see |Q_sc|. To always keep a few lines of
|
||||
context around the cursor, use the 'scrolloff' option.
|
||||
|
||||
==============================================================================
|
||||
*03.8* Simple searches
|
||||
|
||||
To search for a string, use the "/string" command. To find the word include,
|
||||
for example, use the command: >
|
||||
|
||||
/include
|
||||
|
||||
You will notice that when you type the "/" the cursor jumps to the last line
|
||||
of the editor, like with colon commands. That is where you type the word.
|
||||
You can press the backspace key (backarrow or <BS>) to make corrections. Use
|
||||
the <Left> and <Right> cursor keys when necessary.
|
||||
Pressing <Enter> executes the command.
|
||||
|
||||
Note:
|
||||
The characters .*[]^%/\?~$ have special meaning. If you want to use
|
||||
them in a search you must put a \ in front of them. See below.
|
||||
|
||||
To find the next occurrence of the same string use the "n" command. Use this
|
||||
to find the first #include after the cursor: >
|
||||
|
||||
/#include
|
||||
|
||||
And then type "n" several times. You will move to each #include in the text.
|
||||
You can also use a count if you know which match you want. Thus "3n" finds
|
||||
the third match. Using a count with "/" doesn't work.
|
||||
|
||||
The "?" command works like "/" but searches backwards: >
|
||||
|
||||
?word
|
||||
|
||||
The "N" command repeats the last search the opposite direction. Thus using
|
||||
"N" after a "/" command search backwards, using "N" after "?" searches
|
||||
forward.
|
||||
|
||||
|
||||
IGNORING CASE
|
||||
|
||||
Normally you have to type exactly what you want to find. If you don't care
|
||||
about upper or lowercase in a word, set the 'ignorecase' option: >
|
||||
|
||||
:set ignorecase
|
||||
|
||||
If you now search for "word", it will also match "Word" and "WORD". To match
|
||||
case again: >
|
||||
|
||||
:set noignorecase
|
||||
|
||||
|
||||
HISTORY
|
||||
|
||||
Suppose you do three searches: >
|
||||
|
||||
/one
|
||||
/two
|
||||
/three
|
||||
|
||||
Now let's start searching by typing a simple "/" without pressing <Enter>. If
|
||||
you press <Up> (the cursor key), Vim puts "/three" on the command line.
|
||||
Pressing <Enter> at this point searches for three. If you do not press
|
||||
<Enter>, but press <Up> instead, Vim changes the prompt to "/two". Another
|
||||
press of <Up> moves you to "/one".
|
||||
You can also use the <Down> cursor key to move through the history of
|
||||
search commands in the other direction.
|
||||
|
||||
If you know what a previously used pattern starts with, and you want to use it
|
||||
again, type that character before pressing <Up>. With the previous example,
|
||||
you can type "/o<Up>" and Vim will put "/one" on the command line.
|
||||
|
||||
The commands starting with ":" also have a history. That allows you to recall
|
||||
a previous command and execute it again. These two histories are separate.
|
||||
|
||||
|
||||
SEARCHING FOR A WORD IN THE TEXT
|
||||
|
||||
Suppose you see the word "TheLongFunctionName" in the text and you want to
|
||||
find the next occurrence of it. You could type "/TheLongFunctionName", but
|
||||
that's a lot of typing. And when you make a mistake Vim won't find it.
|
||||
There is an easier way: Position the cursor on the word and use the "*"
|
||||
command. Vim will grab the word under the cursor and use it as the search
|
||||
string.
|
||||
The "#" command does the same in the other direction. You can prepend a
|
||||
count: "3*" searches for the third occurrence of the word under the cursor.
|
||||
|
||||
|
||||
SEARCHING FOR WHOLE WORDS
|
||||
|
||||
If you type "/the" it will also match "there". To only find words that end
|
||||
in "the" use: >
|
||||
|
||||
/the\>
|
||||
|
||||
The "\>" item is a special marker that only matches at the end of a word.
|
||||
Similarly "\<" only matches at the begin of a word. Thus to search for the
|
||||
word "the" only: >
|
||||
|
||||
/\<the\>
|
||||
|
||||
This does not match "there" or "soothe". Notice that the "*" and "#" commands
|
||||
use these start-of-word and end-of-word markers to only find whole words (you
|
||||
can use "g*" and "g#" to match partial words).
|
||||
|
||||
|
||||
HIGHLIGHTING MATCHES
|
||||
|
||||
While editing a program you see a variable called "nr". You want to check
|
||||
where it's used. You could move the cursor to "nr" and use the "*" command
|
||||
and press "n" to go along all the matches.
|
||||
There is another way. Type this command: >
|
||||
|
||||
:set hlsearch
|
||||
|
||||
If you now search for "nr", Vim will highlight all matches. That is a very
|
||||
good way to see where the variable is used, without the need to type commands.
|
||||
To switch this off: >
|
||||
|
||||
:set nohlsearch
|
||||
|
||||
Then you need to switch it on again if you want to use it for the next search
|
||||
command. If you only want to remove the highlighting, use this command: >
|
||||
|
||||
:nohlsearch
|
||||
|
||||
This doesn't reset the option. Instead, it disables the highlighting. As
|
||||
soon as you execute a search command, the highlighting will be used again.
|
||||
Also for the "n" and "N" commands.
|
||||
|
||||
|
||||
TUNING SEARCHES
|
||||
|
||||
There are a few options that change how searching works. These are the
|
||||
essential ones:
|
||||
<!--
|
||||
>
|
||||
:set incsearch
|
||||
|
||||
This makes Vim display the match for the string while you are still typing it.
|
||||
Use this to check if the right match will be found. Then press <Enter> to
|
||||
really jump to that location. Or type more to change the search string.
|
||||
-->
|
||||
>
|
||||
:set nowrapscan
|
||||
|
||||
This stops the search at the end of the file. Or, when you are searching
|
||||
backwards, at the start of the file. The 'wrapscan' option is on by default,
|
||||
thus searching wraps around the end of the file.
|
||||
|
||||
|
||||
INTERMEZZO
|
||||
|
||||
If you like one of the options mentioned before, and set it each time you use
|
||||
IdeaVim, you can put the command in your Vim startup file.
|
||||
<!--
|
||||
Edit the file, as mentioned at |not-compatible|. Or use this command to
|
||||
find out where it is: >
|
||||
|
||||
:scriptnames
|
||||
-->
|
||||
|
||||
Edit the file, for example with: >
|
||||
|
||||
:edit ~/.vimrc
|
||||
|
||||
Then add a line with the command to set the option, just like you typed it in
|
||||
IdeaVim. Example: >
|
||||
|
||||
Go:set hlsearch<Esc>
|
||||
|
||||
"G" moves to the end of the file. "o" starts a new line, where you type the
|
||||
":set" command. You end insert mode with <Esc>. Then write the file: >
|
||||
|
||||
ZZ
|
||||
|
||||
If you now start IdeaVim again, the 'hlsearch' option will already be set.
|
||||
|
||||
==============================================================================
|
||||
*03.9* Simple search patterns
|
||||
|
||||
The IdeaVim editor uses regular expressions to specify what to search for.
|
||||
Regular expressions are an extremely powerful and compact way to specify a
|
||||
search pattern. Unfortunately, this power comes at a price, because regular
|
||||
expressions are a bit tricky to specify.
|
||||
In this section we mention only a few essential ones. More about search
|
||||
patterns and commands in chapter 27 |usr_27.txt|. You can find the full
|
||||
explanation here: |pattern|.
|
||||
|
||||
|
||||
BEGINNING AND END OF A LINE
|
||||
|
||||
The ^ character matches the beginning of a line. On an English-US keyboard
|
||||
you find it above the 6. The pattern "include" matches the word include
|
||||
anywhere on the line. But the pattern "^include" matches the word include
|
||||
only if it is at the beginning of a line.
|
||||
The $ character matches the end of a line. Therefore, "was$" matches the
|
||||
word was only if it is at the end of a line.
|
||||
|
||||
Let's mark the places where "the" matches in this example line with "x"s:
|
||||
|
||||
the solder holding one of the chips melted and the ~
|
||||
xxx xxx xxx
|
||||
|
||||
Using "/the$" we find this match:
|
||||
|
||||
the solder holding one of the chips melted and the ~
|
||||
xxx
|
||||
|
||||
And with "/^the" we find this one:
|
||||
the solder holding one of the chips melted and the ~
|
||||
xxx
|
||||
|
||||
You can try searching with "/^the$", it will only match a single line
|
||||
consisting of "the". White space does matter here, thus if a line contains a
|
||||
space after the word, like "the ", the pattern will not match.
|
||||
|
||||
|
||||
MATCHING ANY SINGLE CHARACTER
|
||||
|
||||
The . (dot) character matches any existing character. For example, the
|
||||
pattern "c.m" matches a string whose first character is a c, whose second
|
||||
character is anything, and whose the third character is m. Example:
|
||||
|
||||
We use a computer that became the cummin winter. ~
|
||||
xxx xxx xxx
|
||||
|
||||
|
||||
MATCHING SPECIAL CHARACTERS
|
||||
|
||||
If you really want to match a dot, you must avoid its special meaning by
|
||||
putting a backslash before it.
|
||||
If you search for "ter.", you will find these matches:
|
||||
|
||||
We use a computer that became the cummin winter. ~
|
||||
xxxx xxxx
|
||||
|
||||
Searching for "ter\." only finds the second match.
|
||||
|
||||
==============================================================================
|
||||
*03.10* Using marks
|
||||
|
||||
When you make a jump to a position with the "G" command, IdeaVim remembers the
|
||||
position from before this jump. This position is called a mark. To go back
|
||||
where you came from, use this command: >
|
||||
|
||||
``
|
||||
|
||||
This ` is a backtick or open single-quote character.
|
||||
If you use the same command a second time you will jump back again. That's
|
||||
because the ` command is a jump itself, and the position from before this jump
|
||||
is remembered.
|
||||
|
||||
Generally, every time you do a command that can move the cursor further than
|
||||
within the same line, this is called a jump. This includes the search
|
||||
commands "/" and "n" (it doesn't matter how far away the match is). But not
|
||||
the character searches with "fx" and "tx" or the word movements "w" and "e".
|
||||
Also, "j" and "k" are not considered to be a jump. Even when you use a
|
||||
count to make them move the cursor quite a long way away.
|
||||
|
||||
The `` command jumps back and forth, between two points. The CTRL-O command
|
||||
jumps to older positions (Hint: O for older). CTRL-I then jumps back to newer
|
||||
positions (Hint: I is just next to O on the keyboard). Consider this sequence
|
||||
of commands: >
|
||||
|
||||
33G
|
||||
/^The
|
||||
CTRL-O
|
||||
|
||||
You first jump to line 33, then search for a line that starts with "The".
|
||||
Then with CTRL-O you jump back to line 33. Another CTRL-O takes you back to
|
||||
where you started. If you now use CTRL-I you jump to line 33 again. And
|
||||
to the match for "The" with another CTRL-I.
|
||||
|
||||
|
||||
| example text ^ |
|
||||
33G | example text | CTRL-O | CTRL-I
|
||||
| example text | |
|
||||
V line 33 text ^ V
|
||||
| example text | |
|
||||
/^The | example text | CTRL-O | CTRL-I
|
||||
V There you are | V
|
||||
example text
|
||||
|
||||
Note:
|
||||
CTRL-I is the same as <Tab>.
|
||||
|
||||
The ":jumps" command gives a list of positions you jumped to. The entry which
|
||||
you used last is marked with a ">".
|
||||
|
||||
|
||||
NAMED MARKS
|
||||
|
||||
IdeaVim enables you to place your own marks in the text. The command "ma" marks
|
||||
the place under the cursor as mark a. You can place 26 marks (a through z) in
|
||||
your text. You can't see them, it's just a position that IdeaVim remembers.
|
||||
To go to a mark, use the command `{mark}, where "{mark} is the mark letter.
|
||||
Thus to move to the a mark:
|
||||
>
|
||||
`a
|
||||
|
||||
The command 'mark (single quotation mark, or apostrophe) moves you to the
|
||||
beginning of the line containing the mark. This differs from the `mark
|
||||
command, which moves you to marked column.
|
||||
|
||||
The marks can be very useful when working on two related parts in a file.
|
||||
Suppose you have some text near the start of the file you need to look at,
|
||||
while working on some text near the end of the file.
|
||||
Move to the text at the start and place the s (start) mark there: >
|
||||
|
||||
ms
|
||||
|
||||
The move to the text you want to work on and put the e (end) mark there: >
|
||||
|
||||
me
|
||||
|
||||
Now you can move around, and when you want to look at the start of the file,
|
||||
you use this to jump there: >
|
||||
|
||||
's
|
||||
|
||||
Then you can use '' to jump back to where you were, or 'e to jump to the text
|
||||
you were working on at the end.
|
||||
There is nothing special about using s for start and e for end, they are
|
||||
just easy to remember.
|
||||
|
||||
You can use this command to get a list of marks: >
|
||||
|
||||
:marks
|
||||
|
||||
You will notice a few special marks. These include:
|
||||
|
||||
' The cursor position before doing a jump
|
||||
" The cursor position when last editing the file
|
||||
[ Start of the last change
|
||||
] End of the last change
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_04.txt| Making small changes
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,516 +0,0 @@
|
||||
*usr_04.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Making small changes
|
||||
|
||||
|
||||
This chapter shows you several ways of making corrections and moving text
|
||||
around. It teaches you the three basic ways to change text: operator-motion,
|
||||
Visual mode and text objects.
|
||||
|
||||
|04.1| Operators and motions
|
||||
|04.2| Changing text
|
||||
|04.3| Repeating a change
|
||||
|04.4| Visual mode
|
||||
|04.5| Moving text
|
||||
|04.6| Copying text
|
||||
|04.7| Using the clipboard
|
||||
|04.8| Text objects
|
||||
|04.9| Replace mode
|
||||
|04.10| Conclusion
|
||||
|
||||
Next chapter: |usr_05.txt| Set your settings
|
||||
Previous chapter: |usr_03.txt| Moving around
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*04.1* Operators and motions
|
||||
|
||||
In chapter 2 you learned the "x" command to delete a single character. And
|
||||
using a count: "4x" deletes four characters.
|
||||
The "dw" command deletes a word. You may recognize the "w" command as the
|
||||
move word command. In fact, the "d" command may be followed by any motion
|
||||
command, and it deletes from the current location to the place where the
|
||||
cursor winds up.
|
||||
The "4w" command, for example, moves the cursor over four words. The d4w
|
||||
command deletes four words.
|
||||
|
||||
To err is human. To really foul up you need a computer. ~
|
||||
------------------>
|
||||
d4w
|
||||
|
||||
To err is human. you need a computer. ~
|
||||
|
||||
IdeaVim only deletes up to the position where the motion takes the cursor. That's
|
||||
because IdeaVim knows that you probably don't want to delete the first character
|
||||
of a word. If you use the "e" command to move to the end of a word, IdeaVim
|
||||
guesses that you do want to include that last character:
|
||||
|
||||
To err is human. you need a computer. ~
|
||||
-------->
|
||||
d2e
|
||||
|
||||
To err is human. a computer. ~
|
||||
|
||||
Whether the character under the cursor is included depends on the command you
|
||||
used to move to that character. The reference manual calls this "exclusive"
|
||||
when the character isn't included and "inclusive" when it is.
|
||||
|
||||
The "$" command moves to the end of a line. The "d$" command deletes from the
|
||||
cursor to the end of the line. This is an inclusive motion, thus the last
|
||||
character of the line is included in the delete operation:
|
||||
|
||||
To err is human. a computer. ~
|
||||
------------>
|
||||
d$
|
||||
|
||||
To err is human ~
|
||||
|
||||
There is a pattern here: operator-motion. You first type an operator command.
|
||||
For example, "d" is the delete operator. Then you type a motion command like
|
||||
"4l" or "w". This way you can operate on any text you can move over.
|
||||
|
||||
==============================================================================
|
||||
*04.2* Changing text
|
||||
|
||||
Another operator is "c", change. It acts just like the "d" operator, except
|
||||
it leaves you in Insert mode. For example, "cw" changes a word. Or more
|
||||
specifically, it deletes a word and then puts you in Insert mode.
|
||||
|
||||
To err is human ~
|
||||
------->
|
||||
c2wbe<Esc>
|
||||
|
||||
To be human ~
|
||||
|
||||
This "c2wbe<Esc>" contains these bits:
|
||||
|
||||
c the change operator
|
||||
2w move two words (they are deleted and Insert mode started)
|
||||
be insert this text
|
||||
<Esc> back to Normal mode
|
||||
|
||||
If you have paid attention, you will have noticed something strange: The space
|
||||
before "human" isn't deleted. There is a saying that for every problem there
|
||||
is an answer that is simple, clear, and wrong. That is the case with the
|
||||
example used here for the "cw" command. The c operator works just like the
|
||||
d operator, with one exception: "cw". It actually works like "ce", change to
|
||||
end of word. Thus the space after the word isn't included. This is an
|
||||
exception that dates back to the old Vi. Since many people are used to it
|
||||
now, the inconsistency has remained in IdeaVim.
|
||||
|
||||
|
||||
MORE CHANGES
|
||||
|
||||
Like "dd" deletes a whole line, "cc" changes a whole line. It keeps the
|
||||
existing indent (leading white space) though.
|
||||
|
||||
Just like "d$" deletes until the end of the line, "c$" changes until the end
|
||||
of the line. It's like doing "d$" to delete the text and then "a" to start
|
||||
Insert mode and append new text.
|
||||
|
||||
|
||||
SHORTCUTS
|
||||
|
||||
Some operator-motion commands are used so often that they have been given a
|
||||
single letter command:
|
||||
|
||||
x stands for dl (delete character under the cursor)
|
||||
X stands for dh (delete character left of the cursor)
|
||||
D stands for d$ (delete to end of the line)
|
||||
C stands for c$ (change to end of the line)
|
||||
s stands for cl (change one character)
|
||||
S stands for cc (change a whole line)
|
||||
|
||||
|
||||
WHERE TO PUT THE COUNT
|
||||
|
||||
The commands "3dw" and "d3w" delete three words. If you want to get really
|
||||
picky about things, the first command, "3dw", deletes one word three times;
|
||||
the command "d3w" deletes three words once. This is a difference without a
|
||||
distinction. You can actually put in two counts, however. For example,
|
||||
"3d2w" deletes two words, repeated three times, for a total of six words.
|
||||
|
||||
|
||||
REPLACING WITH ONE CHARACTER
|
||||
|
||||
The "r" command is not an operator. It waits for you to type a character, and
|
||||
will replace the character under the cursor with it. You could do the same
|
||||
with "cl" or with the "s" command, but with "r" you don't have to press <Esc>
|
||||
|
||||
there is somerhing grong here ~
|
||||
rT rt rw
|
||||
|
||||
There is something wrong here ~
|
||||
|
||||
Using a count with "r" causes that many characters to be replaced with the
|
||||
same character. Example:
|
||||
|
||||
There is something wrong here ~
|
||||
5rx
|
||||
|
||||
There is something xxxxx here ~
|
||||
|
||||
To replace a character with a line break use "r<Enter>". This deletes one
|
||||
character and inserts a line break. Using a count here only applies to the
|
||||
number of characters deleted: "4r<Enter>" replaces four characters with one
|
||||
line break.
|
||||
|
||||
==============================================================================
|
||||
*04.3* Repeating a change
|
||||
|
||||
The "." command is one of the most simple yet powerful commands in IdeaVim. It
|
||||
repeats the last change. For instance, suppose you are editing an HTML file
|
||||
and want to delete all the <B> tags. You position the cursor on the first <
|
||||
and delete the <B> with the command "df>". You then go to the < of the next
|
||||
</B> and kill it using the "." command. The "." command executes the last
|
||||
change command (in this case, "df>"). To delete another tag, position the
|
||||
cursor on the < and use the "." command.
|
||||
|
||||
To <B>generate</B> a table of <B>contents ~
|
||||
f< find first < --->
|
||||
df> delete to > -->
|
||||
f< find next < --------->
|
||||
. repeat df> --->
|
||||
f< find next < ------------->
|
||||
. repeat df> -->
|
||||
|
||||
The "." command works for all changes you make, except for the "u" (undo),
|
||||
CTRL-R (redo) and commands that start with a colon (:).
|
||||
|
||||
Another example: You want to change the word "four" to "five". It appears
|
||||
several times in your text. You can do this quickly with this sequence of
|
||||
commands:
|
||||
|
||||
/four<Enter> find the first string "four"
|
||||
cwfive<Esc> change the word to "five"
|
||||
n find the next "four"
|
||||
. repeat the change to "five'
|
||||
n find the next "four"
|
||||
. repeat the change
|
||||
etc.
|
||||
|
||||
==============================================================================
|
||||
*04.4* Visual mode
|
||||
|
||||
To delete simple items the operator-motion changes work quite well. But often
|
||||
it's not so easy to decide which command will move over the text you want to
|
||||
change. Then you can use Visual mode.
|
||||
|
||||
You start Visual mode by pressing "v". You move the cursor over the text you
|
||||
want to work on. While you do this, the text is highlighted. Finally type
|
||||
the operator command.
|
||||
For example, to delete from halfway one word to halfway another word:
|
||||
|
||||
This is an examination sample of visual mode ~
|
||||
---------->
|
||||
velllld
|
||||
|
||||
This is an example of visual mode ~
|
||||
|
||||
When doing this you don't really have to count how many times you have to
|
||||
press "l" to end up in the right position. You can immediately see what text
|
||||
will be deleted when you press "d".
|
||||
|
||||
If at any time you decide you don't want to do anything with the highlighted
|
||||
text, just press <Esc> and Visual mode will stop without doing anything.
|
||||
|
||||
|
||||
SELECTING LINES
|
||||
|
||||
If you want to work on whole lines, use "V" to start Visual mode. You will
|
||||
see right away that the whole line is highlighted, without moving around.
|
||||
When you move left or right nothing changes. When you move up or down the
|
||||
selection is extended whole lines at a time.
|
||||
For example, select three lines with "Vjj":
|
||||
|
||||
+------------------------+
|
||||
| text more text |
|
||||
>> | more text more text | |
|
||||
selected lines >> | text text text | | Vjj
|
||||
>> | text more | V
|
||||
| more text more |
|
||||
+------------------------+
|
||||
|
||||
|
||||
SELECTING BLOCKS
|
||||
|
||||
If you want to work on a rectangular block of characters, use CTRL-V to start
|
||||
Visual mode. This is very useful when working on tables.
|
||||
|
||||
name Q1 Q2 Q3
|
||||
pierre 123 455 234
|
||||
john 0 90 39
|
||||
steve 392 63 334
|
||||
|
||||
To delete the middle "Q2" column, move the cursor to the "Q" of "Q2". Press
|
||||
CTRL-V to start blockwise Visual mode. Now move the cursor three lines down
|
||||
with "3j" and to the next word with "w". You can see the first character of
|
||||
the last column is included. To exclude it, use "h". Now press "d" and the
|
||||
middle column is gone.
|
||||
|
||||
|
||||
GOING TO THE OTHER SIDE
|
||||
|
||||
If you have selected some text in Visual mode, and discover that you need to
|
||||
change the other end of the selection, use the "o" command (Hint: o for other
|
||||
end). The cursor will go to the other end, and you can move the cursor to
|
||||
change where the selection starts. Pressing "o" again brings you back to the
|
||||
other end.
|
||||
|
||||
When using blockwise selection, you have four corners. "o" only takes you to
|
||||
one of the other corners, diagonally. Use "O" to move to the other corner in
|
||||
the same line.
|
||||
|
||||
Note that "o" and "O" in Visual mode work very different from Normal mode,
|
||||
where they open a new line below or above the cursor.
|
||||
|
||||
==============================================================================
|
||||
*04.5* Moving text
|
||||
|
||||
When you delete something with the "d", "x", or another command, the text is
|
||||
saved. You can paste it back by using the p command. (The IdeaVim name for
|
||||
this is put).
|
||||
Take a look at how this works. First you will delete an entire line, by
|
||||
putting the cursor on the line you want to delete and typing "dd". Now you
|
||||
move the cursor to where you want to put the line and use the "p" (put)
|
||||
command. The line is inserted on the line below the cursor.
|
||||
|
||||
a line a line a line
|
||||
line 2 dd line 3 p line 3
|
||||
line 3 line 2
|
||||
|
||||
Because you deleted an entire line, the "p" command placed the text line below
|
||||
the cursor. If you delete part of a line (a word, for instance), the "p"
|
||||
command puts it just after the cursor.
|
||||
|
||||
Some more boring try text to out commands. ~
|
||||
---->
|
||||
dw
|
||||
|
||||
Some more boring text to out commands. ~
|
||||
------->
|
||||
welp
|
||||
|
||||
Some more boring text to try out commands. ~
|
||||
|
||||
|
||||
MORE ON PUTTING
|
||||
|
||||
The "P" command puts text like "p", but before the cursor. When you deleted a
|
||||
whole line with "dd", "P" will put it back above the cursor. When you deleted
|
||||
a word with "dw", "P" will put it back just before the cursor.
|
||||
|
||||
You can repeat putting as many times as you like. The same text will be used.
|
||||
|
||||
You can use a count with "p" and "P". The text will be repeated as many times
|
||||
as specified with the count. Thus "dd" and then "3p" puts three copies of the
|
||||
same deleted line.
|
||||
|
||||
|
||||
SWAPPING TWO CHARACTERS
|
||||
|
||||
Frequently when you are typing, your fingers get ahead of your brain (or the
|
||||
other way around?). The result is a typo such as "teh" for "the". IdeaVim
|
||||
makes it easy to correct such problems. Just put the cursor on the e of "teh"
|
||||
and execute the command "xp". This works as follows: "x" deletes the
|
||||
character e and places it in a register. "p" puts the text after the cursor,
|
||||
which is after the h.
|
||||
|
||||
teh th the~
|
||||
x p
|
||||
|
||||
==============================================================================
|
||||
*04.6* Copying text
|
||||
|
||||
To copy text from one place to another, you could delete it, use "u" to undo
|
||||
the deletion and then "p" to put it somewhere else. There is an easier way:
|
||||
yanking. The "y" operator copies text into a register. Then a "p" command
|
||||
can be used to put it.
|
||||
Yanking is just a IdeaVim name for copying. The "c" letter was already used
|
||||
for the change operator, and "y" was still available. Calling this
|
||||
operator "yank" made it easier to remember to use the "y" key.
|
||||
|
||||
Since "y" is an operator, you use "yw" to yank a word. A count is possible as
|
||||
usual. To yank two workds use "y2w". Example:
|
||||
|
||||
let sqr = LongVariable * ~
|
||||
-------------->
|
||||
y2w
|
||||
|
||||
let sqr = LongVariable * ~
|
||||
p
|
||||
|
||||
let sqr = LongVariable * LongVariable ~
|
||||
|
||||
Notice that "yw" includes the white space after a word. If you don't want
|
||||
this, use "ye".
|
||||
|
||||
The "yy" command yanks a whole line, just like "dd" deletes a whole line.
|
||||
Unexpectedly, while "D" deletes from the cursor to the end of the line, "Y"
|
||||
works like "yy", it yanks the whole line. Watch out for this inconsistency!
|
||||
Use "y$" to yank to the end of the line.
|
||||
|
||||
a text line yy a text line a text line
|
||||
line 2 line 2 p line 2
|
||||
last line last line a text line
|
||||
last line
|
||||
|
||||
==============================================================================
|
||||
*04.7* Using the clipboard
|
||||
|
||||
First select some text with Visual mode, then use the
|
||||
Edit/Copy menu. The selected text is now copied to the clipboard. You can
|
||||
paste the text in other programs. In IdeaVim itself too.
|
||||
|
||||
If you have copied text to the clipboard in another application, you can paste
|
||||
it in IdeaVim with the Edit/Paste menu. This works in Normal mode and Insert
|
||||
mode. In Visual mode the selected text is replaced with the pasted text.
|
||||
|
||||
The "Cut" menu item deletes the text before it's put on the clipboard. The
|
||||
"Copy", "Cut" and "Paste" items are also available in the popup menu (only
|
||||
when there is a popup menu, of course).
|
||||
|
||||
If you are not using the GUI, or if you don't like using a menu, you have to
|
||||
use another way. You use the normal "y" (yank) and "p" (put) commands, but
|
||||
prepend "* (double-quote star) before it. To copy a line to the clipboard: >
|
||||
|
||||
"*yy
|
||||
|
||||
To put text from the clipboard back into the text: >
|
||||
|
||||
"*p
|
||||
|
||||
<!--
|
||||
This only works on versions of Vim that include clipboard support. More about
|
||||
the clipboard in section |09.3| and here: |clipboard|.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
*04.8* Text objects
|
||||
|
||||
If the cursor is in the middle of a word and want to delete that word, you
|
||||
need to move back to its start before you can do "dw". There is a simpler way
|
||||
to do this: "daw".
|
||||
|
||||
this is some example text. ~
|
||||
daw
|
||||
|
||||
this is some text. ~
|
||||
|
||||
The "d" of "daw" is the delete operator. "aw" is a text object. Hint: "aw"
|
||||
stands for "A Word". Thus "daw" is "Delete A Word". To be precise, the white
|
||||
space after the word is also deleted (the white space before the word at the
|
||||
end of the line).
|
||||
|
||||
Using text objects is the third way to make changes in IdeaVim. We already had
|
||||
operator-motion and Visual mode. Now we add operator-text object.
|
||||
It is very similar to operator-motion, but instead of operating on the text
|
||||
between the cursor position before and after a movement command, the text
|
||||
object is used as a whole. It doesn't matter where in the object the cursor
|
||||
was.
|
||||
|
||||
To change a whole sentence use "cis". Take this text:
|
||||
|
||||
Hello there. This ~
|
||||
is an example. Just ~
|
||||
some text. ~
|
||||
|
||||
Move to the start of the second line, on "is an". Now use "cis":
|
||||
|
||||
Hello there. Just ~
|
||||
some text. ~
|
||||
|
||||
The cursor is in between the blanks in the first line. Now you type the new
|
||||
sentence "Another line.":
|
||||
|
||||
Hello there. Another line. Just ~
|
||||
some text. ~
|
||||
|
||||
"cis" consists of the "c" (change) operator and the "is" text object. This
|
||||
stands for "Inner Sentence". There is also the "as" (a sentence) object. The
|
||||
difference is that "as" includes the white space after the sentence and "is"
|
||||
doesn't. If you would delete a sentence, you want to delete the white space
|
||||
at the same time, thus use "das". If you want to type new text the white
|
||||
space can remain, thus you use "cis".
|
||||
|
||||
You can also use text objects in Visual mode. It will include the text object
|
||||
in the Visual selection. Visual mode continues, thus you can do this several
|
||||
times. For example, start Visual mode with "v" and select a sentence with
|
||||
"as". Now you can repeat "as" to include more sentences. Finally you use an
|
||||
operator to do something with the selected sentences.
|
||||
|
||||
You can find a long list of text objects here: |text-objects|.
|
||||
|
||||
==============================================================================
|
||||
*04.9* Replace mode
|
||||
|
||||
The "R" command causes IdeaVim to enter replace mode. In this mode, each
|
||||
character you type replaces the one under the cursor. This continues until
|
||||
you type <Esc>.
|
||||
In this example you start Replace mode on the first "t" of "text":
|
||||
|
||||
This is text. ~
|
||||
Rinteresting.<Esc>
|
||||
|
||||
This is interesting. ~
|
||||
|
||||
You may have noticed that this command replaced 5 characters in the line with
|
||||
twelve others. The "R" command automatically extends the line if it runs out
|
||||
of characters to replace. It will not continue on the next line.
|
||||
|
||||
You can switch between Insert mode and Replace mode with the <Insert> key.
|
||||
|
||||
<!-- TODO
|
||||
When you use <BS> (backspace) to make correction, you will notice that the
|
||||
old text is put back. Thus it works like an undo command for the last typed
|
||||
character.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
*04.10* Conclusion
|
||||
|
||||
The operators, movement commands and text objects give you the possibility to
|
||||
make lots of combinations. Now that you know how it works, you can use N
|
||||
operators with M movement commands to make N * M commands!
|
||||
|
||||
You can find a list of operators here: |operator|
|
||||
|
||||
For example, there are many other ways to delete pieces of text. Here are a
|
||||
few often used ones:
|
||||
|
||||
x delete character under the cursor (short for "dl")
|
||||
X delete character before the cursor (short for "dh")
|
||||
D delete from cursor to end of line (short for "d$")
|
||||
dw delete from cursor to next start of word
|
||||
db delete from cursor to previous start of word
|
||||
diw delete word under the cursor (excluding white space)
|
||||
daw delete word under the cursor (including white space)
|
||||
dG delete until the end of the file
|
||||
dgg delete until the start of the file
|
||||
|
||||
If you use "c" instead of "d" they become change commands. And with "y" you
|
||||
yank the text. And so forth.
|
||||
|
||||
|
||||
There are a few often used commands to make changes that didn't fit somewhere
|
||||
else:
|
||||
|
||||
~ change case of the character under the cursor, and move the
|
||||
cursor to the next character. This is not an operator (unless
|
||||
'tildeop' is set), thus you can't use it with a motion
|
||||
command. It does works in Visual mode and changes case for
|
||||
all the selected text then.
|
||||
|
||||
I Start Insert mode after moving the cursor to the first
|
||||
non-blank in the line.
|
||||
|
||||
A Start Insert mode after moving the cursor to the end of the
|
||||
line.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_05.txt| Set your settings
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,651 +0,0 @@
|
||||
*usr_05.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 01
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Set your settings
|
||||
|
||||
|
||||
Vim can be tuned to work like you want it to. This chapter shows you how to
|
||||
make Vim start with options set to different values. Add plugins to extend
|
||||
Vims capabilities. Or define your own macros.
|
||||
|
||||
|05.1| The vimrc file
|
||||
|05.2| The example vimrc file explained
|
||||
|05.3| Simple mappings
|
||||
|05.4| Adding a plugin
|
||||
|05.5| Adding a help file
|
||||
|05.6| The option window
|
||||
|05.7| Often used options
|
||||
|
||||
Next chapter: |usr_06.txt| Using syntax highlighting
|
||||
Previous chapter: |usr_04.txt| Making small changes
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*05.1* The vimrc file *vimrc-intro*
|
||||
|
||||
You probably got tired of typing commands that you use very often. To start
|
||||
<!--
|
||||
with all your favorite option settings and mappings, you write them in what is
|
||||
-->
|
||||
with all your favorite option settings, you write them in what is
|
||||
called the vimrc file. IdeaVim reads this file when it starts up.
|
||||
|
||||
<!--
|
||||
If you have trouble finding your vimrc file, use this command: >
|
||||
|
||||
:scriptnames
|
||||
|
||||
One of the first files in the list should be called ".vimrc" or "_vimrc" and
|
||||
is located in your home directory.
|
||||
If you don't have a vimrc file yet, see |vimrc| to find out where you can
|
||||
create a vimrc file.
|
||||
Also, the ":version" command mentions the name of the
|
||||
"user vimrc file" Vim looks for.
|
||||
-->
|
||||
|
||||
For Unix and Mac this file is always used: >
|
||||
|
||||
~/.vimrc
|
||||
|
||||
For MS-DOS and MS-Windows it is mostly one of these: >
|
||||
|
||||
$HOME/_vimrc
|
||||
$HOME/.vimrc
|
||||
|
||||
The vimrc file can contain all the commands that you type after a colon. The
|
||||
most simple ones are for setting options. For example, if you want IdeaVim to
|
||||
always start with the 'hlsearch' option on, add this line you your vimrc
|
||||
file: >
|
||||
|
||||
set hlsearch
|
||||
|
||||
For this new line to take effect you need to exit IdeaVim and start it again.
|
||||
Later you will learn how to do this without exiting IdeaVim.
|
||||
|
||||
This chapter only explains the most basic items. For more information on how
|
||||
to write a IdeaVim script file: |usr_41.txt|.
|
||||
|
||||
==============================================================================
|
||||
*05.2* The example vimrc file explained *vimrc_example.vim*
|
||||
|
||||
<!--
|
||||
In the first chapter was explained how the example vimrc (included in the
|
||||
Vim distribution) file can be used to make Vim startup in not-compatible mode
|
||||
(see |not-compatible|). The file can be found here:
|
||||
|
||||
$VIMRUNTIME/vimrc_example.vim ~
|
||||
|
||||
-->
|
||||
In this section we will explain the various commands used in this file. This
|
||||
will give you hints about how to set up your own preferences. Not everything
|
||||
will be explained though. Use the ":help" command to find out more.
|
||||
|
||||
<!--
|
||||
>
|
||||
set nocompatible
|
||||
|
||||
As mentioned in the first chapter, these manuals explain Vim working in an
|
||||
improved way, thus not completely Vi compatible. Setting the 'compatible'
|
||||
option off, thus 'nocompatible' takes care of this.
|
||||
|
||||
>
|
||||
set backspace=indent,eol,start
|
||||
|
||||
This specifies where in Insert mode the <BS> is allowed to delete the
|
||||
character in front of the cursor. The three items, separated by commas, tell
|
||||
Vim to delete the white space at the start of the line, a line break and the
|
||||
character before where Insert mode started.
|
||||
-->
|
||||
>
|
||||
|
||||
set autoindent
|
||||
|
||||
This makes IdeaVim use the indent of the previous line for a newly created line.
|
||||
Thus there is the same amount of white space before the new line. For example
|
||||
when pressing <Enter> in Insert mode, and when using the "o" command to open a
|
||||
new line.
|
||||
<!--
|
||||
>
|
||||
|
||||
if has("vms")
|
||||
set nobackup
|
||||
else
|
||||
set backup
|
||||
endif
|
||||
|
||||
This tells Vim to keep a backup copy of a file when overwriting it. But not
|
||||
on the VMS system, since it keeps old versions of files already. The backup
|
||||
file will have the same name as the original file with "~" added. See |07.4|
|
||||
>
|
||||
-->
|
||||
|
||||
set history=50
|
||||
|
||||
Keep 50 commands and 50 search patterns in the history. Use another number if
|
||||
you want to remember fewer or more lines.
|
||||
>
|
||||
<!--
|
||||
|
||||
set ruler
|
||||
|
||||
Always display the current cursor position in the lower right corner of the
|
||||
Vim window.
|
||||
|
||||
>
|
||||
set showcmd
|
||||
|
||||
Display an incomplete command in the lower right corner of the Vim window,
|
||||
left of the ruler. For example, when you type "2f", Vim is waiting for you to
|
||||
type the character to find and "2f" is displayed. When you press "w" next,
|
||||
the "2fw" command is executed and the displayed "2f" is removed.
|
||||
|
||||
+-------------------------------------------------+
|
||||
|text in the Vim window |
|
||||
|~ |
|
||||
|~ |
|
||||
|-- VISUAL -- 2f 43,8 17% |
|
||||
+-------------------------------------------------+
|
||||
^^^^^^^^^^^ ^^^^^^^^ ^^^^^^^^^^
|
||||
'showmode' 'showcmd' 'ruler'
|
||||
|
||||
>
|
||||
set incsearch
|
||||
|
||||
Display the match for a search pattern when halfway typing it.
|
||||
|
||||
>
|
||||
map Q gq
|
||||
|
||||
This defines a key mapping. More about that in the next section. This
|
||||
defines the "Q" command to do formatting with the "gq" operator. This is how
|
||||
it worked before Vim 5.0. Otherwise the "Q" command starts Ex mode, but you
|
||||
will not need it.
|
||||
|
||||
>
|
||||
vnoremap p <Esc>:let current_reg = @"<CR>gvs<C-R>=current_reg<CR><Esc>
|
||||
|
||||
This is a complicated mapping. It will not be explained how it works here.
|
||||
What it does is to make "p" in Visual mode overwrite the selected text with
|
||||
the previously yanked text. You can see that mappings can be used to do quite
|
||||
complicated things. Still, it is just a sequence of commands that are
|
||||
executed like you typed them.
|
||||
|
||||
>
|
||||
if &t_Co > 2 || has("gui_running")
|
||||
syntax on
|
||||
set hlsearch
|
||||
endif
|
||||
|
||||
This switches on syntax highlighting, but only if colors are available. And
|
||||
the 'hlsearch' option tells Vim to highlight matches with the last used search
|
||||
pattern. The "if" command is very useful to set options only when some
|
||||
condition is met. More about that in |usr_41.txt|.
|
||||
|
||||
*vimrc-filetype* >
|
||||
filetype plugin indent on
|
||||
|
||||
This switches on three very clever mechanisms:
|
||||
1. Filetype detection.
|
||||
Whenever you start editing a file, Vim will try to figure out what kind of
|
||||
file this is. When you edit "main.c", Vim will see the ".c" extension and
|
||||
recognize this as a "c" filetype. When you edit a file that starts with
|
||||
"#!/bin/sh", Vim will recognize it as a "sh" filetype.
|
||||
The filetype detection is used for syntax highlighting and the other two
|
||||
items below.
|
||||
See |filetypes|.
|
||||
|
||||
2. Using filetype plugin files
|
||||
Many different filetypes are edited with different options. For example,
|
||||
when you edit a "c" file, it's very useful to set the 'cindent' option to
|
||||
automatically indent the lines. These commonly useful option settings are
|
||||
included with Vim in filetype plugins. You can also add your own, see
|
||||
|write-filetype-plugin|.
|
||||
|
||||
3. Using indent files
|
||||
When editing programs, the indent of a line can often be computed
|
||||
automatically. Vim comes with these indent rules for a number of
|
||||
filetypes. See |:filetype-indent-on| and 'indentexpr'.
|
||||
|
||||
>
|
||||
autocmd FileType text setlocal textwidth=78
|
||||
|
||||
This makes Vim break text to avoid lines getting longer than 78 characters.
|
||||
But only for files that have been detected to be plain text. There are
|
||||
actually two parts here. "autocmd FileType text" is an autocommand. This
|
||||
defines that when the file type is set to "text" the following command is
|
||||
automatically executed. "setlocal textwidth=78" sets the 'textwidth' option
|
||||
to 78, but only locally in one file.
|
||||
>
|
||||
|
||||
autocmd BufReadPost *
|
||||
\ if line("'\"") > 0 && line("'\"") <= line("$") |
|
||||
\ exe "normal g`\"" |
|
||||
\ endif
|
||||
|
||||
Another autocommand. This time it is used after reading any file. The
|
||||
complicated stuff after it checks if the '" mark is defined, and jumps to it
|
||||
if so. The backslash at the start of a line is used to continue the command
|
||||
from the previous line. That avoids a line getting very long.
|
||||
See |line-continuation|. This only works in a Vim script file, not when
|
||||
typing commands at the command-line.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*05.3* Simple mappings
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
A mapping enables you to bind a set of Vim commands to a single key. Suppose,
|
||||
for example, that you need to surround certain words with curly braces. In
|
||||
other words, you need to change a word such as "amount" into "{amount}". With
|
||||
the :map command, you can tell Vim that the F5 key does this job. The command
|
||||
is as follows: >
|
||||
|
||||
:map <F5> i{<Esc>ea}<Esc>
|
||||
<
|
||||
Note:
|
||||
When entering this command, you must enter <F5> by typing four
|
||||
characters. Similarly, <Esc> is not entered by pressing the <Esc>
|
||||
key, but by typing five characters. Watch out for this difference
|
||||
when reading the manual!
|
||||
|
||||
Let's break this down:
|
||||
<F5> The F5 function key. This is the trigger key that causes the
|
||||
command to be executed as the key is pressed.
|
||||
|
||||
i{<Esc> Insert the { character. The <Esc> key ends Insert mode.
|
||||
|
||||
e Move to the end of the word.
|
||||
|
||||
a}<Esc> Append the } to the word.
|
||||
|
||||
After you execute the ":map" command, all you have to do to put {} around a
|
||||
word is to put the cursor on the first character and press F5.
|
||||
|
||||
In this example, the trigger is a single key; it can be any string. But when
|
||||
you use an existing Vim command, that command will no longer be available.
|
||||
You better avoid that.
|
||||
One key that can be used with mappings is the backslash. Since you
|
||||
probably want to define more than one mapping, add another character. You
|
||||
could map "\p" to add parens around a word, and "\c" to add curly braces, for
|
||||
example: >
|
||||
|
||||
:map \p i(<Esc>ea)<Esc>
|
||||
:map \c i{<Esc>ea}<Esc>
|
||||
|
||||
You need to type the \ and the p quickly after another, so that Vim knows they
|
||||
belong together.
|
||||
|
||||
The ":map" command (with no arguments) lists your current mappings. At
|
||||
least the ones for Normal mode. More about mappings in section |40.1|.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*05.4* Adding a plugin *add-plugin* *plugin*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Vim's functionality can be extended by adding plugins. A plugin is nothing
|
||||
more than a Vim script file that is loaded automatically when Vim starts. You
|
||||
can add a plugin very easily by dropping it in your plugin directory.
|
||||
{not available when Vim was compiled without the |+eval| feature}
|
||||
|
||||
There are two types of plugins:
|
||||
|
||||
global plugin: Used for all kinds of files
|
||||
filetype plugin: Only used for a specific type of file
|
||||
|
||||
The global plugins will be discussed first, then the filetype ones
|
||||
|add-filetype-plugin|.
|
||||
|
||||
|
||||
GLOBAL PLUGINS *standard-plugin*
|
||||
|
||||
When you start Vim, it will automatically load a number of global plugins.
|
||||
You don't have to do anything for this. They add functionality that most
|
||||
people will want to use, but which was implemented as a Vim script instead of
|
||||
being compiled into Vim. You can find them listed in the help index
|
||||
|standard-plugin-list|. Also see |load-plugins|.
|
||||
|
||||
*add-global-plugin*
|
||||
You can add a global plugin to add functionality that will always be present
|
||||
when you use Vim. There are only two steps for adding a global plugin:
|
||||
1. Get a copy of the plugin.
|
||||
2. Drop it in the right directory.
|
||||
|
||||
|
||||
GETTING A GLOBAL PLUGIN
|
||||
|
||||
Where can you find plugins?
|
||||
- Some come with Vim. You can find them in the directory $VIMRUNTIME/macros
|
||||
and its sub-directories.
|
||||
- Download from the net, check out http://vim.sf.net.
|
||||
- They are sometimes posted in a Vim |maillist|.
|
||||
- You could write one yourself, see |write-plugin|.
|
||||
|
||||
|
||||
USING A GLOBAL PLUGIN
|
||||
|
||||
First read the text in the plugin itself to check for any special conditions.
|
||||
Then copy the file to your plugin directory:
|
||||
|
||||
system plugin directory ~
|
||||
Unix ~/.vim/plugin/
|
||||
PC and OS/2 $HOME/vimfiles/plugin or $VIM/vimfiles/plugin
|
||||
Amiga s:vimfiles/plugin
|
||||
Macintosh $VIM:vimfiles:plugin
|
||||
Mac OS X ~/.vim/plugin/
|
||||
RISC-OS Choices:vimfiles.plugin
|
||||
|
||||
Example for Unix (assuming you didn't have a plugin directory yet): >
|
||||
|
||||
mkdir ~/.vim
|
||||
mkdir ~/.vim/plugin
|
||||
cp /usr/local/share/vim/vim60/macros/justify.vim ~/.vim/plugin
|
||||
|
||||
That's all! Now you can use the commands defined in this plugin to justify
|
||||
text.
|
||||
|
||||
|
||||
FILETYPE PLUGINS *add-filetype-plugin* *ftplugins*
|
||||
|
||||
The Vim distribution comes with a set of plugins for different filetypes that
|
||||
you can start using with this command: >
|
||||
|
||||
:filetype plugin on
|
||||
|
||||
That's all! See |vimrc-filetype|.
|
||||
|
||||
If you are missing a plugin for a filetype you are using, or you found a
|
||||
better one, you can add it. There are two steps for adding a filetype plugin:
|
||||
1. Get a copy of the plugin.
|
||||
2. Drop it in the right directory.
|
||||
|
||||
|
||||
GETTING A FILETYPE PLUGIN
|
||||
|
||||
You can find them in the same places as the global plugins. Watch out if the
|
||||
type of file is mentioned, then you know if the plugin is a global or a
|
||||
filetype one. The scripts in $VIMRUNTIME/macros are global ones, the filetype
|
||||
plugins are in $VIMRUNTIME/ftplugin.
|
||||
|
||||
|
||||
USING A FILETYPE PLUGIN *ftplugin-name*
|
||||
|
||||
You can add a filetype plugin by dropping it in the right directory. The
|
||||
name of this directory is in the same directory mentioned above for global
|
||||
plugins, but the last part is "ftplugin". Suppose you have found a plugin for
|
||||
the "stuff" filetype, and you are on Unix. Then you can move this file to the
|
||||
ftplugin directory: >
|
||||
|
||||
mv thefile ~/.vim/ftplugin/stuff.vim
|
||||
|
||||
If that file already exists you already have a plugin for "stuff". You might
|
||||
want to check if the existing plugin doesn't conflict with the one you are
|
||||
adding. If it's OK, you can give the new one another name: >
|
||||
|
||||
mv thefile ~/.vim/ftplugin/stuff_too.vim
|
||||
|
||||
The underscore is used to separate the name of the filetype from the rest,
|
||||
which can be anything. If you would use "otherstuff.vim" it wouldn't work, it
|
||||
would be loaded for the "otherstuff" filetype.
|
||||
|
||||
On MS-DOS you cannot use long filenames. You would run into trouble if you
|
||||
add a second plugin and the filetype has more than six characters. You can
|
||||
use an extra directory to get around this: >
|
||||
|
||||
mkdir $VIM/vimfiles/ftplugin/fortran
|
||||
copy thefile $VIM/vimfiles/ftplugin/fortran/too.vim
|
||||
|
||||
The generic names for the filetype plugins are: >
|
||||
|
||||
ftplugin/<filetype>.vim
|
||||
ftplugin/<filetype>_<name>.vim
|
||||
ftplugin/<filetype>/<name>.vim
|
||||
|
||||
Here "<name>" can be any name that you prefer.
|
||||
Examples for the "stuff" filetype on Unix: >
|
||||
|
||||
~/.vim/ftplugin/stuff.vim
|
||||
~/.vim/ftplugin/stuff_def.vim
|
||||
~/.vim/ftplugin/stuff/header.vim
|
||||
|
||||
The <filetype> part is the name of the filetype the plugin is to be used for.
|
||||
Only files of this filetype will use the settings from the plugin. The <name>
|
||||
part of the plugin file doesn't matter, you can use it to have several plugins
|
||||
for the same filetype. Note that it must end in ".vim".
|
||||
|
||||
|
||||
Further reading:
|
||||
|filetype-plugins| Documentation for the filetype plugins and information
|
||||
about how to avoid that mappings cause problems.
|
||||
|load-plugins| When the global plugins are loaded during startup.
|
||||
|ftplugin-overrule| Overruling the settings from a global plugin.
|
||||
|write-plugin| How to write a plugin script.
|
||||
|plugin-details| For more information about using plugins or when your
|
||||
plugin doesn't work.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*05.5* Adding a help file *add-local-help* *matchit-install*
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
If you are lucky, the plugin you installed also comes with a help file. We
|
||||
will explain how to install the help file, so that you can easily find help
|
||||
for your new plugin.
|
||||
Let us use the "matchit.vim" plugin as an example (it is included with
|
||||
Vim). This plugin makes the "%" command jump to matching HTML tags,
|
||||
if/else/endif in Vim scripts, etc. Very useful, although it's not backwards
|
||||
compatible (that's why it is not enabled by default).
|
||||
This plugin comes with documentation: "matchit.txt". Let's first copy the
|
||||
plugin to the right directory. This time we will do it from inside Vim, so
|
||||
that we can use $VIMRUNTIME. (You may skip some of the "mkdir" commands if
|
||||
you already have the directory.) >
|
||||
|
||||
:!mkdir ~/.vim
|
||||
:!mkdir ~/.vim/plugin
|
||||
:!cp $VIMRUNTIME/macros/matchit.vim ~/.vim/plugin
|
||||
|
||||
Now create a "doc" directory in one of the directories in 'runtimepath'. >
|
||||
|
||||
:!mkdir ~/.vim/doc
|
||||
|
||||
Copy the help file to the "doc" directory. >
|
||||
|
||||
:!cp $VIMRUNTIME/macros/matchit.txt ~/.vim/doc
|
||||
|
||||
Now comes the trick, which allows you to jump to the subjects in the new help
|
||||
file: Generate the local tags file with the |:helptags| command. >
|
||||
|
||||
:helptags ~/.vim/doc
|
||||
|
||||
Now you can use the >
|
||||
|
||||
:help g%
|
||||
|
||||
command to find help for "g%" in the help file you just added. You can see an
|
||||
entry for the local help file when you do: >
|
||||
|
||||
:help local-additions
|
||||
|
||||
The title lines from the local help files are automagically added to this
|
||||
section. There you can see which local help files have been added and jump to
|
||||
them through the tag.
|
||||
|
||||
For writing a local help file, see |write-local-help|.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*05.6* The option window
|
||||
|
||||
If you are looking for an option that does what you want, you can search in
|
||||
the help files here: |options|.
|
||||
<!--
|
||||
Another way is by using this command: >
|
||||
|
||||
:options
|
||||
|
||||
This opens a new window, with a list of options with a one-line explanation.
|
||||
The options are grouped by subject. Move the cursor to a subject and press
|
||||
<Enter> to jump there. Press <Enter> again to jump back. Or use CTRL-O.
|
||||
|
||||
You can change the value of an option. For example, move to the "displaying
|
||||
text" subject. Then move the cursor down to this line: >
|
||||
|
||||
set wrap nowrap
|
||||
|
||||
When you hit <Enter>, the line will change to: >
|
||||
|
||||
set nowrap wrap
|
||||
|
||||
The option has now been switched off.
|
||||
|
||||
Just above this line is a short description of the 'wrap' option. Move the
|
||||
cursor one line up to place it in this line. Now hit <Enter> and you jump to
|
||||
the full help on the 'wrap' option.
|
||||
|
||||
For options that take a number or string argument you can edit the value.
|
||||
Then press <Enter> to apply the new value. For example, move the cursor a few
|
||||
lines up to this line: >
|
||||
|
||||
set so=0
|
||||
|
||||
Position the cursor on the zero with "$". Change it into a five with "r5".
|
||||
Then press <Enter> to apply the new value. When you now move the cursor
|
||||
around you will notice that the text starts scrolling before you reach the
|
||||
border. This is what the 'scrolloff' option does, it specifies an offset
|
||||
from the window border where scrolling starts.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*05.7* Often used options
|
||||
|
||||
There are an awful lot of options. Most of them you will hardly ever use.
|
||||
Some of the more useful ones will be mentioned here. Don't forget you can
|
||||
find more help on these options with the ":help" command, with single quotes
|
||||
before and after the option name. For example: >
|
||||
|
||||
:help 'wrap'
|
||||
|
||||
In case you have messed up an option value, you can set it back to the
|
||||
default by putting a ampersand (&) after the option name. Example: >
|
||||
|
||||
:set smartcase&
|
||||
|
||||
|
||||
<!--
|
||||
NOT WRAPPING LINES
|
||||
|
||||
IdeaVim normally wraps long lines, so that you can see all of the text. Sometimes
|
||||
it's better to let the text continue right of the window. Then you need to
|
||||
scroll the text left-right to see all of a long line. Switch wrapping of with
|
||||
this command: >
|
||||
|
||||
:set nowrap
|
||||
|
||||
-->
|
||||
IdeaVim will automatically scroll the text when you move to text that is not
|
||||
displayed. To see a context of ten characters, do this: >
|
||||
|
||||
:set sidescroll=10
|
||||
|
||||
This doesn't change the text in the file, only the way it is displayed.
|
||||
|
||||
|
||||
<!--
|
||||
WRAPPING MOVEMENT COMMANDS
|
||||
|
||||
Most commands for moving around will stop moving at the start and end of a
|
||||
line. You can change that with the 'whichwrap' option. This sets it to the
|
||||
default value: >
|
||||
|
||||
:set whichwrap=b,s
|
||||
|
||||
This allows the <BS> key, when used in the first position of a line, to move
|
||||
the cursor to the end of the previous line. And the <Space> key moves from
|
||||
the end of a line to the start of the next one.
|
||||
|
||||
To allow the cursor keys <Left> and <Right> to also wrap, use this command: >
|
||||
|
||||
:set whichwrap=b,s,<,>
|
||||
|
||||
This is still only for Normal mode. To let <Left> and <Right> do this in
|
||||
Insert mode as well: >
|
||||
|
||||
:set whichwrap=b,s,<,>,[,]
|
||||
|
||||
There are a few other flags that can be added, see 'whichwrap'.
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
VIEWING TABS
|
||||
|
||||
When there are tabs in a file, you cannot see where they are. To make them
|
||||
visible: >
|
||||
|
||||
:set list
|
||||
|
||||
Now every Tab is displayed as ^I. And a $ is displayed at the end of each
|
||||
line, so that you can spot trailing spaces that would otherwise go unnoticed.
|
||||
A disadvantage is that this looks ugly when there are many Tabs in a file.
|
||||
If you have a color terminal, or are using the GUI, Vim can show the spaces
|
||||
and tabs as highlighted characters. Use the 'listchars' option: >
|
||||
|
||||
:set listchars=tab:>-,trail:-
|
||||
|
||||
Now every tab will be displayed as ">---" and trailing white space as "-".
|
||||
Looks a lot better, doesn't it?
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
KEYWORDS
|
||||
|
||||
The 'iskeyword' option specifies which characters can appear in a word: >
|
||||
|
||||
:set iskeyword
|
||||
< iskeyword=@,48-57,_,192-255
|
||||
|
||||
The "@" stands for all alphabetic letters. "48-57" stands for ASCII
|
||||
characters 48 to 57, which are the numbers 0 to 9. "192-255" are the
|
||||
printable latin characters.
|
||||
Sometimes you will want to include a dash in keywords, so that commands
|
||||
like "w" consider "upper-case" to be one word. You can do it like this: >
|
||||
|
||||
:set iskeyword+=-
|
||||
:set iskeyword
|
||||
< iskeyword=@,48-57,_,192-255,-
|
||||
|
||||
If you look at the new value, you will see that Vim has added a comma for you.
|
||||
To remove a character use "-=". For example, to remove the underscore: >
|
||||
|
||||
:set iskeyword-=_
|
||||
:set iskeyword
|
||||
< iskeyword=@,48-57,192-255,-
|
||||
|
||||
This time a comma is automatically deleted.
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
ROOM FOR MESSAGES
|
||||
|
||||
When Vim starts there is one line at the bottom that is used for messages.
|
||||
When a message is long, it is either truncated, thus you can only see part of
|
||||
it, or the text scrolls and you have to press <Enter> to continue.
|
||||
You can set the 'cmdheight' option to the number of lines used for
|
||||
messages. Example: >
|
||||
|
||||
:set cmdheight=3
|
||||
|
||||
This does mean there is less room to edit text, thus it's a compromise.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_06.txt| Using syntax highlighting
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,280 +0,0 @@
|
||||
*usr_06.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Using syntax highlighting
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Black and white text is boring. With colors your file comes to life. This
|
||||
not only looks nice, it also speeds up your work. Change the colors used for
|
||||
the different sorts of text. Print your text, with the colors you see on the
|
||||
screen.
|
||||
|
||||
|06.1| Switching it on
|
||||
|06.2| No or wrong colors?
|
||||
|06.3| Different colors
|
||||
|06.4| With colors or without colors
|
||||
|06.5| Printing with colors
|
||||
|06.6| Further reading
|
||||
|
||||
Next chapter: |usr_07.txt| Editing more than one file
|
||||
Previous chapter: |usr_05.txt| Set your settings
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*06.1* Switching it on
|
||||
|
||||
It all starts with one simple command: >
|
||||
|
||||
:syntax enable
|
||||
|
||||
That should work in most situations to get color in your files. Vim will
|
||||
automagically detect the type of file and load the right syntax highlighting.
|
||||
Suddenly comments are blue, keywords brown and strings red. This makes it
|
||||
easy to overview the file. After a while you will find that black&white text
|
||||
slows you down!
|
||||
|
||||
If you always want to use syntax highlighting, put the ":syntax enable"
|
||||
command in your |vimrc| file.
|
||||
|
||||
If you want syntax highlighting only when the terminal supports colors, you
|
||||
can put this in your |vimrc| file: >
|
||||
|
||||
if &t_Co > 1
|
||||
syntax enable
|
||||
endif
|
||||
|
||||
If you want syntax highlighting only in the GUI version, put the ":syntax
|
||||
enable" command in your |gvimrc| file.
|
||||
|
||||
==============================================================================
|
||||
*06.2* No or wrong colors?
|
||||
|
||||
There can be a number of reasons why you don't see colors:
|
||||
|
||||
- Your terminal does not support colors.
|
||||
Vim will use bold, italic and underlined text, but this doesn't look
|
||||
very nice. You probably will want to try to get a terminal with
|
||||
colors. For Unix, I recommend the xterm from the XFree86 project:
|
||||
|xfree-xterm|.
|
||||
|
||||
- Your terminal does support colors, but Vim doesn't know this.
|
||||
Make sure your $TERM setting is correct. For example, when using an
|
||||
xterm that supports colors: >
|
||||
|
||||
setenv TERM xterm-color
|
||||
<
|
||||
or (depending on your shell): >
|
||||
|
||||
TERM=xterm-color; export TERM
|
||||
|
||||
< The terminal name must match the terminal you are using. If it
|
||||
still doesn't work, have a look at |xterm-color|, which shows a few
|
||||
ways to make Vim display colors (not only for an xterm).
|
||||
|
||||
- The file type is not recognized.
|
||||
Vim doesn't know all file types, and sometimes it's near to impossible
|
||||
to tell what language a file uses. Try this command: >
|
||||
|
||||
:set filetype
|
||||
<
|
||||
If the result is "filetype=" then the problem is indeed that Vim
|
||||
doesn't know what type of file this is. You can set the type
|
||||
manually: >
|
||||
|
||||
:set filetype=fortran
|
||||
|
||||
< To see which types are available, look in the directory
|
||||
$VIMRUNTIME/syntax. For the GUI you can use the Syntax menu.
|
||||
Setting the filetype can also be done with a |modeline|, so that the
|
||||
file will be highlighted each time you edit it. For example, this
|
||||
line can be used in a Makefile (put it near the start or end of the
|
||||
file): >
|
||||
|
||||
# vim: syntax=make
|
||||
|
||||
< You might know how to detect the file type yourself. Often the file
|
||||
name extension (after the dot) can be used.
|
||||
See |new-filetype| for how to tell Vim to detect that file type.
|
||||
|
||||
- There is no highlighting for your file type.
|
||||
You could try using a similar file type by manually setting it as
|
||||
mentioned above. If that isn't good enough, you can write your own
|
||||
syntax file, see |mysyntaxfile|.
|
||||
|
||||
|
||||
Or the colors could be wrong:
|
||||
|
||||
- The colored text is very hard to read.
|
||||
Vim guesses the background color that you are using. If it is black
|
||||
(or another dark color) it will use light colors for text. If it is
|
||||
white (or another light color) it will use dark colors for text. If
|
||||
Vim guessed wrong the text will be hard to read. To solve this, set
|
||||
the 'background' option. For a dark background: >
|
||||
|
||||
:set background=dark
|
||||
|
||||
< And for a light background: >
|
||||
|
||||
:set background=light
|
||||
|
||||
< Make sure you put this _before_ the ":syntax enable" command,
|
||||
otherwise the colors will already have been set. You could do
|
||||
":syntax reset" after setting 'background' to make Vim set the default
|
||||
colors again.
|
||||
|
||||
- The colors are wrong when scrolling bottom to top.
|
||||
Vim doesn't read the whole file to parse the text. It starts parsing
|
||||
wherever you are viewing the file. That saves a lot of time, but
|
||||
sometimes the colors are wrong. A simple fix is hitting CTRL-L. Or
|
||||
scroll back a bit and then forward again.
|
||||
For a real fix, see |:syn-sync|. Some syntax files have a way to make
|
||||
it look further back, see the help for the specific syntax file. For
|
||||
example, |tex.vim| for the TeX syntax.
|
||||
|
||||
==============================================================================
|
||||
*06.3* Different colors *:syn-default-override*
|
||||
|
||||
If you don't like the default colors, you can select another color scheme. In
|
||||
the GUI use the Edit/Color Scheme menu. You can also type the command: >
|
||||
|
||||
:colorscheme evening
|
||||
|
||||
"evening" is the name of the color scheme. There are several others you might
|
||||
want to try out. Look in the directory $VIMRUNTIME/colors.
|
||||
|
||||
When you found the color scheme that you like, add the ":colorscheme" command
|
||||
to your |vimrc| file.
|
||||
|
||||
You could also write your own color scheme. This is how you do it:
|
||||
|
||||
1. Select a color scheme that comes close. Copy this file to your own Vim
|
||||
directory. For Unix, this should work: >
|
||||
|
||||
!mkdir ~/.vim/colors
|
||||
!cp $VIMRUNTIME/colors/morning.vim ~/.vim/colors/mine.vim
|
||||
<
|
||||
This is done from Vim, because it knows the value of $VIMRUNTIME.
|
||||
|
||||
2. Edit the color scheme file. These entries are useful:
|
||||
|
||||
term attributes in a B&W terminal
|
||||
cterm attributes in a color terminal
|
||||
ctermfg foreground color in a color terminal
|
||||
ctermbg background color in a color terminal
|
||||
gui attributes in the GUI
|
||||
guifg foreground color in the GUI
|
||||
guibg background color in the GUI
|
||||
|
||||
For example, to make comments green: >
|
||||
|
||||
:highlight Comment ctermfg=green guifg=green
|
||||
<
|
||||
Attributes you can use for "cterm" and "gui" are "bold" and "underline".
|
||||
If you want both, use "bold,underline". For details see the |:highlight|
|
||||
command.
|
||||
|
||||
3. Tell Vim to always use your color scheme. Put this line in your |vimrc|: >
|
||||
|
||||
colorscheme mine
|
||||
|
||||
If you want to see what the most often used color combinations look like, use
|
||||
these commands: >
|
||||
|
||||
:edit $VIMRUNTIME/syntax/colortest.vim
|
||||
:source %
|
||||
|
||||
You will see text in various color combinations. You can check which ones are
|
||||
readable and look nice.
|
||||
|
||||
==============================================================================
|
||||
*06.4* With colors or without colors
|
||||
|
||||
Displaying text in color takes a lot of effort. If you find the displaying
|
||||
too slow, you might want to disable syntax highlighting for a moment: >
|
||||
|
||||
:syntax clear
|
||||
|
||||
When editing another file (or the same one) the colors will come back.
|
||||
|
||||
*:syn-off*
|
||||
If you want to stop highlighting completely use: >
|
||||
|
||||
:syntax off
|
||||
|
||||
This will completely disable syntax highlighting and remove it immediately for
|
||||
all buffers.
|
||||
|
||||
*:syn-manual*
|
||||
If you want syntax highlighting only for specific files, use this: >
|
||||
|
||||
:syntax manual
|
||||
|
||||
This will enable the syntax highlighting, but not switch it on automatically
|
||||
when starting to edit a buffer. To switch highlighting on for the current
|
||||
buffer, set the 'syntax' option: >
|
||||
|
||||
:set syntax=ON
|
||||
<
|
||||
==============================================================================
|
||||
*06.5* Printing with colors *syntax-printing*
|
||||
|
||||
In the MS-Windows version you can print the current file with this command: >
|
||||
|
||||
:hardcopy
|
||||
|
||||
You will get the usual printer dialog, where you can select the printer and a
|
||||
few settings. If you have a color printer, the paper output should look the
|
||||
same as what you see inside Vim. But when you use a dark background the
|
||||
colors will be adjusted to look good on white paper.
|
||||
|
||||
There are several options that change the way Vim prints:
|
||||
'printdevice'
|
||||
'printheader'
|
||||
'printfont'
|
||||
'printoptions'
|
||||
|
||||
To print only a range of lines, use Visual mode to select the lines and then
|
||||
type the command: >
|
||||
|
||||
v100j:hardcopy
|
||||
|
||||
"v" starts Visual mode. "100j" moves a hundred lines down, they will be
|
||||
highlighted. Then ":hardcopy" will print those lines. You can use other
|
||||
commands to move in Visual mode, of course.
|
||||
|
||||
This also works on Unix, if you have a PostScript printer. Otherwise, you
|
||||
will have to do a bit more work. You need to convert the text to HTML first,
|
||||
and then print it from a web browser such as Netscape.
|
||||
|
||||
Convert the current file to HTML with this command: >
|
||||
|
||||
:source $VIMRUNTIME/syntax/2html.vim
|
||||
|
||||
You will see it crunching away, this can take quite a while for a large file.
|
||||
Some time later another window shows the HTML code. Now write this somewhere
|
||||
(doesn't matter where, you throw it away later):
|
||||
>
|
||||
:write main.c.html
|
||||
|
||||
Open this file in your favorite browser and print it from there. If all goes
|
||||
well, the output should look exactly as it does in Vim. See |2html.vim| for
|
||||
details. Don't forget to delete the HTML file when you are done with it.
|
||||
|
||||
Instead of printing, you could also put the HTML file on a web server, and let
|
||||
others look at the colored text.
|
||||
|
||||
==============================================================================
|
||||
*06.6* Further reading
|
||||
|
||||
|usr_44.txt| Your own syntax highlighted.
|
||||
|syntax| All the details.
|
||||
|
||||
==============================================================================
|
||||
-->
|
||||
|
||||
Next chapter: |usr_07.txt| Editing more than one file
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,515 +0,0 @@
|
||||
*usr_07.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 29
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Editing more than one file
|
||||
|
||||
|
||||
No matter how many files you have, you can edit them without leaving IdeaVim.
|
||||
Define a list of files to work on and jump from one to the other. Copy text
|
||||
from one file and put it in another one.
|
||||
|
||||
|07.1| Edit another file
|
||||
|07.2| A list of files
|
||||
|07.3| Jumping from file to file
|
||||
|07.4| Backup files
|
||||
|07.5| Copy text between files
|
||||
|07.6| Viewing a file
|
||||
|07.7| Changing the file name
|
||||
|
||||
Next chapter: |usr_08.txt| Splitting windows
|
||||
Previous chapter: |usr_06.txt| Using syntax highlighting
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*07.1* Edit another file
|
||||
|
||||
<!--
|
||||
So far you had to start Vim for every file you wanted to edit. There is a
|
||||
simpler way.
|
||||
-->
|
||||
To start editing another file, use this command: >
|
||||
|
||||
:edit foo.txt
|
||||
|
||||
IdeaVim will locate the file within the current project and open it in
|
||||
another editor or select the editor if already open.
|
||||
<!--
|
||||
TODO - add new info when add support for files outside project.
|
||||
-->
|
||||
<!--
|
||||
You can use any file name instead of "foo.txt". Vim will close the current
|
||||
file and open the new one. If the current file has unsaved changes, however,
|
||||
Vim displays an error message and does not open the new file:
|
||||
|
||||
E37: No write since last change (use ! to override) ~
|
||||
|
||||
Note:
|
||||
Vim puts an error ID at the start of each error message. If you do
|
||||
not understand the message or what caused it, look in the help system
|
||||
for this ID. In this case: >
|
||||
|
||||
:help E37
|
||||
|
||||
At this point, you have a number of alternatives. You can write the file
|
||||
using this command: >
|
||||
|
||||
:write
|
||||
|
||||
Or you can force Vim to discard your changes and edit the new file, using the
|
||||
force (!) character: >
|
||||
|
||||
:edit! foo.txt
|
||||
|
||||
If you want to edit another file, but not write the changes in the current
|
||||
file yet, you can make it hidden: >
|
||||
|
||||
:hide edit foo.txt
|
||||
|
||||
The text with changes is still there, but you can't see it. This is further
|
||||
explained in section |22.4|: The buffer list.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*07.2* A list of files
|
||||
|
||||
<!--
|
||||
You can start Vim to edit a sequence of files. For example: >
|
||||
|
||||
vim one.c two.c three.c
|
||||
|
||||
This command starts Vim and tells it that you will be editing three files.
|
||||
Vim displays just the first file. After you have done your thing in this
|
||||
file, to edit the next file you use this command: >
|
||||
-->
|
||||
To select the next editor in IDE you use this coomand: >
|
||||
|
||||
:next
|
||||
|
||||
<!--
|
||||
If you have unsaved changes in the current file, you will get an error
|
||||
message and the ":next" will not work. This is the same problem as with
|
||||
":edit" mentioned in the previous section. To abandon the changes: >
|
||||
|
||||
:next!
|
||||
|
||||
But mostly you want to save the changes and move on to the next file. There
|
||||
is a special command for this: >
|
||||
|
||||
:wnext
|
||||
|
||||
This does the same as using two separate commands: >
|
||||
|
||||
:write
|
||||
:next
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
WHERE AM I?
|
||||
|
||||
To see which file in the argument list you are editing, look in the window
|
||||
title. It should show something like "(2 of 3)". This means you are editing
|
||||
the second file out of three files.
|
||||
If you want to see the list of files, use this command: >
|
||||
|
||||
:args
|
||||
|
||||
This is short for "arguments". The output might look like this: >
|
||||
|
||||
one.c [two.c] three.c
|
||||
|
||||
These are the files you started Vim with. The one you are currently editing,
|
||||
"two.c", is in square brackets.
|
||||
|
||||
|
||||
-->
|
||||
MOVING TO OTHER ARGUMENTS
|
||||
|
||||
To go back one file: >
|
||||
|
||||
:previous
|
||||
|
||||
This is just like the ":next" command, except that it moves in the other
|
||||
direction. Again, there is a shortcut command for when you want to write the
|
||||
file first: >
|
||||
|
||||
:wprevious
|
||||
|
||||
To move to the very last file in the list: >
|
||||
|
||||
:last
|
||||
|
||||
And to move back to the first one again: >
|
||||
|
||||
:first
|
||||
|
||||
There is no ":wlast" or ":wfirst" command though!
|
||||
|
||||
You can use a count for ":next" and ":previous". To skip two files forward: >
|
||||
|
||||
:2next
|
||||
|
||||
|
||||
<!--
|
||||
AUTOMATIC WRITING
|
||||
|
||||
When moving around the files and making changes, you have to remember to use
|
||||
":write". Otherwise you will get an error message. If you are sure you
|
||||
always want to write modified files, you can tell Vim to automatically write
|
||||
them: >
|
||||
|
||||
:set autowrite
|
||||
|
||||
When you are editing a file which you may not want to write, switch it off
|
||||
again: >
|
||||
|
||||
:set noautowrite
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
EDITING ANOTHER LIST OF FILES
|
||||
|
||||
You can redefine the list of files without the need to exit Vim and start it
|
||||
again. Use this command to edit three other files: >
|
||||
|
||||
:args five.c six.c seven.h
|
||||
|
||||
Or use a wildcard, like it's used in the shell: >
|
||||
|
||||
:args *.txt
|
||||
|
||||
Vim will take you to the first file in the list. Again, if the current file
|
||||
has changes, you can either write the file first, or use ":args!" (with !
|
||||
added) to abandon the changes.
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
DID YOU EDIT THE LAST FILE?
|
||||
*arglist-quit*
|
||||
When you use a list of files, Vim assumes you want to edit them all. To
|
||||
protect you from exiting too early, you will get this error when you didn't
|
||||
edit the last file in the list yet: >
|
||||
|
||||
E173: 46 more files to edit
|
||||
|
||||
If you really want to exit, just do it again. Then it will work (but not when
|
||||
you did other commands in between).
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*07.3* Jumping from file to file
|
||||
|
||||
To quickly jump between two files, press CTRL-^ (on English-US keyboards the ^
|
||||
is above the 6 key). Example: >
|
||||
|
||||
:args one.c two.c three.c
|
||||
|
||||
You are now in one.c. >
|
||||
|
||||
:next
|
||||
|
||||
Now you are in two.c. Now use CTRL-^ to go back to one.c. Another CTRL-^ and
|
||||
you are back in two.c. Another CTRL-^ and you are in one.c again. If you now
|
||||
do: >
|
||||
|
||||
:next
|
||||
|
||||
You are in three.c. Notice that the CTRL-^ command does not change the idea
|
||||
of where you are in the list of files. Only commands like ":next" and
|
||||
":previous" do that.
|
||||
|
||||
The file you were previously editing is called the "alternate" file. When you
|
||||
just started Vim CTRL-^ will not work, since there isn't a previous file.
|
||||
|
||||
|
||||
<!--
|
||||
PREDEFINED MARKS
|
||||
|
||||
After jumping to another file, you can use two predefined marks which are very
|
||||
useful: >
|
||||
|
||||
`"
|
||||
|
||||
This takes you to the position where the cursor was when you left the file.
|
||||
Another mark that is remembered is the position where you made the last
|
||||
change: >
|
||||
|
||||
`.
|
||||
|
||||
Suppose you are editing the file "one.txt". Somewhere halfway the file you
|
||||
use "x" to delete a character. Then you go to the last line with "G" and
|
||||
write the file with ":w". You edit several other files, and then use ":edit
|
||||
one.txt" to come back to "one.txt". If you now use `" Vim jumps to the last
|
||||
line of the file. Using `. takes you to the position where you deleted the
|
||||
character. Even when you move around in the file `" and `. will take you to
|
||||
the remembered position. At least until you make another change or leave the
|
||||
file.
|
||||
|
||||
|
||||
-->
|
||||
FILE MARKS
|
||||
|
||||
In chapter 4 was explained how you can place a mark in a file with "mx" and
|
||||
jump to that position with "`x". That works within one file. If you edit
|
||||
another file and place marks there, these are specific for that file. Thus
|
||||
each file has its own set of marks, they are local to the file.
|
||||
So far we were using marks with a lowercase letter. There are also marks
|
||||
with an uppercase letter. These are global, they can be used from any file.
|
||||
For example suppose that we are editing the file "foo.txt". Go to halfway the
|
||||
file ("50%") and place the F mark there (F for foo): >
|
||||
|
||||
50%mF
|
||||
|
||||
Now edit the file "bar.txt" and place the B mark (B for bar) at its last line:
|
||||
>
|
||||
GmB
|
||||
|
||||
Now you can use the "'F" command to jump back to halfway foo.txt. Or edit yet
|
||||
another file, type "'B" and you are at the end of bar.txt again.
|
||||
|
||||
The file marks are remembered until they are placed somewhere else. Thus you
|
||||
can place the mark, do hours of editing and still be able to jump back to that
|
||||
mark.
|
||||
It's often useful to think of a simple connection between the mark letter
|
||||
and where it is placed. For example, use the H mark in a header file, M in
|
||||
a Makefile and C in a C code file.
|
||||
|
||||
To see where a specific mark is, give an argument to the ":marks" command: >
|
||||
|
||||
:marks M
|
||||
|
||||
You can also give several arguments: >
|
||||
|
||||
:marks MCP
|
||||
|
||||
Don't forget that you can use CTRL-O and CTRL-I to jump to older and newer
|
||||
positions without placing marks there.
|
||||
|
||||
==============================================================================
|
||||
*07.4* Backup files
|
||||
|
||||
This information does not apply to IdeaVim, it is handled by IDE.
|
||||
<!--
|
||||
Usually Vim does not produce a backup file. If you want to have one, all you
|
||||
need to do is execute the following command: >
|
||||
|
||||
:set backup
|
||||
|
||||
The name of the backup file is the original file with a ~ added to the end.
|
||||
If your file is named data.txt, for example, the backup file name is
|
||||
data.txt~.
|
||||
If you do not like the fact that the backup files end with ~, you can
|
||||
change the extension: >
|
||||
|
||||
:set backupext=.bak
|
||||
|
||||
This will use data.txt.bak instead of data.txt~.
|
||||
Another option that matters here is 'backupdir'. It specifies where the
|
||||
backup file is written. The default, to write the backup in the same
|
||||
directory as the original file, will mostly be the right thing.
|
||||
|
||||
Note:
|
||||
When the 'backup' option isn't set but the 'writebackup' is, Vim will
|
||||
still create a backup file. However, it is deleted as soon as writing
|
||||
the file was completed successfully. This functions as a safety
|
||||
against losing your original file when writing fails in some way (disk
|
||||
full is the most common cause; being hit by lightning might be
|
||||
another, although less common).
|
||||
|
||||
|
||||
KEEPING THE ORIGINAL FILE
|
||||
|
||||
If you are editing source files, you might want to keep the file before you
|
||||
make any changes. But the backup file will be overwritten each time you write
|
||||
the file. Thus it only contains the previous version, not the first one.
|
||||
To make Vim keep the original file, set the 'patchmode' option. This
|
||||
specifies the extension used for the first backup of a changed file. Usually
|
||||
you would do this: >
|
||||
|
||||
:set patchmode=.orig
|
||||
|
||||
When you now edit the file data.txt for the first time, make changes and write
|
||||
the file, Vim will keep a copy of the unchanged file under the name
|
||||
"data.txt.orig".
|
||||
If you make further changes to the file, Vim will notice that
|
||||
"data.txt.orig" already exists and leave it alone. Further backup files will
|
||||
then be called "data.txt~" (or whatever you specified with 'backupext').
|
||||
If you leave 'patchmode' empty (that is the default), the original file
|
||||
will not be kept.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*07.5* Copy text between files
|
||||
|
||||
This explains how to copy text from one file to another. Let's start with a
|
||||
simple example. Edit the file that contains the text you want to copy. Move
|
||||
the cursor to the start of the text and press "v". This starts Visual mode.
|
||||
Now move the cursor to the end of the text and press "y". This yanks (copies)
|
||||
the selected text.
|
||||
To copy the above paragraph, you would do: >
|
||||
|
||||
:edit thisfile
|
||||
/This
|
||||
vjjjj$y
|
||||
|
||||
Now edit the file you want to put the text in. Move the cursor to the
|
||||
character where you want the text to appear after. Use "p" to put the text
|
||||
there. >
|
||||
:edit otherfile
|
||||
/There
|
||||
p
|
||||
|
||||
Of course you can use many other commands to yank the text. For example, to
|
||||
select whole lines start Visual mode with "V". Or use CTRL-V to select a
|
||||
rectangular block. Or use "Y" to yank a single line, "yaw" to yank-a-word,
|
||||
etc.
|
||||
The "p" command puts the text after the cursor. Use "P" to put the text
|
||||
before the cursor. Notice that Vim remembers if you yanked a whole line or a
|
||||
block, and puts it back that way.
|
||||
|
||||
|
||||
USING REGISTERS
|
||||
|
||||
When you want to copy several pieces of text from one file to another, having
|
||||
to switch between the files and writing the target file takes a lot of time.
|
||||
To avoid this, copy each piece of text to its own register.
|
||||
A register is a place where IdeaVim stores text. Here we will use the
|
||||
registers named a to z (later you will find out there are others). Let's copy
|
||||
a sentence to the f register (f for First): >
|
||||
|
||||
"fyas
|
||||
|
||||
The "yas" command yanks a sentence like before. It's the "f that tells IdeaVim
|
||||
the text should be place in the f register. This must come just before the
|
||||
yank command.
|
||||
Now yank three whole lines to the l register (l for line): >
|
||||
|
||||
"l3Y
|
||||
|
||||
The count could be before the "l just as well. To yank a block of text to the
|
||||
b (for block) register: >
|
||||
|
||||
CTRL-Vjjww"by
|
||||
|
||||
Notice that the register specification "b is just before the "y" command.
|
||||
This is required. If you would have put it before the "w" command, it would
|
||||
not have worked.
|
||||
Now you have three pieces of text in the f, l and b registers. Edit
|
||||
another file, move around and place the text where you want it: >
|
||||
|
||||
"fp
|
||||
|
||||
Again, the register specification "f comes before the "p" command.
|
||||
You can put the registers in any order. And the text stays in the register
|
||||
until you yank something else into it. Thus you can put it as many times as
|
||||
you like.
|
||||
|
||||
When you delete text, you can also specify a register. Use this to move
|
||||
several pieces of text around. For example, to delete-a-word and write it in
|
||||
the w register: >
|
||||
|
||||
"wdaw
|
||||
|
||||
Again, the register specification comes before the delete command "d".
|
||||
|
||||
<!--
|
||||
|
||||
APPENDING TO A FILE
|
||||
|
||||
When collecting lines of text into one file, you can use this command: >
|
||||
|
||||
:write >> logfile
|
||||
|
||||
This will write the text of the current file to the end of "logfile". Thus it
|
||||
is appended. This avoids that you have to copy the lines, edit the log file
|
||||
and put them there. Thus you save two steps. But you can only append to the
|
||||
end of a file.
|
||||
To append only a few lines, select them in Visual mode before typing
|
||||
":write". In chapter 10 you will learn other ways to select a range of lines.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
*07.6* Viewing a file
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Sometimes you only want to see what a file contains, without the intention to
|
||||
ever write it back. There is the risk that you type ":w" without thinking and
|
||||
overwrite the original file anyway. To avoid this, edit the file read-only.
|
||||
To start Vim in readonly mode, use this command: >
|
||||
|
||||
vim -R file
|
||||
|
||||
On Unix this command should do the same thing: >
|
||||
|
||||
view file
|
||||
|
||||
You are now editing "file" in read-only mode. When you try using ":w" you
|
||||
will get an error message and the file won't be written.
|
||||
When you try to make a change to the file Vim will give you a warning:
|
||||
|
||||
W10: Warning: Changing a readonly file ~
|
||||
|
||||
The change will be done though. This allows for formatting the file, for
|
||||
example, to be able to read it easily.
|
||||
If you make changes to a file and forgot that it was read-only, you can
|
||||
still write it. Add the ! to the write command to force writing.
|
||||
|
||||
If you really want to forbid making changes in a file, do this: >
|
||||
|
||||
vim -M file
|
||||
|
||||
Now every attempt to change the text will fail. The help files are like this,
|
||||
for example. If you try to make a change you get this error message:
|
||||
|
||||
E21: Cannot make changes, 'modifiable' is off ~
|
||||
|
||||
You could use the -M argument to setup Vim to work in a viewer mode. This is
|
||||
only voluntary though, since these commands will remove the protection: >
|
||||
|
||||
:set modifiable
|
||||
:set write
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*07.7* Changing the file name
|
||||
|
||||
This information does not apply to IdeaVim. Use Refactor|Rename in IDE.
|
||||
<!--
|
||||
A clever way to start editing a new file is by using an existing file that
|
||||
contains most of what you need. For example, you start writing a new program
|
||||
to move a file. You know that you already have a program that copies a file,
|
||||
thus you start with: >
|
||||
|
||||
:edit copy.c
|
||||
|
||||
You can delete the stuff you don't need. Now you need to save the file under
|
||||
a new name. The ":saveas" command can be used for this: >
|
||||
|
||||
:saveas move.c
|
||||
|
||||
Vim will write the file under the given name, and edit that file. Thus the
|
||||
next time you do ":write", it will write "move.c". "copy.c" remains
|
||||
unmodified.
|
||||
When you want to change the name of the file you are editing, but don't
|
||||
want to write the file, you can use this command: >
|
||||
|
||||
:file move.c
|
||||
|
||||
Vim will mark the file as "not edited". This means that Vim knows this is not
|
||||
the file you started editing. When you try to write the file, you might get
|
||||
this message:
|
||||
|
||||
E13: File exists (use ! to override) ~
|
||||
|
||||
This protects you from accidentally overwriting another file.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_08.txt| Splitting windows
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,514 +0,0 @@
|
||||
*usr_08.txt* For IdeaVim version @VERSION@. Last change: 2002 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Splitting windows
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Display two different files above each other. Or view two locations in the
|
||||
file at the same time. See the difference between two files by putting them
|
||||
side by side. All this is possible with split windows.
|
||||
|
||||
|08.1| Split a window
|
||||
|08.2| Split a window on another file
|
||||
|08.3| Window size
|
||||
|08.4| Vertical splits
|
||||
|08.5| Moving windows
|
||||
|08.6| Commands for all windows
|
||||
|08.7| Viewing differences with vimdiff
|
||||
|08.8| Various
|
||||
|
||||
Next chapter: |usr_09.txt| Using the GUI
|
||||
Previous chapter: |usr_07.txt| Editing more than one file
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*08.1* Split a window
|
||||
|
||||
The easiest way to open a new window is to use the following command: >
|
||||
|
||||
:split
|
||||
|
||||
This command splits the screen into two windows and leaves the cursor in the
|
||||
top one:
|
||||
|
||||
+----------------------------------+
|
||||
|/* file one.c */ |
|
||||
|~ |
|
||||
|~ |
|
||||
|one.c=============================|
|
||||
|/* file one.c */ |
|
||||
|~ |
|
||||
|one.c=============================|
|
||||
| |
|
||||
+----------------------------------+
|
||||
|
||||
What you see here is two windows on the same file. The line with "====" is
|
||||
that status line. It displays information about the window above it. (In
|
||||
practice the status line will be in reverse video.)
|
||||
The two windows allow you to view two parts of the same file. For example,
|
||||
you could make the top window show the variable declarations of a program, and
|
||||
the bottom one the code that uses these variables.
|
||||
|
||||
The CTRL-W w command can be used to jump between the windows. If you are in
|
||||
the top window, CTRL-W w jumps to the window below it. If you are in the
|
||||
bottom window it will jump to the first window. (CTRL-W CTRL-W does the same
|
||||
thing, in case you let go of the CTRL key a bit later).
|
||||
|
||||
|
||||
CLOSE THE WINDOW
|
||||
|
||||
To close a window, use the command: >
|
||||
|
||||
:close
|
||||
|
||||
Actually, any command that quits editing a file works, like ":quit" and "ZZ".
|
||||
But ":close" prevents you from accidentally exiting Vim when you close the
|
||||
last window.
|
||||
|
||||
|
||||
CLOSING ALL OTHER WINDOWS
|
||||
|
||||
If you have opened a whole bunch of windows, but now want to concentrate on
|
||||
one of them, this command will be useful: >
|
||||
|
||||
:only
|
||||
|
||||
This closes all windows, except for the current one. If any of the other
|
||||
windows has changes, you will get an error message and that window won't be
|
||||
closed.
|
||||
|
||||
==============================================================================
|
||||
*08.2* Split a window on another file
|
||||
|
||||
The following command opens a second window and starts editing the given file:
|
||||
>
|
||||
:split two.c
|
||||
|
||||
If you were editing one.c, then the result looks like this:
|
||||
|
||||
+----------------------------------+
|
||||
|/* file two.c */ |
|
||||
|~ |
|
||||
|~ |
|
||||
|two.c=============================|
|
||||
|/* file one.c */ |
|
||||
|~ |
|
||||
|one.c=============================|
|
||||
| |
|
||||
+----------------------------------+
|
||||
|
||||
To open a window on a new, empty file, use this: >
|
||||
|
||||
:new
|
||||
|
||||
You can repeat the ":split" and ":new" commands to create as many windows as
|
||||
you like.
|
||||
|
||||
==============================================================================
|
||||
*08.3* Window size
|
||||
|
||||
The ":split" command can take a number argument. If specified, this will be
|
||||
the height of the new window. For example, the following opens a new window
|
||||
three lines high and starts editing the file alpha.c: >
|
||||
|
||||
:3split alpha.c
|
||||
|
||||
For existing windows you can change the size in several ways. When you have a
|
||||
working mouse, it is easy: Move the mouse pointer to the status line that
|
||||
separates two windows, and drag it up or down.
|
||||
|
||||
To increase the size of a window: >
|
||||
|
||||
CTRL-W +
|
||||
|
||||
To decrease it: >
|
||||
|
||||
CTRL-W -
|
||||
|
||||
Both of these commands take a count and increase or decrease the window size
|
||||
by that many lines. Thus "4 CTRL-W +" make the window four lines higher.
|
||||
|
||||
To set the window height to a specified number of lines: >
|
||||
|
||||
{height}CTRL-W _
|
||||
|
||||
That's: a number {height}, CTRL-W and then an underscore (the - key with Shift
|
||||
on English-US keyboards).
|
||||
To make a window as high as it can be, use the CTRL-W _ command without a
|
||||
count.
|
||||
|
||||
|
||||
USING THE MOUSE
|
||||
|
||||
In Vim you can do many things very quickly from the keyboard. Unfortunately,
|
||||
the window resizing commands require quite a bit of typing. In this case,
|
||||
using the mouse is faster. Position the mouse pointer on a status line. Now
|
||||
press the left mouse button and drag. The status line will move, thus making
|
||||
the window on one side higher and the other smaller.
|
||||
|
||||
|
||||
OPTIONS
|
||||
|
||||
The 'winheight' option can be set to a minimal desired height of a window and
|
||||
'winminheight' to a hard minimum height.
|
||||
Likewise, there is 'winwidth' for the minimal desired width and
|
||||
'winminwidth' for the hard minimum width.
|
||||
The 'equalalways' option, when set, makes Vim equalize the windows sizes
|
||||
when a window is closed or opened.
|
||||
|
||||
==============================================================================
|
||||
*08.4* Vertical splits
|
||||
|
||||
The ":split" command creates the new window above the current one. To make
|
||||
the window appear at the left side, use: >
|
||||
|
||||
:vsplit
|
||||
|
||||
or: >
|
||||
:vsplit two.c
|
||||
|
||||
The result looks something like this:
|
||||
|
||||
+--------------------------------------+
|
||||
|/* file two.c */ |/* file one.c */ |
|
||||
|~ |~ |
|
||||
|~ |~ |
|
||||
|~ |~ |
|
||||
|two.c===============one.c=============|
|
||||
| |
|
||||
+--------------------------------------+
|
||||
|
||||
Actually, the | lines in the middle will be in reverse video. This is called
|
||||
the vertical separator. It separates the two windows left and right of it.
|
||||
|
||||
There is also the ":vnew" command, to open a vertically split window on a new,
|
||||
empty file. Another way to do this: >
|
||||
|
||||
:vertical new
|
||||
|
||||
The ":vertical" command can be inserted before another command that splits a
|
||||
window. This will cause that command to split the window vertically instead
|
||||
of horizontally. (if the command doesn't split a window, it works
|
||||
unmodified).
|
||||
|
||||
|
||||
MOVING BETWEEN WINDOWS
|
||||
|
||||
Since you can split windows horizontally and vertically as much as you like,
|
||||
you can create any layout of windows. Then you can use these commands to move
|
||||
between them:
|
||||
|
||||
CTRL-W h move to the window on the left
|
||||
CTRL-W j move to the window below
|
||||
CTRL-W k move to the window above
|
||||
CTRL-W l move to the window on the right
|
||||
|
||||
CTRL-W t move to the TOP window
|
||||
CTRL-W b move to the BOTTOM window
|
||||
|
||||
You will notice the same letters as used for moving the cursor. And the
|
||||
cursor keys can also be used, if you like.
|
||||
More commands to move to other windows: |Q_wi|
|
||||
|
||||
==============================================================================
|
||||
*08.5* Moving windows
|
||||
|
||||
You have split a few windows, but now they are in the wrong place. Then you
|
||||
need a command to move the window somewhere else. For example, you have three
|
||||
windows like this:
|
||||
|
||||
+----------------------------------+
|
||||
|/* file two.c */ |
|
||||
|~ |
|
||||
|~ |
|
||||
|two.c=============================|
|
||||
|/* file three.c */ |
|
||||
|~ |
|
||||
|~ |
|
||||
|three.c===========================|
|
||||
|/* file one.c */ |
|
||||
|~ |
|
||||
|one.c=============================|
|
||||
| |
|
||||
+----------------------------------+
|
||||
|
||||
Clearly the last one should be at the top. Go to that window (using CTRL-W w)
|
||||
and the type this command: >
|
||||
|
||||
CTRL-W K
|
||||
|
||||
This uses the uppercase letter K. What happens is that the window is moved to
|
||||
the very top. You will notice that K is again used for moving upwards.
|
||||
When you have vertical splits, CTRL-W K will move the current window to the
|
||||
top and make it occupy the full with of the Vim window. If this is your
|
||||
layout:
|
||||
|
||||
+-------------------------------------------+
|
||||
|/* two.c */ |/* three.c */ |/* one.c */ |
|
||||
|~ |~ |~ |
|
||||
|~ |~ |~ |
|
||||
|~ |~ |~ |
|
||||
|~ |~ |~ |
|
||||
|~ |~ |~ |
|
||||
|two.c=========three.c=========one.c========|
|
||||
| |
|
||||
+-------------------------------------------+
|
||||
|
||||
Then using CTRL-W K in the middle window (three.c) will result in:
|
||||
|
||||
+-------------------------------------------+
|
||||
|/* three.c */ |
|
||||
|~ |
|
||||
|~ |
|
||||
|three.c====================================|
|
||||
|/* two.c */ |/* one.c */ |
|
||||
|~ |~ |
|
||||
|two.c==================one.c===============|
|
||||
| |
|
||||
+-------------------------------------------+
|
||||
|
||||
The other three similar commands (you can probably guess these now):
|
||||
|
||||
CTRL-W H move window to the far left
|
||||
CTRL-W J move window to the bottom
|
||||
CTRL-W L move window to the far right
|
||||
|
||||
==============================================================================
|
||||
*08.6* Commands for all windows
|
||||
|
||||
When you have several windows open and you want to quit Vim, you can close
|
||||
each window separately. A quicker way is using this command: >
|
||||
|
||||
:qall
|
||||
|
||||
This stands for "quit all". If any of the windows contain changes, Vim will
|
||||
not exit. The cursor will automatically be positioned in a window with
|
||||
changes. You can then either use ":write" to save the changes, or ":quit!" to
|
||||
throw them away.
|
||||
|
||||
If you know there are windows with changes, and you want to save all these
|
||||
changes, use this command: >
|
||||
|
||||
:wall
|
||||
|
||||
This stands for ":write all". But actually, it only writes files with
|
||||
changes. Vim knows it doesn't make sense to write files that were not
|
||||
changed.
|
||||
And then there is the combination of ":qall" and ":wall": the "write and
|
||||
quit all" command: >
|
||||
|
||||
:wqall
|
||||
|
||||
This writes all modified files and quits Vim.
|
||||
Finally, there is a command that quits Vim and throws away all changes: >
|
||||
|
||||
:qall!
|
||||
|
||||
Be careful, there is no way to undo this command!
|
||||
|
||||
|
||||
OPENING A WINDOW FOR ALL ARGUMENTS
|
||||
|
||||
To make Vim open a window for each file, start it with the "-o" argument: >
|
||||
|
||||
vim -o one.txt two.txt three.txt
|
||||
|
||||
This results in:
|
||||
|
||||
+-------------------------------+
|
||||
|file one.txt |
|
||||
|~ |
|
||||
|one.txt========================|
|
||||
|file two.txt |
|
||||
|~ |
|
||||
|two.txt========================|
|
||||
|file three.txt |
|
||||
|~ |
|
||||
|three.txt======================|
|
||||
| |
|
||||
+-------------------------------+
|
||||
|
||||
The "-O" argument is used to get vertically split windows.
|
||||
When Vim is already running, the ":all" command opens a window for each
|
||||
file in the argument list. ":vertical all" does it with vertical splits.
|
||||
|
||||
==============================================================================
|
||||
*08.7* Viewing differences with vimdiff
|
||||
|
||||
There is a special way to start Vim, which shows the differences between two
|
||||
files. Let's take a file "main.c" and insert a few characters in one line.
|
||||
Write this file with the 'backup' option set, so that the backup file
|
||||
"main.c~" will contain the previous version of the file.
|
||||
Type this command in a shell: >
|
||||
|
||||
vimdiff main.c~ main.c
|
||||
|
||||
Vim will start, with two windows side by side. You will only see the line
|
||||
in which you added characters, and a few lines above and below it.
|
||||
|
||||
VV VV
|
||||
+-----------------------------------------+
|
||||
|+ +--123 lines: /* a|+ +--123 lines: /* a| <- fold
|
||||
| text | text |
|
||||
| text | text |
|
||||
| text | text |
|
||||
| text | changed text | <- changed line
|
||||
| text | text |
|
||||
| text | ------------------| <- deleted line
|
||||
| text | text |
|
||||
| text | text |
|
||||
| text | text |
|
||||
|+ +--432 lines: text|+ +--432 lines: text| <- fold
|
||||
| ~ | ~ |
|
||||
| ~ | ~ |
|
||||
|main.c~==============main.c==============|
|
||||
| |
|
||||
+-----------------------------------------+
|
||||
|
||||
(This picture doesn't show the highlighting, use the vimdiff command for a
|
||||
better look.)
|
||||
|
||||
The lines that were not modified have been collapsed into one line. This
|
||||
is called a closed fold. The are indicated in the picture with "<- fold".
|
||||
Thus the single fold line at the top stands for 123 text lines. These lines
|
||||
are equal in both files.
|
||||
The line marked with "<- changed line" is highlighted, and the inserted
|
||||
text is displayed with another color. This clearly shows what the difference
|
||||
is between the two files.
|
||||
The line that was deleted is displayed with "---" in the main.c window.
|
||||
See the "<- deleted line" marker in the picture. These characters are not
|
||||
really there. They just fill up main.c, so that it displays the same number
|
||||
of lines as the other window.
|
||||
|
||||
|
||||
THE FOLD COLUMN
|
||||
|
||||
Each window has a column on the left with a slightly different background. In
|
||||
the picture above these are indicated with "VV". You notice there is a plus
|
||||
character there, in front of each closed fold. Move the mouse pointer to that
|
||||
plus and click the left button. The fold will open, and you can see the text
|
||||
that it contains.
|
||||
The fold column contains a minus sign for an open fold. If you click on
|
||||
this -, the fold will close.
|
||||
Obviously, this only works when you have a working mouse. You can also use
|
||||
"zo" to open a fold and "zc" to close it.
|
||||
|
||||
|
||||
DIFFING IN VIM
|
||||
|
||||
Another way to start in diff mode can be done from inside Vim. Edit the
|
||||
"main.c" file, then make a split and show the differences: >
|
||||
|
||||
:edit main.c
|
||||
:vertical diffsplit main.c~
|
||||
|
||||
The ":vertical" command is used to make the window split vertically. If you
|
||||
omit this, you will get a horizontal split.
|
||||
|
||||
If you have a patch or diff file, you can use the third way to start diff
|
||||
mode. First edit the file to which the patch applies. Then tell Vim the name
|
||||
of the patch file: >
|
||||
|
||||
:edit main.c
|
||||
:vertical diffpatch main.c.diff
|
||||
|
||||
WARNING: The patch file must contain only one patch, for the file you are
|
||||
editing. Otherwise you will get a lot of error messages, and some files might
|
||||
be patched unexpectedly.
|
||||
The patching will only be done to the copy of the file in Vim. The file on
|
||||
your harddisk will remain unmodified (until you decide to write the file).
|
||||
|
||||
|
||||
SCROLL BINDING
|
||||
|
||||
When the files have more changes, you can scroll in the usual way. Vim will
|
||||
try to keep both the windows start at the same position, so you can easily see
|
||||
the differences side by side.
|
||||
When you don't want this for a moment, use this command: >
|
||||
|
||||
:set noscrollbind
|
||||
|
||||
|
||||
JUMPING TO CHANGES
|
||||
|
||||
When you have disabled folding in some way, it may be difficult to find the
|
||||
changes. Use this command to jump forward to the next change: >
|
||||
|
||||
]c
|
||||
|
||||
To go the other way use: >
|
||||
|
||||
[c
|
||||
|
||||
Prepended a count to jump further away.
|
||||
|
||||
|
||||
REMOVING CHANGES
|
||||
|
||||
You can move text from one window to the other. This either removes
|
||||
differences or adds new ones. Vim doesn't keep the highlighting updated in
|
||||
all situations. To update it use this command: >
|
||||
|
||||
:diffupdate
|
||||
|
||||
To remove a difference, you can move the text in a highlighted block from one
|
||||
window to another. Take the "main.c" and "main.c~" example above. Move the
|
||||
cursor to the left window, on the line that was deleted in the other window.
|
||||
Now type this command: >
|
||||
|
||||
dp
|
||||
|
||||
The change will be removed by putting the text of the current window in the
|
||||
other window. "dp" stands for "diff put".
|
||||
You can also do it the other way around. Move the cursor to the right
|
||||
window, to the line where "changed" was inserted. Now type this command: >
|
||||
|
||||
do
|
||||
|
||||
The change will now be removed by getting the text from the other window.
|
||||
Since there are no changes left now, Vim puts all text in a closed fold.
|
||||
"do" stands for "diff obtain". "dg" would have been better, but that already
|
||||
has a different meaning ("dgg" deletes from the cursor until the first line).
|
||||
|
||||
For details about diff mode, see |vimdiff|.
|
||||
|
||||
==============================================================================
|
||||
*08.8* Various
|
||||
|
||||
The 'laststatus' option can be used to specify when the last window has a
|
||||
statusline:
|
||||
|
||||
0 never
|
||||
1 only when there are split windows (the default)
|
||||
2 always
|
||||
|
||||
Many commands that edit another file have a variant that splits the window.
|
||||
For Command-line commands this is done by prepending an "s". For example:
|
||||
":tag" jumps to a tag, ":stag" splits the window and jumps to a
|
||||
tag.
|
||||
For Normal mode commands a CTRL-W is prepended. CTRL-^ jumps to the
|
||||
alternate file, CTRL-W CTRL-^ splits the window and edits the alternate file.
|
||||
|
||||
The 'splitbelow' option can be set to make a new window appear below the
|
||||
current window. The 'splitright' option can be set to make a vertically split
|
||||
window appear right of the current window.
|
||||
|
||||
When splitting a window you can prepend a modifier command to tell where the
|
||||
window is to appear:
|
||||
|
||||
:leftabove {cmd} left or above the current window
|
||||
:aboveleft {cmd} idem
|
||||
:rightbelow {cmd} right or below the current window
|
||||
:belowright {cmd} idem
|
||||
:topleft {cmd} at the top or left of the Vim window
|
||||
:botright {cmd} at the bottom or right of the Vim window
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_09.txt| Using the GUI
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,311 +0,0 @@
|
||||
*usr_09.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Using the GUI
|
||||
|
||||
|
||||
Vim works in an ordinary terminal. GVim can do the same things and a few
|
||||
more. The GUI offers menus, a toolbar, scrollbars and other items. This
|
||||
chapter is about these extra things that the GUI offers.
|
||||
|
||||
|09.1| Parts of the GUI
|
||||
|09.2| Using the mouse
|
||||
|09.3| The clipboard
|
||||
|09.4| Select mode
|
||||
|
||||
Next chapter: |usr_10.txt| Making big changes
|
||||
Previous chapter: |usr_08.txt| Splitting windows
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*09.1* Parts of the GUI
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
You might have an icon on your desktop that starts gVim. Otherwise, one of
|
||||
these commands should do it: >
|
||||
|
||||
gvim file.txt
|
||||
vim -g file.txt
|
||||
|
||||
If this doesn't work you don't have a version of Vim with GUI support. You
|
||||
will have to install one first.
|
||||
Vim will open a window and display "file.txt" in it. What the window looks
|
||||
like depends on the version of Vim. It should resemble the following picture
|
||||
(for as far as this can be shown in ASCII!).
|
||||
|
||||
+----------------------------------------------------+
|
||||
| file.txt + (~/dir) - VIM X | <- window title
|
||||
+----------------------------------------------------+
|
||||
| File Edit Tools Syntax Buffers Window Help | <- menubar
|
||||
+----------------------------------------------------+
|
||||
| aaa bbb ccc ddd eee fff ggg hhh iii jjj | <- toolbar
|
||||
| aaa bbb ccc ddd eee fff ggg hhh iii jjj |
|
||||
+----------------------------------------------------+
|
||||
| file text | ^ |
|
||||
| ~ | # |
|
||||
| ~ | # | <- scrollbar
|
||||
| ~ | # |
|
||||
| ~ | # |
|
||||
| ~ | # |
|
||||
| | V |
|
||||
+----------------------------------------------------+
|
||||
|
||||
The largest space is occupied by the file text. This shows the file in the
|
||||
same way as in a terminal. With some different colors and another font
|
||||
perhaps.
|
||||
|
||||
|
||||
THE WINDOW TITLE
|
||||
|
||||
At the very top is the window title. This is drawn by your window system.
|
||||
Vim will set the title to show the name of the current file. First comes the
|
||||
name of the file. Then some special characters and the directory of the file
|
||||
in parens. These special character can be present:
|
||||
|
||||
- The file cannot be modified (e.g., a help file)
|
||||
+ The file contains changes
|
||||
= The file is read-only
|
||||
=+ The file is read-only, contains changes anyway
|
||||
|
||||
If nothing is shown you have an ordinary, unchanged file.
|
||||
|
||||
|
||||
THE MENUBAR
|
||||
|
||||
You know how menus work, right? Vim has the usual items, plus a few more.
|
||||
Browse them to get an idea of what you can use them for. A relevant submenu
|
||||
is Edit/Global Settings. You will find these entries:
|
||||
|
||||
Toggle Toolbar make the toolbar appear/disappear
|
||||
Toggle Bottom Scrollbar make a scrollbar appear/disappear at the bottom
|
||||
Toggle Left Scrollbar make a scrollbar appear/disappear at the left
|
||||
Toggle Right Scrollbar make a scrollbar appear/disappear at the right
|
||||
|
||||
On most systems you can tear-off the menus. Select the top item of the menu,
|
||||
the one that looks like a dashed line. You will get a separate window with
|
||||
the items of the menu. It will hang around until you close the window.
|
||||
|
||||
|
||||
THE TOOLBAR
|
||||
|
||||
This contains icons for the most often used actions. Hopefully the icons are
|
||||
self-explanatory. There are tooltips to get an extra hint (move the mouse
|
||||
pointer to the icon without clicking and don't move it for a second).
|
||||
|
||||
The "Edit/Global Settings/Toggle Toolbar" menu item can be used to make the
|
||||
toolbar disappear. If you never want a toolbar, use this command in your
|
||||
vimrc file: >
|
||||
|
||||
:set guioptions-=T
|
||||
|
||||
This removes the 'T' flag from the 'guioptions' option. Other parts of the
|
||||
GUI can also be enabled or disabled with this option. See the help for it.
|
||||
|
||||
|
||||
THE SCROLLBARS
|
||||
|
||||
By default there is one scrollbar on the right. It does the obvious thing.
|
||||
When you split the window, each window will get its own scrollbar.
|
||||
You can make a horizontal scrollbar appear with the menu item
|
||||
Edit/Global Settings/Toggle Bottom Scrollbar. This is useful in diff mode, or
|
||||
when the 'wrap' option has been reset (more about that later).
|
||||
|
||||
When there are vertically split windows, only the windows on the right side
|
||||
will have a scrollbar. However, when you move the cursor to a window on the
|
||||
left, it will be this one the that scrollbar controls. This takes a bit of
|
||||
time to get used to.
|
||||
When you work with vertically split windows, consider adding a scrollbar on
|
||||
the left. This can be done with a menu item, or with the 'guioptions' option:
|
||||
>
|
||||
:set guioptions+=l
|
||||
|
||||
This adds the 'l' flag to 'guioptions'.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*09.2* Using the mouse
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Standards are wonderful. In Microsoft Windows, you can use the mouse to
|
||||
select text in a standard manner. The X Window system also has a standard
|
||||
system for using the mouse. Unfortunately, these two standards are not the
|
||||
same.
|
||||
Fortunately, you can customize Vim. You can make the behavior of the mouse
|
||||
work like an X Window system mouse or a Microsoft Windows mouse. The following
|
||||
command makes the mouse behave like an X Window mouse: >
|
||||
|
||||
:behave xterm
|
||||
|
||||
The following command makes the mouse work like a Microsoft Windows mouse: >
|
||||
|
||||
:behave mswin
|
||||
|
||||
The default behavior of the mouse on UNIX systems is xterm. The default
|
||||
behavior on a Microsoft Windows system is selected during the installation
|
||||
process. For details about what the two behaviors are, see |:behave|. Here
|
||||
follows a summary.
|
||||
|
||||
|
||||
XTERM MOUSE BEHAVIOR
|
||||
|
||||
Left mouse click position the cursor
|
||||
Left mouse drag select text in Visual mode
|
||||
Middle mouse click paste text from the clipboard
|
||||
Right mouse click extend the selected text until the mouse
|
||||
pointer
|
||||
|
||||
|
||||
MSWIN MOUSE BEHAVIOR
|
||||
|
||||
Left mouse click position the cursor
|
||||
Left mouse drag select text in Select mode (see |09.4|)
|
||||
Left mouse click, with Shift extend the selected text until the mouse
|
||||
pointer
|
||||
Middle mouse click paste text from the clipboard
|
||||
Right mouse click display a pop-up menu
|
||||
|
||||
|
||||
The mouse can be further tuned. Check out these options if you want to change
|
||||
the way how the mouse works:
|
||||
|
||||
'mouse' in which mode the mouse is used by Vim
|
||||
'mousemodel' what effect a mouse click has
|
||||
'mousetime' time between clicks for a double-click
|
||||
'mousehide' hide the mouse while typing
|
||||
'selectmode' whether the mouse starts Visual or Select mode
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*09.3* The clipboard
|
||||
|
||||
In section |04.7| the basic use of the clipboard was explained.
|
||||
<!--
|
||||
There is one
|
||||
essential thing to explain about X-windows: There are actually two places to
|
||||
exchange text between programs. MS-Windows doesn't have this.
|
||||
|
||||
In X-Windows there is the "current selection". This is the text that is
|
||||
currently highlighted. In Vim this is the Visual area (this assumes you are
|
||||
using the default option settings). You can paste this selection in another
|
||||
application without any further action.
|
||||
For example, in this text select a few words with the mouse. Vim will
|
||||
switch to Visual mode and highlight the text. Now start another gVim, without
|
||||
a file name argument, so that it displays an empty window. Click the middle
|
||||
mouse button. The selected text will be inserted.
|
||||
|
||||
The "current selection" will only remain valid until some other text is
|
||||
selected. After doing the paste in the other gVim, now select some characters
|
||||
in that window. You will notice that the words that were previously selected
|
||||
in the other gVim window are displayed differently. This means that it no
|
||||
longer is the current selection.
|
||||
-->
|
||||
|
||||
You don't need to select text with the mouse, using the keyboard commands for
|
||||
Visual mode works just as well.
|
||||
|
||||
|
||||
THE REAL CLIPBOARD
|
||||
|
||||
<!--
|
||||
Now for the other place with which text can be exchanged. We call this the
|
||||
"real clipboard", to avoid confusion. Often both the "current selection" and
|
||||
the "real clipboard" are called clipboard, you'll have to get used to that.
|
||||
-->
|
||||
To put text on the real clipboard, select a few different words in one of
|
||||
the editors. Then use the Edit/Copy menu entry. Now the text
|
||||
has been copied to the real clipboard. You can't see this, unless you have
|
||||
some application that shows the clipboard contents (e.g., KDE's klipper).
|
||||
Now select the other application, position the cursor somewhere and use the
|
||||
Edit/Paste menu. You will see the text from the real clipboard is inserted.
|
||||
|
||||
|
||||
<!--
|
||||
USING BOTH
|
||||
|
||||
This use of both the "current selection" and the "real clipboard" might sound
|
||||
a bit confusing. But it is very useful. Let's show this with an example.
|
||||
Use one gVim with a text file and perform these actions:
|
||||
|
||||
- Select two words in Visual mode.
|
||||
- Use the Edit/Copy menu to get these words onto the clipboard.
|
||||
- Select one other word in Visual mode.
|
||||
- Use the Edit/Paste menu item. What will happen is that the single selected
|
||||
word is replaced with the two words from the clipboard.
|
||||
- Move the mouse pointer somewhere else and click the middle button. You
|
||||
will see that the word you just overwrote with the clipboard is inserted
|
||||
here.
|
||||
|
||||
If you use the "current selection" and the "real clipboard" with care, you can
|
||||
do a lot of useful editing with them.
|
||||
|
||||
|
||||
-->
|
||||
USING THE KEYBOARD
|
||||
|
||||
If you don't like using the mouse, you can access the real clipboard with
|
||||
the "+ register.
|
||||
<!--
|
||||
If you don't like using the mouse, you can access the current selection and
|
||||
the real clipboard with two registers. The "* register is for the current
|
||||
selection.
|
||||
To make text become the current selection, use Visual mode. For example,
|
||||
to select a whole line just press "V".
|
||||
To insert the current selection before the cursor: >
|
||||
|
||||
"*P
|
||||
|
||||
Notice the uppercase "P". The lowercase "p" puts the text after the cursor.
|
||||
-->
|
||||
|
||||
The "+ register is used for the real clipboard. For example, to copy the text
|
||||
from the cursor position until the end of the line to the clipboard: >
|
||||
|
||||
"+y$
|
||||
|
||||
Remember, "y" is yank, which is IdeaVim's copy command.
|
||||
To insert the contents of the real clipboard before the cursor: >
|
||||
|
||||
"+P
|
||||
|
||||
<!--
|
||||
It's the same as for the current selection, but uses the plus (+) register
|
||||
instead of the star (*) register.
|
||||
|
||||
-->
|
||||
==============================================================================
|
||||
*09.4* Select mode
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
And now something that is used more often on MS-Windows than on X-Windows.
|
||||
But both can do it. You already know about Visual mode. Select mode is like
|
||||
Visual mode, because it is also used to select text. But there is an obvious
|
||||
difference: When typing text, the selected text is deleted and the typed text
|
||||
replaces it.
|
||||
|
||||
To start working with Select mode, you must first enable it (for MS-Windows
|
||||
it is probably already enabled, but you can do this anyway): >
|
||||
|
||||
:set selectmode+=mouse
|
||||
|
||||
Now use the mouse to select some text. It is highlighted like in Visual mode.
|
||||
Now press a letter. The selected text is deleted, and the single letter
|
||||
replaces it. You are in Insert mode now, thus you can continue typing.
|
||||
|
||||
Since typing normal text causes the selected text to be deleted, you can not
|
||||
use the normal movement commands "hjkl", "w", etc. Instead, use the shifted
|
||||
function keys. <S-Left> (shifted cursor left key) moves the cursor left. The
|
||||
selected text is changed like in Visual mode. The other shifted cursor keys
|
||||
do what you expect. <S-End> and <S-Home> also work.
|
||||
|
||||
You can tune the way Select mode works with the 'selectmode' option.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_10.txt| Making big changes
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,840 +0,0 @@
|
||||
*usr_10.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Making big changes
|
||||
|
||||
|
||||
In chapter 4 several ways to make small changes were explained. This chapter
|
||||
goes into making changes that are repeated or can affect a large amount of
|
||||
text. The Visual mode allows doing various things with blocks of text. Use
|
||||
an external program to do really complicated things.
|
||||
|
||||
|10.1| Record and playback commands
|
||||
|10.2| Substitution
|
||||
|10.3| Command ranges
|
||||
|10.4| The global command
|
||||
|10.5| Visual block mode
|
||||
|10.6| Reading and writing part of a file
|
||||
|10.7| Formatting text
|
||||
|10.8| Changing case
|
||||
|10.9| Using an external program
|
||||
|
||||
Next chapter: |usr_11.txt| Recovering from a crash
|
||||
Previous chapter: |usr_09.txt| Using the GUI
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*10.1* Record and playback commands
|
||||
|
||||
The "." command repeats the preceding change. But what if you want to do
|
||||
something more complex than a single change? That's where command recording
|
||||
comes in. There are three steps:
|
||||
|
||||
1. The "q{register}" command starts recording keystrokes into the register
|
||||
named {register}. The register name must be between a and z.
|
||||
2. Type your commands.
|
||||
3. To finish recording, press q (without any extra character).
|
||||
|
||||
You can now execute the macro by typing the command "@{register}".
|
||||
|
||||
Take a look at how to use these commands in practice. You have a list of
|
||||
filenames that look like this:
|
||||
|
||||
stdio.h ~
|
||||
fcntl.h ~
|
||||
unistd.h ~
|
||||
stdlib.h ~
|
||||
|
||||
And what you want is the following:
|
||||
|
||||
#include "stdio.h" ~
|
||||
#include "fcntl.h" ~
|
||||
#include "unistd.h" ~
|
||||
#include "stdlib.h" ~
|
||||
|
||||
You start by moving to the first character of the first line. Next you
|
||||
execute the following commands:
|
||||
|
||||
qa Start recording a macro in register a.
|
||||
^ Move to the beginning of the line.
|
||||
i#include "<Esc> Insert the string #include " at the beginning
|
||||
of the line.
|
||||
$ Move to the end of the line.
|
||||
a"<Esc> Append the character double quotation mark (")
|
||||
to the end of the line.
|
||||
j Go to the next line.
|
||||
q Stop recording the macro.
|
||||
|
||||
Now that you have done the work once, you can repeat the change by typing the
|
||||
command "@a" three times.
|
||||
The "@a" command can be preceded by a count, which will cause the macro to be
|
||||
executed that number of times. In this case you would type: >
|
||||
|
||||
3@a
|
||||
|
||||
|
||||
MOVE AND EXECUTE
|
||||
|
||||
You might have the lines you want to change in various places. Just move the
|
||||
cursor to each location and use the "@a" command. If you have done that once,
|
||||
you can do it again with "@@". That's a bit easier to type. If you now
|
||||
execute register b with "@b", the next "@@" will use register b.
|
||||
If you compare the playback method with using ".", there are several
|
||||
differences. First of all, "." can only repeat one change. As seen in the
|
||||
example above, "@a" can do several changes, and move around as well.
|
||||
Secondly, "." can only remember the last change. Executing a register allows
|
||||
you to make any changes and then still use "@a" to replay the recorded
|
||||
commands. Finally, you can use 26 different registers. Thus you can remember
|
||||
26 different command sequences to execute.
|
||||
|
||||
|
||||
USING REGISTERS
|
||||
|
||||
The registers used for recording are the same ones you used for yank and
|
||||
delete commands. This allows you to mix recording with other commands to
|
||||
manipulate the registers.
|
||||
Suppose you have recorded a few commands in register n. When you execute
|
||||
this with "@n" you notice you did something wrong. You could try recording
|
||||
again, but perhaps you will make another mistake. Instead, use this trick:
|
||||
|
||||
G Go to the end of the file.
|
||||
o<Esc> Create an empty line.
|
||||
"np Put the text from the n register. You now see
|
||||
the commands you typed as text in the file.
|
||||
{edits} Change the commands that were wrong. This is
|
||||
just like editing text.
|
||||
0 Go to the start of the line.
|
||||
"ny$ Yank the corrected commands into the n
|
||||
register.
|
||||
dd Delete the scratch line.
|
||||
|
||||
Now you can execute the corrected commands with "@n". (If your recorded
|
||||
commands include line breaks, adjust the last two items in the example to
|
||||
include all the lines).
|
||||
|
||||
|
||||
APPENDING TO A REGISTER
|
||||
|
||||
So far we have used a lowercase letter for the register name. To append to a
|
||||
register, use an uppercase letter.
|
||||
Suppose you have recorded a command to change a word to register c. It
|
||||
works properly, but you would like to add a search for the next word to
|
||||
change. This can be done with: >
|
||||
|
||||
qC/word<Enter>q
|
||||
|
||||
You start with "qC", which records to the c register and appends. Thus
|
||||
writing to an uppercase register name means to append to the register with
|
||||
the same letter, but lowercase.
|
||||
|
||||
This works both with recording and with yank and delete commands. For
|
||||
example, you want to collect a sequence of lines into the a register. Yank
|
||||
the first line with: >
|
||||
|
||||
"aY
|
||||
|
||||
Now move to the second line, and type: >
|
||||
|
||||
"AY
|
||||
|
||||
Repeat this command for all lines. The a register now contains all those
|
||||
lines, in the order you yanked them.
|
||||
|
||||
==============================================================================
|
||||
*10.2* Substitution
|
||||
|
||||
The ":substitute" command enables you to perform string replacements on a
|
||||
whole range of lines. The general form of this command is as follows: >
|
||||
|
||||
:[range]substitute/from/to/[flags]
|
||||
|
||||
This command changes the "from" string to the "to" string in the lines
|
||||
specified with [range]. For example, you can change "Professor" to "Teacher"
|
||||
in all lines with the following command: >
|
||||
|
||||
:%substitute/Professor/Teacher/
|
||||
<
|
||||
Note:
|
||||
The :substitute command is almost never spelled out completely. Most
|
||||
of the time, people use the abbreviated version ":s". From here on
|
||||
the abbreviation will be used.
|
||||
|
||||
The "%" before the command specifies the command works on all lines. Without
|
||||
a range, ":s" only works on the current line. More about ranges in the next
|
||||
section.
|
||||
|
||||
By default, the ":substitute" command changes only the first occurrence on
|
||||
each line. For example, the preceding command changes the line:
|
||||
|
||||
Professor Smith criticized Professor Johnson today. ~
|
||||
|
||||
to:
|
||||
|
||||
Teacher Smith criticized Professor Johnson today. ~
|
||||
|
||||
To change every occurrence on the line, you need to add the g (global) flag.
|
||||
The command: >
|
||||
|
||||
:%s/Professor/Teacher/g
|
||||
|
||||
results in (starting with the original line):
|
||||
|
||||
Teacher Smith criticized Teacher Johnson today. ~
|
||||
|
||||
Other flags include p (print), which causes the ":substitute" command to print
|
||||
out each line it changes. The c (confirm) flag tells ":substitute" to ask you
|
||||
for confirmation before it performs each substitution. Enter the following: >
|
||||
|
||||
:%s/Professor/Teacher/c
|
||||
|
||||
Vim finds the first occurrence of "Professor" and displays the text it is
|
||||
about to change. You get the following prompt: >
|
||||
|
||||
<!--
|
||||
replace with Teacher (y/n/a/q/l/^E/^Y)?
|
||||
-->
|
||||
replace with Teacher (y/n/a/q/l)?
|
||||
|
||||
At this point, you must enter one of the following answers:
|
||||
|
||||
y Yes; make this change.
|
||||
n No; skip this match.
|
||||
a All; make this change and all remaining ones without
|
||||
further confirmation.
|
||||
q Quit; don't make any more changes.
|
||||
l Last; make this change and then quit.
|
||||
<!--
|
||||
CTRL-E Scroll the text one line up.
|
||||
CTRL-Y Scroll the text one line down.
|
||||
-->
|
||||
|
||||
|
||||
The "from" part of the substitute command is actually a pattern. The same
|
||||
kind as used for the search command. For example, this command only
|
||||
substitutes "the" when it appears at the start of a line: >
|
||||
|
||||
:s/^the/these/
|
||||
|
||||
If you are substituting with a "from" or "to" part that includes a slash, you
|
||||
need to put a backslash before it. A simpler way is to use another character
|
||||
instead of the slash. A plus, for example: >
|
||||
|
||||
:s+one/two+one or two+
|
||||
|
||||
==============================================================================
|
||||
*10.3* Command ranges
|
||||
|
||||
The ":substitute" command, and many other : commands, can be applied to a
|
||||
selection of lines. This is called a range.
|
||||
The simple form of a range is {number},{number}. For example: >
|
||||
|
||||
:1,5s/this/that/g
|
||||
|
||||
Executes the substitute command on the lines 1 to 5. Line 5 is included.
|
||||
The range is always placed before the command.
|
||||
|
||||
A single number can be used to address one specific line: >
|
||||
|
||||
:54s/President/Fool/
|
||||
|
||||
Some commands work on the whole file when you do not specify a range. To make
|
||||
them work on the current line the "." address is used. The ":write" command
|
||||
works like that. Without a range, it writes the whole file. To make it write
|
||||
only the current line into a file: >
|
||||
|
||||
:.write otherfile
|
||||
|
||||
The first line always has number one. How about the last line? The "$"
|
||||
character is used for this. For example, to substitute in the lines from the
|
||||
cursor to the end: >
|
||||
|
||||
:.,$s/yes/no/
|
||||
|
||||
The "%" range that we used before, is actually a short way to say "1,$", from
|
||||
the first to the last line.
|
||||
|
||||
|
||||
USING A PATTERN IN A RANGE
|
||||
|
||||
Suppose you are editing a chapter in a book, and want to replace all
|
||||
occurrences of "grey" with "gray". But only in this chapter, not in the next
|
||||
one. You know that only chapter boundaries have the word "Chapter" in the
|
||||
first column. This command will work then: >
|
||||
|
||||
:?^Chapter?,/^Chapter/s=grey=gray=g
|
||||
|
||||
You can see a search pattern is used twice. The first "?^Chapter?" finds the
|
||||
line above the current position that matches this pattern. Thus the ?pattern?
|
||||
range is used to search backwards. Similarly, "/^Chapter/" is used to search
|
||||
forward for the start of the next chapter.
|
||||
To avoid confusion with the slashes, the "=" character was used in the
|
||||
substitute command here. A slash or another character would have worked as
|
||||
well.
|
||||
|
||||
|
||||
ADD AND SUBTRACT
|
||||
|
||||
There is a slight error in the above command: If the title of the next chapter
|
||||
had included "grey" it would be replaced as well. Maybe that's what you
|
||||
wanted, but what if you didn't? Then you can specify an offset.
|
||||
To search for a pattern and then use the line above it: >
|
||||
|
||||
/Chapter/-1
|
||||
|
||||
You can use any number instead of the 1. To address the second line below the
|
||||
match: >
|
||||
|
||||
/Chapter/+2
|
||||
|
||||
The offsets can also be used with the other items in a range. Look at this
|
||||
one: >
|
||||
|
||||
:.+3,$-5
|
||||
|
||||
This specifies the range that starts three lines below the cursor and ends
|
||||
five lines before the last line in the file.
|
||||
|
||||
|
||||
USING MARKS
|
||||
|
||||
Instead of figuring out the line numbers of certain positions, remembering them
|
||||
and typing them in a range, you can use marks.
|
||||
Place the marks as mentioned in chapter 3. For example, use "mt" to mark
|
||||
the top of an area and "mb" to mark the bottom. Then you can use this range
|
||||
to specify the lines between the marks (including the lines with the marks): >
|
||||
|
||||
:'t,'b
|
||||
|
||||
|
||||
VISUAL MODE AND RANGES
|
||||
|
||||
You can select text with Visual mode. If you then press ":" to start a colon
|
||||
command, you will see this: >
|
||||
|
||||
:'<,'>
|
||||
|
||||
Now you can type the command and it will be applied to the range of lines that
|
||||
was visually selected.
|
||||
|
||||
Note:
|
||||
When using Visual mode to select part of a line, or using CTRL-V to
|
||||
select a block of text, the colon commands will still apply to whole
|
||||
lines. This might change in a future version of Vim.
|
||||
|
||||
The '< and '> are actually marks, placed at the start and end of the Visual
|
||||
selection. The marks remain at their position until another Visual selection
|
||||
is made. Thus you can use the "'<" command to jump to position where the
|
||||
Visual area started. And you can mix the marks with other items: >
|
||||
|
||||
:'>,$
|
||||
|
||||
This addresses the lines from the end of the Visual area to the end of the
|
||||
file.
|
||||
|
||||
|
||||
A NUMBER OF LINES
|
||||
|
||||
When you know how many lines you want to change, you can type the number and
|
||||
then ":". For example, when you type "5:", you will get: >
|
||||
|
||||
:.,.+4
|
||||
|
||||
Now you can type the command you want to use. It will use the range "."
|
||||
(current line) until ".+4" (four lines down). Thus it spans five lines.
|
||||
|
||||
==============================================================================
|
||||
*10.4* The global command
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
The ":global" command is one of the more powerful features of Vim. It allows
|
||||
you to find a match for a pattern and execute a command there. The general
|
||||
form is: >
|
||||
|
||||
:[range]global/{pattern}/{command}
|
||||
|
||||
This is similar to the ":substitute" command. But, instead of replacing the
|
||||
matched text with other text, the command {command} is executed.
|
||||
|
||||
Note:
|
||||
The command executed for ":global" must be one that starts with a
|
||||
colon. Normal mode commands can not be used directly. The |:normal|
|
||||
command can do this for you.
|
||||
|
||||
Suppose you want to change "foobar" to "barfoo", but only in C++ style
|
||||
comments. These comments start with "//". Use this command: >
|
||||
|
||||
:g+//+s/foobar/barfoo/g
|
||||
|
||||
This starts with ":g". That is short for ":global", just like ":s" is short
|
||||
for ":substitute". Then the pattern, enclosed in plus characters. Since the
|
||||
pattern we are looking for contains a slash, this uses the plus character to
|
||||
separate the pattern. Next comes the substitute command that changes "foobar"
|
||||
into "barfoo".
|
||||
The default range for the global command is the whole file. Thus no range
|
||||
was specified in this example. This is different from ":substitute", which
|
||||
works on one line without a range.
|
||||
The command isn't perfect, since it also matches lines where "//" appears
|
||||
halfway a line, and the substitution will also take place before the "//".
|
||||
|
||||
Just like with ":substitute", any pattern can be used. When you learn more
|
||||
complicated patterns later, you can use them here.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*10.5* Visual block mode
|
||||
|
||||
With CTRL-V you can start selection of a rectangular area of text. There are
|
||||
a few commands that do something special with the text block.
|
||||
|
||||
There is something special about using the "$" command in Visual block mode.
|
||||
When the last motion command used was "$", all lines in the Visual selection
|
||||
will extend until the end of the line, also when the line with the cursor is
|
||||
shorter. This remains effective until you use a motion command that moves the
|
||||
cursor horizontally. Thus using "j" keeps it, "h" stops it.
|
||||
|
||||
|
||||
INSERTING TEXT
|
||||
|
||||
The command "I{string}<Esc>" inserts the text {string} in each line, just
|
||||
left of the visual block. You start by pressing CTRL-V to enter visual block
|
||||
mode. Now you move the cursor to define your block. Next you type I to enter
|
||||
Insert mode, followed by the text to insert. As you type, the text appears on
|
||||
the first line only.
|
||||
After you press <Esc> to end the insert, the text will magically be
|
||||
inserted in the rest of the lines contained in the visual selection. Example:
|
||||
|
||||
include one ~
|
||||
include two ~
|
||||
include three ~
|
||||
include four ~
|
||||
|
||||
Move the cursor to the "o" of "one" and press CTRL-V. Move it down with "3j"
|
||||
to "four". You now have a block selection that spans four lines. Now type: >
|
||||
|
||||
Imain.<Esc>
|
||||
|
||||
The result:
|
||||
|
||||
include main.one ~
|
||||
include main.two ~
|
||||
include main.three ~
|
||||
include main.four ~
|
||||
|
||||
If the block spans short lines that do not extend into the block, the text is
|
||||
not inserted in that line. For example, make a Visual block selection that
|
||||
includes the word "long" in the first and last line of this text, and thus has
|
||||
no text selected in the second line:
|
||||
|
||||
This is a long line ~
|
||||
short ~
|
||||
Any other long line ~
|
||||
|
||||
^^^^ selected block
|
||||
|
||||
Now use the command "Ivery <Esc>". The result is:
|
||||
|
||||
This is a very long line ~
|
||||
short ~
|
||||
Any other very long line ~
|
||||
|
||||
In the short line no text was inserted.
|
||||
|
||||
If the string you insert contains a newline, the "I" acts just like a Normal
|
||||
insert command and affects only the first line of the block.
|
||||
|
||||
The "A" command works the same way, except that it appends after the right
|
||||
side of the block.
|
||||
There is one special case for "A": Select a Visual block and then use "$"
|
||||
to make the block extend to the end of each line. Using "A" now will append
|
||||
the text to the end of each line.
|
||||
Using the same example from above, and then typing "$A XXX<Esc>, you get
|
||||
this result:
|
||||
|
||||
This is a long line XXX ~
|
||||
short XXX ~
|
||||
Any other long line XXX ~
|
||||
|
||||
This really requires using the "$" command. Vim remembers that it was used.
|
||||
Making the same selection by moving the cursor to the end of the longest line
|
||||
with other movement commands will not have the same result.
|
||||
|
||||
|
||||
CHANGING TEXT
|
||||
|
||||
The Visual block "c" command deletes the block and then throws you into Insert
|
||||
mode to enable you to type in a string. The string will be inserted in each
|
||||
line in the block.
|
||||
Starting with the same selection of the "long" words as above, then typing
|
||||
"c_LONG_<Esc>", you get this:
|
||||
|
||||
This is a _LONG_ line ~
|
||||
short ~
|
||||
Any other _LONG_ line ~
|
||||
|
||||
Just like with "I" the short line is not changed. Also, you can't enter a
|
||||
newline in the new text.
|
||||
|
||||
The "C" command deletes text from the left edge of the block to the end of
|
||||
line. It then puts you in Insert mode so that you can type in a string,
|
||||
which is added to the end of each line.
|
||||
Starting with the same text again, and typing "Cnew text<Esc>" you get:
|
||||
|
||||
This is a new text ~
|
||||
short ~
|
||||
Any other new text ~
|
||||
|
||||
Notice that, even though only the "long" word was selected, the text after it
|
||||
is deleted as well. Thus only the location of the left edge of the visual
|
||||
block really matters.
|
||||
Again, short lines that do not reach into the block are excluded.
|
||||
|
||||
Other commands that change the characters in the block:
|
||||
|
||||
~ swap case (a -> A and A -> a)
|
||||
U make uppercase (a -> A and A -> A)
|
||||
u make lowercase (a -> a and A -> a)
|
||||
|
||||
|
||||
FILLING WITH A CHARACTER
|
||||
|
||||
To fill the whole block with one character, use the "r" command. Again,
|
||||
starting with the same example text from above, and then typing "rx":
|
||||
|
||||
This is a xxxx line ~
|
||||
short ~
|
||||
Any other xxxx line ~
|
||||
|
||||
|
||||
Note:
|
||||
If you want to include characters beyond the end of the line in the
|
||||
block, check out the 'virtualedit' feature in chapter 25.
|
||||
|
||||
|
||||
SHIFTING
|
||||
|
||||
The command ">" shifts the selected text to the right one shift amount,
|
||||
inserting whitespace. The starting point for this shift is the left edge of
|
||||
the visual block.
|
||||
With the same example again, ">" gives this result:
|
||||
|
||||
This is a long line ~
|
||||
short ~
|
||||
Any other long line ~
|
||||
|
||||
The shift amount is specified with the 'shiftwidth' option. To change it to
|
||||
use 4 spaces: >
|
||||
|
||||
:set shiftwidth=4
|
||||
|
||||
The "<" command removes one shift amount of whitespace at the left
|
||||
edge of the block. This command is limited by the amount of text that is
|
||||
there; so if there is less than a shift amount of whitespace available, it
|
||||
removes what it can.
|
||||
|
||||
|
||||
JOINING LINES
|
||||
|
||||
The "J" command joins all selected lines together into one line. Thus it
|
||||
removes the line breaks. Actually, the line break, leading white space and
|
||||
trailing white space is replaced by one space. Two spaces are used after a
|
||||
line ending (that can be changed with the 'joinspaces' option).
|
||||
Let's use the example that we got so familiar with now. The result of
|
||||
using the "J" command:
|
||||
|
||||
This is a long line short Any other long line ~
|
||||
|
||||
The "J" command doesn't require a blockwise selection. It works with "v" and
|
||||
"V" selection in exactly the same way.
|
||||
|
||||
If you don't want the white space to be changed, use the "gJ" command.
|
||||
|
||||
==============================================================================
|
||||
*10.6* Reading and writing part of a file
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
When you are writing an e-mail message, you may want to include another file.
|
||||
This can be done with the ":read {filename}" command. The text of the file is
|
||||
put below the cursor line.
|
||||
Starting with this text:
|
||||
|
||||
Hi John, ~
|
||||
Here is the diff that fixes the bug: ~
|
||||
Bye, Pierre. ~
|
||||
|
||||
Move the cursor to the second line and type: >
|
||||
|
||||
:read patch
|
||||
|
||||
The file named "patch" will be inserted, with this result:
|
||||
|
||||
Hi John, ~
|
||||
Here is the diff that fixes the bug: ~
|
||||
2c2 ~
|
||||
< for (i = 0; i <= length; ++i) ~
|
||||
--- ~
|
||||
> for (i = 0; i < length; ++i) ~
|
||||
Bye, Pierre. ~
|
||||
|
||||
The ":read" command accepts a range. The file will be put below the last line
|
||||
number of this range. Thus ":$r patch" appends the file "patch" at the end of
|
||||
the file.
|
||||
What if you want to read the file above the first line? This can be done
|
||||
with the line number zero. This line doesn't really exist, you will get an
|
||||
error message when using it with most commands. But this command is allowed:
|
||||
>
|
||||
:0read patch
|
||||
|
||||
The file "patch" will be put above the first line of the file.
|
||||
|
||||
|
||||
WRITING A RANGE OF LINES
|
||||
|
||||
To write a range of lines to a file, the ":write" command can be used.
|
||||
Without a range it writes the whole file. With a range only the specified
|
||||
lines are written: >
|
||||
|
||||
:.,$write tempo
|
||||
|
||||
This writes the lines from the cursor until the end of the file into the file
|
||||
"tempo". If this file already exists you will get an error message. Vim
|
||||
protects you from accidentally overwriting an existing file. If you know what
|
||||
you are doing and want to overwrite the file, append !: >
|
||||
|
||||
:.,$write! tempo
|
||||
|
||||
CAREFUL: The ! must follow the ":write" command immediately, without white
|
||||
space. Otherwise it becomes a filter command, which is explained later in
|
||||
this chapter.
|
||||
|
||||
|
||||
APPENDING TO A FILE
|
||||
|
||||
In the first section of this chapter was explained how to collect a number of
|
||||
lines into a register. The same can be done to collect lines in a file.
|
||||
Write the first line with this command: >
|
||||
|
||||
:.write collection
|
||||
|
||||
Now move the cursor to the second line you want to collect, and type this: >
|
||||
|
||||
:.write >>collection
|
||||
|
||||
The ">>" tells Vim the "collection" file is not to be written as a new file,
|
||||
but the line must be appended at the end. You can repeat this as many times
|
||||
as you like.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*10.7* Formatting text
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
When you are typing plain text, it's nice if the length of each line is
|
||||
automatically trimmed to fit in the window. To make this happen while
|
||||
inserting text, set the 'textwidth' option: >
|
||||
|
||||
:set textwidth=72
|
||||
|
||||
You might remember that in the example vimrc file this command was used for
|
||||
every text file. Thus if you are using that vimrc file, you were already
|
||||
using it. To check the current value of 'textwidth': >
|
||||
|
||||
:set textwidth
|
||||
|
||||
Now lines will be broken to take only up to 72 characters. But when you
|
||||
insert text halfway a line, or when you delete a few words, the lines will get
|
||||
too long or too short. Vim doesn't automatically reformat the text.
|
||||
To tell Vim to format the current paragraph: >
|
||||
|
||||
gqap
|
||||
|
||||
This starts with the "gq" command, which is an operator. Following is "ap",
|
||||
the text object that stands for "a paragraph". A paragraph is separated from
|
||||
the next paragraph by an empty line.
|
||||
|
||||
Note:
|
||||
A blank line, which contains white space, does NOT separate
|
||||
paragraphs. This is hard to notice!
|
||||
|
||||
Instead of "ap" you could use any motion or text object. If your paragraphs
|
||||
are properly separated, you can use this command to format the whole file: >
|
||||
|
||||
gggqG
|
||||
|
||||
"gg" takes you to the first line, "gq" is the format operator and "G" the
|
||||
motion that jumps to the last line.
|
||||
|
||||
In case your paragraphs aren't clearly defined, you can format just the lines
|
||||
you manually select. Move the cursor to the first line you want to format.
|
||||
Start with the command "gqj". This formats the current line and the one below
|
||||
it. If the first line was short, words from the next line will be appended.
|
||||
If it was too long, words will be moved to the next line. The cursor moves to
|
||||
the second line. Now you can use "." to repeat the command. Keep doing this
|
||||
until you are at the end of the text you want to format.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*10.8* Changing case
|
||||
|
||||
You have text with section headers in lowercase. You want to make the word
|
||||
"section" all uppercase. Do this with the "gU" operator. Start with the
|
||||
cursor in the first column: >
|
||||
|
||||
gUw
|
||||
< section header ----> SECTION header
|
||||
|
||||
The "gu" operator does exactly the opposite: >
|
||||
|
||||
guw
|
||||
< SECTION header ----> section header
|
||||
|
||||
You can also use "g~" to swap case. All these are operators, thus they work
|
||||
with any motion command, with text objects and in Visual mode.
|
||||
To make an operator work on lines you double it. The delete operator is
|
||||
"d", thus to delete a line you use "dd". Similarly, "gugu" makes a whole line
|
||||
lowercase. This can be shortened to "guu". "gUgU" is shortened to "gUU" and
|
||||
"g~g~" to "g~~". Example: >
|
||||
|
||||
g~~
|
||||
< Some GIRLS have Fun ----> sOME girls HAVE fUN ~
|
||||
|
||||
==============================================================================
|
||||
*10.9* Using an external program
|
||||
|
||||
Vim has a very powerful set of commands, it can do anything. But there may
|
||||
still be something that an external command can do better or faster.
|
||||
The command "!{motion}{program}" takes a block of text and filters it
|
||||
through an external program. In other words, it runs the system command
|
||||
represented by {program}, giving it the block of text represented by {motion}
|
||||
as input. The output of this command then replaces the selected block.
|
||||
Because this summarizes badly if you are unfamiliar with UNIX filters, take
|
||||
a look at an example. The sort command sorts a file. If you execute the
|
||||
following command, the unsorted file input.txt will be sorted and written to
|
||||
output.txt. (This works on both UNIX and Microsoft Windows.) >
|
||||
|
||||
sort <input.txt >output.txt
|
||||
|
||||
Now do the same thing in Vim. You want to sort lines 1 through 5 of a file.
|
||||
You start by putting the cursor on line 1. Next you execute the following
|
||||
command: >
|
||||
|
||||
!5G
|
||||
|
||||
The "!" tells Vim that you are performing a filter operation. The Vim editor
|
||||
expects a motion command to follow, indicating which part of the file to
|
||||
filter. The "5G" command tells Vim to go to line 5, so it now knows that it
|
||||
is to filter lines 1 (the current line) through 5.
|
||||
In anticipation of the filtering, the cursor drops to the bottom of the
|
||||
screen and a ! prompt displays. You can now type in the name of the filter
|
||||
program, in this case "sort". Therefore, your full command is as follows: >
|
||||
|
||||
!5Gsort<Enter>
|
||||
|
||||
The result is that the sort program is run on the first 5 lines. The output
|
||||
of the program replaces these lines.
|
||||
|
||||
line 55 line 11
|
||||
line 33 line 22
|
||||
line 11 --> line 33
|
||||
line 22 line 44
|
||||
line 44 line 55
|
||||
last line last line
|
||||
|
||||
The "!!" command filters the current line through a filter. In Unix the "date"
|
||||
command prints the current time and date. "!!date<Enter>" replaces the current
|
||||
line with the output of "date". This is useful to add a timestamp to a file.
|
||||
|
||||
|
||||
<!--
|
||||
WHEN IT DOESN'T WORK
|
||||
|
||||
Starting a shell, sending it text and capturing the output requires that Vim
|
||||
knows how the shell works exactly. When you have problems with filtering,
|
||||
check the values of these options:
|
||||
|
||||
'shell' specifies the program that Vim uses to execute
|
||||
external programs.
|
||||
'shellcmdflag' argument to pass a command to the shell
|
||||
'shellquote' quote to be used around the command
|
||||
'shellxquote' quote to be used around the command and redirection
|
||||
'shelltype' kind of shell (only for the Amiga)
|
||||
'shellslash' use forward slashes in the command (only for
|
||||
MS-Windows and alikes)
|
||||
'shellredir' string used to write the command output into a file
|
||||
|
||||
On Unix this is hardly ever a problem, because there are two kinds of shells:
|
||||
"sh" like and "csh" like. Vim checks the 'shell' option and sets related
|
||||
options automatically, depending on whether it sees "csh" somewhere in
|
||||
'shell'.
|
||||
On MS-Windows, however, there are many different shells and you might have
|
||||
to tune the options to make filtering work. Check the help for the options
|
||||
for more information.
|
||||
|
||||
|
||||
-->
|
||||
<!--
|
||||
READING COMMAND OUTPUT
|
||||
|
||||
To read the contents of the current directory into the file, use this:
|
||||
|
||||
on Unix: >
|
||||
:read !ls
|
||||
on MS-Windows: >
|
||||
:read !dir
|
||||
|
||||
The output of the "ls" or "dir" command is captured and inserted in the text,
|
||||
below the cursor. This is similar to reading a file, except that the "!" is
|
||||
used to tell Vim that a command follows.
|
||||
The command may have arguments. And a range can be used to tell where Vim
|
||||
should put the lines: >
|
||||
|
||||
:0read !date -u
|
||||
|
||||
This inserts the current time and date in UTC format at the top of the file.
|
||||
(Well, if you have a date command that accepts the "-u" argument.) Note the
|
||||
difference with using "!!date": that replaced a line, while ":read !date" will
|
||||
insert a line.
|
||||
|
||||
|
||||
WRITING TEXT TO A COMMAND
|
||||
|
||||
The Unix command "wc" counts words. To count the words in the current file: >
|
||||
|
||||
:write !wc
|
||||
|
||||
This is the same write command as before, but instead of a file name the "!"
|
||||
character is used and the name of an external command. The written text will
|
||||
be passed to the specified command as its standard input. The output could
|
||||
look like this:
|
||||
|
||||
4 47 249 ~
|
||||
|
||||
The "wc" command isn't verbose. This means you have 4 lines, 47 words and 249
|
||||
characters.
|
||||
|
||||
Watch out for this mistake: >
|
||||
|
||||
:write! wc
|
||||
|
||||
This will write the file "wc" in the current directory, with force. White
|
||||
space is important here!
|
||||
|
||||
|
||||
REDRAWING THE SCREEN
|
||||
|
||||
If the external command produced an error message, the display may have been
|
||||
messed up. Vim is very efficient and only redraws those parts of the screen
|
||||
that it knows need redrawing. But it can't know about what another program
|
||||
has written. To tell Vim to redraw the screen: >
|
||||
|
||||
CTRL-L
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_11.txt| Recovering from a crash
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,259 +0,0 @@
|
||||
*usr_11.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Recovering from a crash
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Did your computer crash? And you just spent hours editing? Don't panic! Vim
|
||||
keeps enough information on harddisk to be able to restore most of your work.
|
||||
This chapter shows you how to get your work back and explains how the swap
|
||||
file is used.
|
||||
|
||||
|11.1| Basic recovery
|
||||
|11.2| Where is the swap file?
|
||||
|11.3| Crashed or not?
|
||||
|11.4| Further reading
|
||||
|
||||
Next chapter: |usr_12.txt| Clever tricks
|
||||
Previous chapter: |usr_10.txt| Making big changes
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*11.1* Basic recovery
|
||||
|
||||
In most cases recovering a file is quite simple, assuming you know which file
|
||||
you were editing (and the harddisk is still working). Start Vim on the file,
|
||||
with the "-r" argument added: >
|
||||
|
||||
vim -r help.txt
|
||||
|
||||
Vim will read the swap file (used to store text you were editing) and may read
|
||||
bits and pieces of the original file. If all is well, you will see these
|
||||
messages (with different file names, of course):
|
||||
|
||||
Using swap file ".help.txt.swp" ~
|
||||
Original file "~/vim/runtime/doc/help.txt" ~
|
||||
Recovery completed. You should check if everything is OK. ~
|
||||
(You might want to write out this file under another name ~
|
||||
and run diff with the original file to check for changes) ~
|
||||
Delete the .swp file afterwards. ~
|
||||
|
||||
To be on the safe side, write this file under another name: >
|
||||
|
||||
:write help.txt.recovered
|
||||
|
||||
Compare the file with the original file to check if you ended up with what you
|
||||
expected. Vimdiff is very useful for this |08.7|. Watch out for the original
|
||||
file to contain a more recent version (you saved the file just before the
|
||||
computer crashed). And check that no lines are missing (something went wrong
|
||||
that Vim could not recover).
|
||||
If Vim produces warning messages when recovering, read them carefully.
|
||||
This is rare though.
|
||||
|
||||
It's normal that the last few changes can not be recovered. Vim flushes the
|
||||
changes to disk when you don't type for about four seconds, or after typing
|
||||
about two hundred characters. This is set with the 'updatetime' and
|
||||
'updatecount' options. Thus when Vim didn't get a chance to save itself when
|
||||
the system went down, the changes after the last flush will be lost.
|
||||
|
||||
If you were editing without a file name, give an empty string as argument: >
|
||||
|
||||
vim -r ""
|
||||
|
||||
You must be in the right directory, otherwise Vim can't find the swap file.
|
||||
|
||||
==============================================================================
|
||||
*11.2* Where is the swap file?
|
||||
|
||||
Vim can store the swap file in several places. Normally it is in the same
|
||||
directory as the original file. To find it, change to the directory of the
|
||||
file, and use: >
|
||||
|
||||
vim -r
|
||||
|
||||
Vim will list the swap files that it can find. It will also look in other
|
||||
directories where the swap file for files in the current directory may be
|
||||
located. It will not find swap files in any other directories though, it
|
||||
doesn't search the directory tree.
|
||||
The output could look like this:
|
||||
|
||||
Swap files found: ~
|
||||
In current directory: ~
|
||||
1. .main.c.swp ~
|
||||
owned by: mool dated: Tue May 29 21:00:25 2001 ~
|
||||
file name: ~mool/vim/vim6/src/main.c ~
|
||||
modified: YES ~
|
||||
user name: mool host name: masaka.moolenaar.net ~
|
||||
process ID: 12525 ~
|
||||
In directory ~/tmp: ~
|
||||
-- none -- ~
|
||||
In directory /var/tmp: ~
|
||||
-- none -- ~
|
||||
In directory /tmp: ~
|
||||
-- none -- ~
|
||||
|
||||
If there are several swap files that look like they may be the one you want to
|
||||
use, a list is given of these swap files and you are requested to enter the
|
||||
number of the one you want to use. Carefully look at the dates to decide
|
||||
which one you want to use.
|
||||
In case you don't know which one to use, just try them one by one and check
|
||||
the resulting files if they are what you expected.
|
||||
|
||||
|
||||
USING A SPECIFIC SWAP FILE
|
||||
|
||||
If you know which swap file needs to be used, you can recover by giving the
|
||||
swap file name. Vim will then finds out the name of the original file from
|
||||
the swap file.
|
||||
|
||||
Example: >
|
||||
vim -r .help.txt.swo
|
||||
|
||||
This is also handy when the swap file is in another directory than expected.
|
||||
If this still does not work, see what file names Vim reports and rename the
|
||||
files accordingly. Check the 'directory' option to see where Vim may have
|
||||
put the swap file.
|
||||
|
||||
Note:
|
||||
Vim tries to find the swap file by searching the directories in the
|
||||
'dir' option, looking for files that match "filename.sw?". If
|
||||
wildcard expansion doesn't work (e.g., when the 'shell' option is
|
||||
invalid), Vim does a desperate try to find the file "filename.swp".
|
||||
If that fails too, you will have to give the name of the swapfile
|
||||
itself to be able to recover the file.
|
||||
|
||||
==============================================================================
|
||||
*11.3* Crashed or not? *ATTENTION* *E325*
|
||||
|
||||
Vim tries to protect you from doing stupid things. Suppose you innocently
|
||||
start editing a file, expecting the contents of the file to show up. Instead,
|
||||
Vim produces a very long message:
|
||||
|
||||
E325: ATTENTION ~
|
||||
Found a swap file by the name ".main.c.swp" ~
|
||||
owned by: mool dated: Tue May 29 21:09:28 2001 ~
|
||||
file name: ~mool/vim/vim6/src/main.c ~
|
||||
modified: no ~
|
||||
user name: mool host name: masaka.moolenaar.net ~
|
||||
process ID: 12559 (still running) ~
|
||||
While opening file "main.c" ~
|
||||
dated: Tue May 29 19:46:12 2001 ~
|
||||
~
|
||||
(1) Another program may be editing the same file. ~
|
||||
If this is the case, be careful not to end up with two ~
|
||||
different instances of the same file when making changes. ~
|
||||
Quit, or continue with caution. ~
|
||||
~
|
||||
(2) An edit session for this file crashed. ~
|
||||
If this is the case, use ":recover" or "vim -r main.c" ~
|
||||
to recover the changes (see ":help recovery"). ~
|
||||
If you did this already, delete the swap file ".main.c.swp" ~
|
||||
to avoid this message. ~
|
||||
|
||||
You get this message, because, when starting to edit a file, Vim checks if a
|
||||
swap file already exists for that file. If there is one, there must be
|
||||
something wrong. It may be one of these two situations.
|
||||
|
||||
1. Another edit session is active on this file. Look in the message for the
|
||||
line with "process ID". It might look like this:
|
||||
|
||||
process ID: 12559 (still running) ~
|
||||
|
||||
The text "(still running)" indicates that the process editing this file
|
||||
runs on the same computer. When working on a non-Unix system you will not
|
||||
get this extra hint. When editing a file over a network, you may not see
|
||||
the hint, because the process might be running on another computer. In
|
||||
those two cases you must find out what the situation is yourself.
|
||||
If there is another Vim editing the same file, continuing to edit will
|
||||
result in two versions of the same file. The one that is written last will
|
||||
overwrite the other one, resulting in loss of changes. You better quit
|
||||
this Vim.
|
||||
|
||||
2. The swap file might be the result from a previous crash of Vim or the
|
||||
computer. Check the dates mentioned in the message. If the date of the
|
||||
swap file is newer than the file you were editing, and this line appears:
|
||||
|
||||
modified: YES ~
|
||||
|
||||
Then you very likely have a crashed edit session that is worth recovering.
|
||||
If the date of the file is newer than the date of the swap file, then
|
||||
either it was changed after the crash (perhaps you recovered it earlier,
|
||||
but didn't delete the swap file?), or else the file was saved before the
|
||||
crash but after the last write of the swap file (then you're lucky: you
|
||||
don't even need that old swap file). Vim will warn you for this with this
|
||||
extra line:
|
||||
|
||||
NEWER than swap file! ~
|
||||
|
||||
|
||||
WHAT TO DO?
|
||||
|
||||
If dialogs are supported you will be asked to select one of five choices:
|
||||
|
||||
Swap file ".main.c.swp" already exists! ~
|
||||
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (D)elete it: ~
|
||||
|
||||
O Open the file readonly. Use this when you just want to view the file and
|
||||
don't need to recover it. You might want to use this when you know someone
|
||||
else is editing the file, but you just want to look in it and not make
|
||||
changes.
|
||||
|
||||
E Edit the file anyway. Use this with caution! If the file is being edited
|
||||
in another Vim, you might end up with two versions of the file. Vim will
|
||||
try to warn you when this happens, but better be safe then sorry.
|
||||
|
||||
R Recover the file from the swap file. Use this if you know that the swap
|
||||
file contains changes that you want to recover.
|
||||
|
||||
Q Quit. This avoids starting to edit the file. Use this if there is another
|
||||
Vim editing the same file.
|
||||
When you just started Vim, this will exit Vim. When starting Vim with
|
||||
files in several windows, Vim quits only if there is a swap file for the
|
||||
first one. When using an edit command, the file will not be loaded and you
|
||||
are taken back to the previously edited file.
|
||||
|
||||
D Delete the swap file. Use this when you are sure you no longer need it.
|
||||
For example, when it doesn't contain changes, or when the file itself is
|
||||
newer than the swap file.
|
||||
On Unix this choice is only offered when the process that created the
|
||||
swap file does not appear to be running.
|
||||
|
||||
If you do not get the dialog (you are running a version of Vim that does not
|
||||
support it), you will have to do it manually. To recover the file, use this
|
||||
command: >
|
||||
|
||||
:recover
|
||||
|
||||
|
||||
Vim cannot always detect that a swap file already exists for a file. This is
|
||||
the case when the other edit session puts the swap files in another directory
|
||||
or when the path name for the file is different when editing it on different
|
||||
machines. Therefore, don't rely on Vim always warning you.
|
||||
|
||||
If you really don't want to see this message, you can add the 'A' flag to the
|
||||
'shortmess' option. But it's very unusual that you need this.
|
||||
|
||||
==============================================================================
|
||||
*11.4* Further reading
|
||||
|
||||
|swap-file| An explanation about where the swap file will be created and
|
||||
what its name is.
|
||||
|:preserve| Manually flushing the swap file to disk.
|
||||
|:swapname| See the name of the swap file for the current file.
|
||||
'updatecount' Number of key strokes after which the swap file is flushed to
|
||||
disk.
|
||||
'updatetime' Timeout after which the swap file is flushed to disk.
|
||||
'swapsync' Whether the disk is synced when the swap file is flushed.
|
||||
'directory' List of directory names where to store the swap file.
|
||||
'maxmem' Limit for memory usage before writing text to the swap file.
|
||||
'maxmemtot' Same, but for all files in total.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_12.txt| Clever tricks
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,373 +0,0 @@
|
||||
*usr_12.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Clever tricks
|
||||
|
||||
|
||||
By combining several commands you can make Vim do nearly everything. In this
|
||||
chapter a number of useful combinations will be presented. This uses the
|
||||
commands introduced in the previous chapters and a few more.
|
||||
|
||||
|12.1| Replace a word
|
||||
|12.2| Change "Last, First" to "First Last"
|
||||
|12.3| Sort a list
|
||||
|12.4| Reverse line order
|
||||
|12.5| Count words
|
||||
|12.6| Find a man page
|
||||
|12.7| Trim blanks
|
||||
|12.8| Find where a word is used
|
||||
|
||||
Next chapter: |usr_20.txt| Typing command-line commands quickly
|
||||
Previous chapter: |usr_11.txt| Recovering from a crash
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*12.1* Replace a word
|
||||
|
||||
The substitute command can be used to replace all occurrences of a word with
|
||||
another word: >
|
||||
|
||||
:%s/four/4/g
|
||||
|
||||
The "%" range means to replace in all lines. The "g" flag at the end causes
|
||||
all words in a line to be replaced.
|
||||
This will not do the right thing if your file also contains "thirtyfour".
|
||||
It would be replaced with "thirty4". To avoid this, use the "\<" item to
|
||||
match the start of a word: >
|
||||
|
||||
:%s/\<four/4/g
|
||||
|
||||
Obviously, this still goes wrong on "fourty". Use "\>" to match the end of a
|
||||
word: >
|
||||
|
||||
:%s/\<four\>/4/g
|
||||
|
||||
If you are programming, you might want to replace "four" in comments, but not
|
||||
in the code. Since this is difficult to specify, add the "c" flag to have the
|
||||
substitute command prompt you for each replacement: >
|
||||
|
||||
|
||||
:%s/\<four\>/4/gc
|
||||
|
||||
|
||||
REPLACING IN SEVERAL FILES
|
||||
|
||||
Suppose you want to replace a word in more than one file. You could edit each
|
||||
file and type the command manually. It's a lot faster to use record and
|
||||
playback.
|
||||
Let's assume you have a directory with C++ files, all ending in ".cpp".
|
||||
There is a function called "GetResp" that you want to rename to "GetAnswer".
|
||||
|
||||
vim *.cpp Start Vim, defining the argument list to
|
||||
contain all the C++ files. You are now in the
|
||||
first file.
|
||||
qq Start recording into the q register
|
||||
:%s/\<GetResp\>/GetAnswer/g
|
||||
Do the replacements in the first file.
|
||||
:wnext Write this file and move to the next one.
|
||||
q Stop recording.
|
||||
@q Execute the q register. This will replay the
|
||||
substitution and ":wnext". You can verify
|
||||
that this doesn't produce an error message.
|
||||
999@q Execute the q register on the remaining files.
|
||||
|
||||
At the last file you will get an error message, because ":wnext" cannot move
|
||||
to the next file. This stops the execution, and everything is done.
|
||||
|
||||
Note:
|
||||
When playing back a recorded sequence, an error stops the execution.
|
||||
Therefore, make sure you don't get an error message when recording.
|
||||
|
||||
There is one catch: If one of the .cpp files does not contain the word
|
||||
"GetResp", you will get an error and replacing will stop. To avoid this, add
|
||||
the "e" flag to the substitute command: >
|
||||
|
||||
:%s/\<GetResp\>/GetAnswer/ge
|
||||
|
||||
The "e" flag tells ":substitute" that not finding a match is not an error.
|
||||
|
||||
==============================================================================
|
||||
*12.2* Change "Last, First" to "First Last"
|
||||
|
||||
You have a list of names in this form:
|
||||
|
||||
Doe, John ~
|
||||
Smith, Peter ~
|
||||
|
||||
You want to change that to:
|
||||
|
||||
John Doe ~
|
||||
Peter Smith ~
|
||||
|
||||
This can be done with just one command: >
|
||||
|
||||
:%s/\([^,]*\), \(.*\)/\2 \1/
|
||||
|
||||
Let's break this down in parts. Obviously it starts with a substitute
|
||||
command. The "%" is the line range, which stands for the whole file. Thus
|
||||
the substitution is done in every line in the file.
|
||||
The arguments for the substitute command are "/from/to/". The slashes
|
||||
separate the "from" pattern and the "to" string. This is what the "from"
|
||||
pattern contains:
|
||||
\([^,]*\), \(.*\) ~
|
||||
|
||||
The first part between \( \) matches "Last" \( \)
|
||||
match anything but a comma [^,]
|
||||
any number of times *
|
||||
matches ", " literally ,
|
||||
The second part between \( \) matches "First" \( \)
|
||||
any character .
|
||||
any number of times *
|
||||
|
||||
In the "to" part we have "\2" and "\1". These are called backreferences.
|
||||
They refer to the text matched by the "\( \)" parts in the pattern. "\2"
|
||||
refers to the text matched by the second "\( \)", which is the "First" name.
|
||||
"\1" refers to the first "\( \)", which is the "Last" name.
|
||||
You can use up to nine backreferences in the "to" part of a substitute
|
||||
command. "\0" stands for the whole matched pattern. There are a few more
|
||||
special items in a substitute command, see |sub-replace-special|.
|
||||
|
||||
==============================================================================
|
||||
*12.3* Sort a list
|
||||
|
||||
In a Makefile you often have a list of files. For example:
|
||||
|
||||
OBJS = \ ~
|
||||
version.o \ ~
|
||||
pch.o \ ~
|
||||
getopt.o \ ~
|
||||
util.o \ ~
|
||||
getopt1.o \ ~
|
||||
inp.o \ ~
|
||||
patch.o \ ~
|
||||
backup.o ~
|
||||
|
||||
To sort this list, filter the text through the external sort command: >
|
||||
|
||||
/^OBJS
|
||||
j
|
||||
:.,/^$/-1!sort
|
||||
|
||||
This goes to the first line, where "OBJS" is the first thing in the line.
|
||||
Then it goes one line down and filters the lines until the next empty line.
|
||||
You could also select the lines in Visual mode and then use "!sort". That's
|
||||
easier to type, but more work when there are many lines.
|
||||
The result is this:
|
||||
|
||||
OBJS = \ ~
|
||||
backup.o ~
|
||||
getopt.o \ ~
|
||||
getopt1.o \ ~
|
||||
inp.o \ ~
|
||||
patch.o \ ~
|
||||
pch.o \ ~
|
||||
util.o \ ~
|
||||
version.o \ ~
|
||||
|
||||
|
||||
Notice that a backslash at the end of each line is used to indicate the line
|
||||
continues. After sorting, this is wrong! The "backup.o" line that was at
|
||||
the end didn't have a backslash. Now that it sorts to another place, it
|
||||
must have a backslash.
|
||||
The simplest solution is to add the backslash with "A \<Esc>". You can
|
||||
keep the backslash in the last line, if you make sure an empty line comes
|
||||
after it. That way you don't have this problem again.
|
||||
|
||||
==============================================================================
|
||||
*12.4* Reverse line order
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
The |:global| command can be combined with the |:move| command to move all the
|
||||
lines before the first line, resulting in a reversed file. The command is: >
|
||||
|
||||
:global/^/m 0
|
||||
|
||||
Abbreviated: >
|
||||
|
||||
:g/^/m 0
|
||||
|
||||
The "^" regular expression matches the beginning of the line (even if the line
|
||||
is blank). The |:move| command moves the matching line to after the mythical
|
||||
zeroeth line, so the current matching line becomes the first line of the file.
|
||||
As the |:global| command is not confused by the changing line numbering,
|
||||
|:global| proceeds to match all remaining lines of the file and puts each as
|
||||
the first.
|
||||
|
||||
This also works on a range of lines. First move to above the first line and
|
||||
mark it with "mt". Then move the cursor to the last line in the range and
|
||||
type: >
|
||||
|
||||
:'t+1,.g/^/m 't
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*12.5* Count words
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
Sometimes you have to write a text with a maximum number of words. Vim can
|
||||
count the words for you.
|
||||
When the whole file is what you want to count the words in, use this
|
||||
command: >
|
||||
|
||||
g CTRL-G
|
||||
|
||||
Do not type a space after the g, this is just used here to make the command
|
||||
easy to read.
|
||||
The output looks like this:
|
||||
|
||||
Col 1 of 0; Line 141 of 157; Word 748 of 774; Byte 4489 of 4976 ~
|
||||
|
||||
You can see on which word you are (748), and the total number of words in the
|
||||
file (774).
|
||||
|
||||
When the text is only part of a file, you could move to the start of the text,
|
||||
type "g CTRL-G", move to the end of the text, type "g CTRL-G" again, and then
|
||||
use your brain to compute the difference in the word position. That's a good
|
||||
exercise, but there is an easier way. With Visual mode, select the text you
|
||||
want to count words in. Then type g CTRL-G. The result:
|
||||
|
||||
Selected 5 of 293 Lines; 70 of 1884 Words; 359 of 10928 Bytes ~
|
||||
|
||||
For other ways to count words, lines and other items, see |count-items|.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*12.6* Find a man page *find-manpage*
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
|
||||
Though similar functionality is provided. The "K" command activates IDE's
|
||||
Quick Documentation Lookup.
|
||||
<!--
|
||||
While editing a shell script or C program, you are using a command or function
|
||||
that you want to find the man page for (this is on Unix). Let's first use a
|
||||
simple way: Move the cursor to the word you want to find help on and press >
|
||||
|
||||
K
|
||||
|
||||
Vim will run the external "man" program on the word. If the man page is
|
||||
found, it is displayed. This uses the normal pager to scroll through the text
|
||||
(mostly the "more" program). When you get to the end pressing <Enter> will
|
||||
get you back into Vim.
|
||||
|
||||
A disadvantage is that you can't see the man page and the text you are working
|
||||
on at the same time. There is a trick to make the man page appear in a Vim
|
||||
window. First, load the man filetype plugin: >
|
||||
|
||||
:source $VIMRUNTIME/ftplugin/man.vim
|
||||
|
||||
Put this command in your vimrc file if you intend to do this often. Now you
|
||||
can use the ":Man" command to open a window on a man page: >
|
||||
|
||||
:Man csh
|
||||
|
||||
You can scroll around and the text is highlighted. This allows you to find
|
||||
the help you were looking for. Use CTRL-W w to jump to the window with the
|
||||
text you were working on.
|
||||
To find a man page in a specific section, put the section number first.
|
||||
For example, to look in section 3 for "echo": >
|
||||
|
||||
:Man 3 echo
|
||||
|
||||
To jump to another man page, which is in the text with the typical form
|
||||
"word(1)", press CTRL-] on it. Further ":Man" commands will use the same
|
||||
window.
|
||||
|
||||
To display a man page for the word under the cursor, use this: >
|
||||
|
||||
\K
|
||||
|
||||
(If you redefined the <Leader>, use it instead of the backslash).
|
||||
For example, you want to know the return value of "strstr()" while editing
|
||||
this line:
|
||||
|
||||
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().
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*12.7* Trim blanks
|
||||
|
||||
Some people find spaces and tabs at the end of a line useless, wasteful, and
|
||||
ugly. To remove whitespace at the end of every line, execute the following
|
||||
command: >
|
||||
|
||||
:%s/\s\+$//
|
||||
|
||||
The line range "%" is used, thus this works on the whole file. The pattern
|
||||
that the ":substitute" command matches with is "\s\+$". This finds white
|
||||
space characters (\s), 1 or more of them (\+), before the end-of-line ($).
|
||||
Later will be explained how you write patterns like this |usr_27.txt|.
|
||||
The "to" part of the substitute command is empty: "//". Thus it replaces
|
||||
with nothing, effectively deleting the matched white space.
|
||||
|
||||
Another wasteful use of spaces is placing them before a Tab. Often these can
|
||||
be deleted without changing the amount of white space. But not always!
|
||||
Therefore, you can best do this manually. Use this search command: >
|
||||
|
||||
/
|
||||
|
||||
You cannot see it, but there is a space before a tab in this command. Thus
|
||||
it's "/<Space><Tab>". Now use "x" to delete the space and check that the
|
||||
amount of white space doesn't change. You might have to insert a Tab if it
|
||||
does change. Type "n" to find the next match. Repeat this until no more
|
||||
matches can be found.
|
||||
|
||||
==============================================================================
|
||||
*12.8* Find where a word is used
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
If you are a UNIX user, you can use a combination of Vim and the grep command
|
||||
to edit all the files that contain a given word. This is extremely useful if
|
||||
you are working on a program and want to view or edit all the files that
|
||||
contain a specific variable.
|
||||
For example, suppose you want to edit all the C program files that contain
|
||||
the word "frame_counter". To do this you use the command: >
|
||||
|
||||
vim `grep -l frame_counter *.c`
|
||||
|
||||
Let's look at this command in detail. The grep command searches through a set
|
||||
of files for a given word. Because the -l argument is specified, the command
|
||||
will only list the files containing the word and not print the matching lines.
|
||||
The word it is searching for is "frame_counter". Actually, this can be any
|
||||
regular expression. (Note: What grep uses for regular expressions is not
|
||||
exactly the same as what Vim uses.)
|
||||
The entire command is enclosed in backticks (`). This tells the UNIX shell
|
||||
to run this command and pretend that the results were typed on the command
|
||||
line. So what happens is that the grep command is run and produces a list of
|
||||
files, these files are put on the Vim command line. This results in Vim
|
||||
editing the file list that is the output of grep. You can then use commands
|
||||
like ":next" and ":first" to browse through the files.
|
||||
|
||||
|
||||
FINDING EACH LINE
|
||||
|
||||
The above command only finds the files in which the word is found. You still
|
||||
have to find the word within the files.
|
||||
Vim has a built-in command that you can use to search a set of files for a
|
||||
given string. If you want to find all occurrences of "error_string" in all C
|
||||
program files, for example, enter the following command: >
|
||||
|
||||
:grep error_string *.c
|
||||
|
||||
This causes Vim to search for the string "error_string" in all the specified
|
||||
files (*.c). The editor will now open the first file where a match is found
|
||||
and position the cursor on the first matching line. To go to the next
|
||||
matching line (no matter in what it is file), use the ":cnext" command. To go
|
||||
to the previous match, use the ":cprev" command. Use ":clist" to see all the
|
||||
matches and where they are.
|
||||
The ":grep" command uses the external commands grep (on Unix) or findstr
|
||||
(on Windows). You can change this by setting the option 'grepprg'.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_20.txt| Typing command-line commands quickly
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,393 +0,0 @@
|
||||
*usr_20.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 01
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Typing command-line commands quickly
|
||||
|
||||
|
||||
Vim has a few generic features that makes it easier to enter commands. Colon
|
||||
commands can be abbreviated, edited and repeated. Completion is available for
|
||||
nearly everything.
|
||||
|
||||
|20.1| Command line editing
|
||||
|20.2| Command line abbreviations
|
||||
|20.3| Command line completion
|
||||
|20.4| Command line history
|
||||
|20.5| Command line window
|
||||
|
||||
Next chapter: |usr_21.txt| Go away and come back
|
||||
Previous chapter: |usr_12.txt| Clever tricks
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*20.1* Command line editing
|
||||
|
||||
When you use a colon (:) command or search for a string with / or ?, Vim puts
|
||||
the cursor on the bottom of the screen. There you type the command or search
|
||||
pattern. This is called the Command line. Also when it's used for entering a
|
||||
search command.
|
||||
|
||||
The most obvious way to edit the command you type is by pressing the <BS> key.
|
||||
This erases the character before the cursor. To erase another character,
|
||||
typed earlier, first move the cursor with the cursor keys.
|
||||
For example, you have typed this: >
|
||||
|
||||
:s/col/pig/
|
||||
|
||||
Before you hit <Enter>, you notice that "col" should be "cow". To correct
|
||||
this, you type <Left> five times. The cursor is now just after "col". Type
|
||||
<BS> and "w" to correct: >
|
||||
|
||||
:s/cow/pig/
|
||||
|
||||
Now you can press <Enter> directly. You don't have to move the cursor to the
|
||||
end of the line before executing the command.
|
||||
|
||||
The most often used keys to move around in the command line:
|
||||
|
||||
<Left> one character left
|
||||
<Right> one character right
|
||||
<S-Left> or <C-Left> one word left
|
||||
<S-Right> or <C-Right> one word right
|
||||
CTRL-B or <Home> to begin of command line
|
||||
CTRL-E or <End> to end of command line
|
||||
|
||||
Note:
|
||||
<S-Left> (cursor left key with Shift key pressed) and <C-Left> (cursor
|
||||
left key with Control pressed) will not work on all keyboards. Same
|
||||
for the other Shift and Control combinations.
|
||||
|
||||
You can also use the mouse to move the cursor.
|
||||
|
||||
|
||||
DELETING
|
||||
|
||||
As mentioned, <BS> deletes the character before the cursor.
|
||||
To delete a whole
|
||||
word use CTRL-W.
|
||||
|
||||
/the fine pig ~
|
||||
|
||||
CTRL-W
|
||||
|
||||
/the fine ~
|
||||
|
||||
CTRL-U removes all text, thus allows you to start all over again.
|
||||
|
||||
|
||||
OVERSTRIKE
|
||||
|
||||
The <Insert> key toggles between inserting characters and replacing the
|
||||
existing ones. Start with this text:
|
||||
|
||||
/the fine pig ~
|
||||
|
||||
Move the cursor to the start of "fine" with <S-Left> twice (or <Left> eight
|
||||
times, if <S-Left> doesn't work). Now press <Insert> to switch to overstrike
|
||||
and type "great":
|
||||
|
||||
/the greatpig ~
|
||||
|
||||
Oops, we lost the space. Now, don't use <BS>, because it would delete the
|
||||
"t" (this is different from Replace mode). Instead, press <Insert> to switch
|
||||
from overstrike to inserting, and type the space:
|
||||
|
||||
/the great pig ~
|
||||
|
||||
|
||||
CANCELLING
|
||||
|
||||
You thought of executing a : or / command, but changed your mind. To get rid
|
||||
of what you already typed, without executing it, press CTRL-C or <Esc>.
|
||||
|
||||
Note:
|
||||
<Esc> is the universal "get out" key. Unfortunately, in the good old
|
||||
Vi pressing <Esc> in a command line executed the command! Since that
|
||||
might be considered to be a bug, Vim uses <Esc> to cancel the command.
|
||||
But with the 'cpoptions' option it can be made Vi compatible. And
|
||||
when using a mapping (which might be written for Vi) <Esc> also works
|
||||
Vi compatible. Therefore, using CTRL-C is a method that always works.
|
||||
|
||||
If you are at the start of the command line, pressing <BS> will cancel the
|
||||
command. It's like deleting the ":" or "/" that the line starts with.
|
||||
|
||||
==============================================================================
|
||||
*20.2* Command line abbreviations
|
||||
|
||||
Some of the ":" commands are really long. We already mentioned that
|
||||
":substitute" can be abbreviated to ":s". This is a generic mechanism, all
|
||||
":" commands can be abbreviated.
|
||||
|
||||
How short can a command get? There are 26 letters, and many more commands.
|
||||
For example, ":set" also starts with ":s", but ":s" doesn't start a ":set"
|
||||
command. Instead ":set" can be abbreviated to ":se".
|
||||
When the shorter form of a command could be used for two commands, it
|
||||
stands for only one of them. There is no logic behind which one, you have to
|
||||
learn them. In the help files the shortest form that works is mentioned. For
|
||||
example: >
|
||||
|
||||
:s[ubstitute]
|
||||
|
||||
This means that the shortest form of ":substitute" is ":s". The following
|
||||
characters are optional. Thus ":su" and ":sub" also work.
|
||||
|
||||
In the user manual we will either use the full name of command, or a short
|
||||
version that is still readable. For example, ":function" can be abbreviated
|
||||
to ":fu". But since most people don't understand what that stands for, we
|
||||
will use ":fun". (Vim doesn't have a ":funny" command, otherwise ":fun" would
|
||||
be confusing too.)
|
||||
|
||||
It is recommended that in Vim scripts you write the full command name. That
|
||||
makes it easier to read back when you make later changes. Except for some
|
||||
often used commands like ":w" (":write") and ":r" (":read").
|
||||
A particularly confusing one is ":end", which could stand for ":endif",
|
||||
":endwhile" or ":endfunction". Therefore, always use the full name.
|
||||
|
||||
|
||||
SHORT OPTION NAMES
|
||||
|
||||
In the user manual the long version of the option names is used. Many options
|
||||
also have a short name. Unlike ":" commands, there is only one short name
|
||||
that works. For example, the short name of 'autoindent' is 'ai'. Thus these
|
||||
two commands do the same thing: >
|
||||
|
||||
:set autoindent
|
||||
:set ai
|
||||
|
||||
You can find the full list of long and short names here: |option-list|.
|
||||
|
||||
==============================================================================
|
||||
*20.3* Command line completion
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
This is one of those Vim features that, by itself, is a reason to switch from
|
||||
Vi to Vim. Once you have used this, you can't do without.
|
||||
|
||||
Suppose you have a directory that contains these files:
|
||||
|
||||
info.txt
|
||||
intro.txt
|
||||
bodyofthepaper.txt
|
||||
|
||||
To edit the last one, you use the command: >
|
||||
|
||||
:edit bodyofthepaper.txt
|
||||
|
||||
It's easy to type this wrong. A much quicker way is: >
|
||||
|
||||
:edit b<Tab>
|
||||
|
||||
Which will result in the same command. What happened? The <Tab> key does
|
||||
completion of the word before the cursor. In this case "b". Vim looks in the
|
||||
directory and finds only one file that starts with a "b". That must be the
|
||||
one you are looking for, thus Vim completes the file name for you.
|
||||
|
||||
Now type: >
|
||||
|
||||
:edit i<Tab>
|
||||
|
||||
Vim will beep, and give you: >
|
||||
|
||||
:edit info.txt
|
||||
|
||||
The beep means that Vim has found more than one match. It then uses the first
|
||||
match it found (alphabetically). If you press <Tab> again, you get: >
|
||||
|
||||
:edit intro.txt
|
||||
|
||||
Thus, if the first <Tab> doesn't give you the file you were looking for, press
|
||||
it again. If there are more matches, you will see them all, one at a time.
|
||||
If you press <Tab> on the last matching entry, you will go back to what you
|
||||
first typed: >
|
||||
|
||||
:edit i
|
||||
|
||||
Then it starts all over again. Thus Vim cycles through the list of matches.
|
||||
Use CTRL-P to go through the list in the other direction:
|
||||
|
||||
<------------------- <Tab> -------------------------+
|
||||
|
|
||||
<Tab> --> <Tab> -->
|
||||
:edit i :edit info.txt :edit intro.txt
|
||||
<-- CTRL-P <-- CTRL-P
|
||||
|
|
||||
+---------------------- CTRL-P ------------------------>
|
||||
|
||||
|
||||
CONTEXT
|
||||
|
||||
When you type ":set i" instead of ":edit i" and press <Tab> you get: >
|
||||
|
||||
:set icon
|
||||
|
||||
Hey, why didn't you get ":set info.txt"? That's because Vim has context
|
||||
sensitive completion. The kind of words Vim will look for depends on the
|
||||
command before it. Vim knows that you cannot use a file name just after a
|
||||
":set" command, but you can use an option name.
|
||||
Again, if you repeat typing the <Tab>, Vim will cycle through all matches.
|
||||
There are quite a few, it's better to type more characters first: >
|
||||
|
||||
:set isk<Tab>
|
||||
|
||||
Gives: >
|
||||
|
||||
:set iskeyword
|
||||
|
||||
Now type "=" and press <Tab>: >
|
||||
|
||||
:set iskeyword=@,48-57,_,192-255
|
||||
|
||||
What happens here is that Vim inserts the old value of the option. Now you
|
||||
can edit it.
|
||||
What is completed with <Tab> is what Vim expects in that place. Just try
|
||||
it out to see how it works. In some situations you will not get what you
|
||||
want. That's either because Vim doesn't know what you want, or because
|
||||
completion was not implemented for that situation. In that case you will get
|
||||
a <Tab> inserted (displayed as ^I).
|
||||
|
||||
|
||||
LIST MATCHES
|
||||
|
||||
When there are many matches, you would like to see an overview. Do this by
|
||||
pressing CTRL-D. For example, pressing CTRL-D after: >
|
||||
|
||||
:set is
|
||||
|
||||
results in: >
|
||||
|
||||
:set is
|
||||
incsearch isfname isident iskeyword isprint
|
||||
:set is
|
||||
|
||||
Vim lists the matches and then comes back with the text you typed. You can
|
||||
now check the list for the item you wanted. If it isn't there, you can use
|
||||
<BS> to correct the word. If there are many matches, type a few more
|
||||
characters before pressing <Tab> to complete the rest.
|
||||
If you have watched carefully, you will have noticed that "incsearch"
|
||||
doesn't start with "is". In this case "is" stands for the short name of
|
||||
"incsearch". (Many options have a short and a long name.) Vim is clever
|
||||
enough to know that you might have wanted to expand the short name of the
|
||||
option into the long name.
|
||||
|
||||
|
||||
THERE IS MORE
|
||||
|
||||
The CTRL-L command completes the word to the longest unambiguous string. If
|
||||
you type ":edit i" and there are files "info.txt" and "info_backup.txt" you
|
||||
will get ":edit info".
|
||||
|
||||
The 'wildmode' option can be used to change the way completion works.
|
||||
The 'wildmenu' option can be used to get a menu-like list of matches.
|
||||
Use the 'suffixes' option to specify files that are less important and appear
|
||||
at the end of the list of files.
|
||||
The 'wildignore' option specifies files that are not listed at all.
|
||||
|
||||
More about all of this here: |cmdline-completion|
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*20.4* Command line history
|
||||
|
||||
In chapter 3 we briefly mentioned the history. The basics are that you can
|
||||
use the <Up> key to recall an older command line. <Down> then takes you back
|
||||
to newer commands.
|
||||
|
||||
There are actually four histories. The ones we will mention here are for ":"
|
||||
commands and for "/" and "?" search commands. The "/" and "?" commands share
|
||||
the same history, because they are both search commands. The two other
|
||||
histories are for expressions and input lines for the input() function.
|
||||
|cmdline-history|
|
||||
|
||||
Suppose you have done a ":set" command, typed ten more colon commands and then
|
||||
want to repeat that ":set" command again. You could press ":" and then ten
|
||||
times <Up>. There is a quicker way: >
|
||||
|
||||
:se<Up>
|
||||
|
||||
Vim will now go back to the previous command that started with "se". You have
|
||||
a good chance that this is the ":set" command you were looking for. At least
|
||||
you should not have to press <Up> very often (unless ":set" commands is all
|
||||
you have done).
|
||||
|
||||
The <Up> key will use the text typed so far and compare it with the lines in
|
||||
the history. Only matching lines will be used.
|
||||
If you do not find the line you were looking for, use <Down> to go back to
|
||||
what you typed and correct that. Or use CTRL-U to start all over again.
|
||||
|
||||
To see all the lines in the history: >
|
||||
|
||||
:history
|
||||
|
||||
That's the history of ":" commands. The search history is displayed with this
|
||||
command: >
|
||||
|
||||
:history /
|
||||
|
||||
<!--
|
||||
CTRL-P will work like <Up>, except that it doesn't matter what you already
|
||||
typed. Similarly for CTRL-N and <Down>. CTRL-P stands for previous, CTRL-N
|
||||
for next.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*20.5* Command line window
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
Typing the text in the command line works different from typing text in Insert
|
||||
mode. It doesn't allow many commands to change the text. For most commands
|
||||
that's OK, but sometimes you have to type a complicated command. That's where
|
||||
the command line window is useful.
|
||||
|
||||
Open the command line window with this command: >
|
||||
|
||||
q:
|
||||
|
||||
Vim now opens a (small) window at the bottom. It contains the command line
|
||||
history, and an empty line at the end:
|
||||
|
||||
+-------------------------------------+
|
||||
|other window |
|
||||
|~ |
|
||||
|file.txt=============================|
|
||||
|:e c |
|
||||
|:e config.h.in |
|
||||
|:set path=.,/usr/include,, |
|
||||
|:set iskeyword=@,48-57,_,192-255 |
|
||||
|:set is |
|
||||
|:q |
|
||||
|: |
|
||||
|command-line=========================|
|
||||
| |
|
||||
+-------------------------------------+
|
||||
|
||||
You are now in Normal mode. You can use the "hjkl" keys to move around. For
|
||||
example, move up with "5k" to the ":e config.h.in" line. Type "$h" to go to
|
||||
the "i" of "in" and type "cwout". Now you have changed the line to:
|
||||
|
||||
:e config.h.out ~
|
||||
|
||||
Now press <Enter> and this command will be executed. The command line window
|
||||
will close.
|
||||
The <Enter> command will execute the line under the cursor. It doesn't
|
||||
matter whether Vim is in Insert mode or in Normal mode.
|
||||
Changes in the command line window are lost. They do not result in the
|
||||
history to be changed. Except that the command you execute will be added to
|
||||
the end of the history, like with all executed commands.
|
||||
|
||||
The command line window is very useful when you want to have overview of the
|
||||
history, lookup a similar command, change it a bit and execute it. A search
|
||||
command can be used to find something.
|
||||
In the previous example the "?config" search command could have been used
|
||||
to find the previous command that contains "config". It's a bit strange,
|
||||
because you are using a command line to search in the command line window.
|
||||
While typing that search command you can't open another command line window,
|
||||
there can be only one.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_21.txt| Go away and come back
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,484 +0,0 @@
|
||||
*usr_21.txt* For IdeaVim version @VERSION@. Last change: 2006 Dec 01
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Go away and come back
|
||||
|
||||
|
||||
This chapter goes into mixing the use of other programs with Vim. Either by
|
||||
executing program from inside Vim or by leaving Vim and coming back later.
|
||||
Furthermore, this is about the ways to remember the state of Vim and restore
|
||||
it later.
|
||||
|
||||
|21.1| Suspend and resume
|
||||
|21.2| Executing shell commands
|
||||
|21.3| Remembering information; viminfo
|
||||
|21.4| Sessions
|
||||
|21.5| Views
|
||||
|21.6| Modelines
|
||||
|
||||
Next chapter: |usr_22.txt| Finding the file to edit
|
||||
Previous chapter: |usr_20.txt| Typing command-line commands quickly
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*21.1* Suspend and resume
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Like most Unix programs Vim can be suspended by pressing CTRL-Z. This stops
|
||||
Vim and takes you back to the shell it was started in. You can then do any
|
||||
other commands until you are bored with them. Then bring back Vim with the
|
||||
"fg" command. >
|
||||
|
||||
CTRL-Z
|
||||
{any sequence of shell commands}
|
||||
fg
|
||||
|
||||
You are right back where you left Vim, nothing has changed.
|
||||
In case pressing CTRL-Z doesn't work, you can also use ":suspend".
|
||||
Don't forget to bring Vim back to the foreground, you would lose any changes
|
||||
that you made!
|
||||
|
||||
Only Unix has support for this. On other systems Vim will start a shell for
|
||||
you. This also has the functionality of being able to execute shell commands.
|
||||
But it's a new shell, not the one that you started Vim from.
|
||||
When you are running the GUI you can't go back to the shell where Vim was
|
||||
started. CTRL-Z will minimize the Vim window instead.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*21.2* Executing shell commands
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
To execute a single shell command from Vim use ":!{command}". For example, to
|
||||
see a directory listing: >
|
||||
|
||||
:!ls
|
||||
:!dir
|
||||
|
||||
The first one is for Unix, the second one for MS-Windows.
|
||||
Vim will execute the program. When it ends you will get a prompt to hit
|
||||
<Enter>. This allows you to have a look at the output from the command before
|
||||
returning to the text you were editing.
|
||||
The "!" is also used in other places where a program is run. Let's take
|
||||
a look at an overview:
|
||||
|
||||
:!{program} execute {program}
|
||||
:r !{program} execute {program} and read its output
|
||||
:w !{program} execute {program} and send text to its input
|
||||
:[range]!{program} filter text through {program}
|
||||
|
||||
Notice that the precense of a range before "!{program}" makes a big
|
||||
difference. Without it executes the program normally, with the range a number
|
||||
of text lines is filtered through the program.
|
||||
|
||||
Executing a whole row of programs this way is possible. But a shell is much
|
||||
better at it. You can start a new shell this way: >
|
||||
|
||||
:shell
|
||||
|
||||
This is similar to using CTRL-Z to suspend Vim. The difference is that a new
|
||||
shell is started.
|
||||
|
||||
When using the GUI the shell will be using the Vim window for its input and
|
||||
output. Since Vim is not a terminal emulator, this will not work perfectly.
|
||||
If you have trouble, try toggling the 'guipty' option. If this still doesn't
|
||||
work well enough, start a new terminal to run the shell in. For example with:
|
||||
>
|
||||
:!xterm&
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*21.3* Remembering information; viminfo
|
||||
|
||||
IdeaVim has a much simpler form of viminfo. The following status information
|
||||
is stored by IdeaVim and restored each time the IDE is restarted:
|
||||
|
||||
Command-line and Search pattern history
|
||||
Text in registers
|
||||
Marks for various files
|
||||
|
||||
<!--
|
||||
After editing for a while you will have text in registers, marks in various
|
||||
files, a command line history filled with carefully crafted commands. When
|
||||
you exit Vim all of this is lost. But you can get it back!
|
||||
|
||||
The viminfo file is designed to store status information:
|
||||
|
||||
Command-line and Search pattern history
|
||||
Text in registers
|
||||
Marks for various files
|
||||
The buffer list
|
||||
Global variables
|
||||
|
||||
Each time you exit Vim it will store this information in a file, the viminfo
|
||||
file. When Vim starts again, the viminfo file is read and the information
|
||||
restored.
|
||||
|
||||
The 'viminfo' option is set by default to restore a limited number of items.
|
||||
You might want to set it to remember more information. This is done through
|
||||
the following command: >
|
||||
|
||||
:set viminfo=string
|
||||
|
||||
The string specifies what to save. The syntax of this string is an option
|
||||
character followed by an argument. The option/argument pairs are separated by
|
||||
commas.
|
||||
Take a look at how you can build up your own viminfo string. First, the '
|
||||
option is used to specify how many files for which you save marks (a-z). Pick
|
||||
a nice even number for this option (1000, for instance). Your command now
|
||||
looks like this: >
|
||||
|
||||
:set viminfo='1000
|
||||
|
||||
The f option controls whether global marks (A-Z and 0-9) are stored. If this
|
||||
option is 0, none are stored. If it is 1 or you do not specify an f option,
|
||||
the marks are stored. You want this feature, so now you have this: >
|
||||
|
||||
:set viminfo='1000,f1
|
||||
|
||||
The " option controls how many lines are saved for each of the registers. By
|
||||
default, all the lines are saved. If 0, nothing is saved. To avoid adding
|
||||
thousands of lines to your viminfo file (which might never get used and makes
|
||||
starting Vim slower) you use a maximum of 500 lines: >
|
||||
|
||||
:set viminfo='1000,f1,\"500
|
||||
<
|
||||
Note:
|
||||
Since the " character starts a comment, it must be preceded with a
|
||||
backslash.
|
||||
|
||||
Other options you might want to use:
|
||||
: number of lines to save from the command line history
|
||||
@ number of lines to save from the input line history
|
||||
/ number of lines to save from the search history
|
||||
r removable media, for which no marks will be stored (can be
|
||||
used several times)
|
||||
! global variables that start with an uppercase letter and
|
||||
don't contain lowercase letters
|
||||
h disable 'hlsearch' highlighting when starting
|
||||
% the buffer list (only restored when starting Vim without file
|
||||
arguments)
|
||||
c convert the text using 'encoding'
|
||||
n name used for the viminfo file (must be the last option)
|
||||
|
||||
See the 'viminfo' option and |viminfo-file| for more information.
|
||||
|
||||
When you run Vim multiple times, the last one exiting will store its
|
||||
information. This may cause information that previously exiting Vims stored
|
||||
to be lost. Each item can be remembered only once.
|
||||
|
||||
|
||||
GETTING BACK TO WHERE YOU WERE
|
||||
|
||||
You are halfway editing a file and it's time to leave for holidays. You exit
|
||||
Vim and go enjoy yourselves, forgetting all about your work. After a couple
|
||||
of weeks you start Vim, and type:
|
||||
>
|
||||
'0
|
||||
|
||||
And you are right back where you left Vim. So you can get on with your work.
|
||||
Vim creates a mark each time you exit Vim. The last one is '0. The
|
||||
position that '0 pointed to is made '1. And '1 is made to '2, and so forth.
|
||||
Mark '9 is lost.
|
||||
The ":marks" command is useful to find out where '0 to '9 will take you.
|
||||
|
||||
|
||||
MOVE INFO FROM ONE VIM TO ANOTHER
|
||||
|
||||
You can use the ":wviminfo" and ":rviminfo" commands to save and restore the
|
||||
information while still running Vim. This is useful for exchanging register
|
||||
contents between two instances of Vim, for example. In the first Vim do: >
|
||||
|
||||
:wviminfo! ~/tmp/viminfo
|
||||
|
||||
And in the second Vim do: >
|
||||
|
||||
:rviminfo! ~/tmp/viminfo
|
||||
|
||||
Obviously, the "w" stands for "write" and the "r" for "read".
|
||||
The ! character is used by ":wviminfo" to forcefully overwrite an existing
|
||||
file. When it is omitted, and the file exists, the information is merged into
|
||||
the file.
|
||||
The ! character used for ":rviminfo" means that all the information is
|
||||
used, this may overwrite existing information. Without the ! only information
|
||||
that wasn't set is used.
|
||||
These commands can also be used to store info and use it again later. You
|
||||
could make a directory full of viminfo files, each containing info for a
|
||||
different purpose.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*21.4* Sessions
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Suppose you are editing along, and it is the end of the day. You want to quit
|
||||
work and pick up where you left off the next day. You can do this by saving
|
||||
your editing session and restoring it the next day.
|
||||
A Vim session contains all the information about what you are editing.
|
||||
This includes things such as the file list, window layout, global variables,
|
||||
options and other information. (Exactly what is remembered is controlled by
|
||||
the 'sessionoptions' option, described below.)
|
||||
The following command creates a session file: >
|
||||
|
||||
:mksession vimbook.vim
|
||||
|
||||
Later if you want to restore this session, you can use this command: >
|
||||
|
||||
:source vimbook.vim
|
||||
|
||||
If you want to start Vim and restore a specific session, you can use the
|
||||
following command: >
|
||||
|
||||
vim -S vimbook.vim
|
||||
|
||||
This tells Vim to read a specific file on startup. The 'S' stands for
|
||||
session (actually, you can source any Vim script with -S, thus it might as
|
||||
well stand for "source").
|
||||
|
||||
The windows that were open are restored, with the same position and size as
|
||||
before. Mappings and option values are like before.
|
||||
What exactly is restored depends on the 'sessionoptions' option. The
|
||||
default value is "blank,buffers,curdir,folds,help,options,winsize".
|
||||
|
||||
blank keep empty windows
|
||||
buffers all buffers, not only the ones in a window
|
||||
curdir the current directory
|
||||
folds folds, also manually created ones
|
||||
help the help window
|
||||
options all options and mappings
|
||||
winsize window sizes
|
||||
|
||||
Change this to your liking. To also restore the size of the Vim window, for
|
||||
example, use: >
|
||||
|
||||
:set sessionoptions+=resize
|
||||
|
||||
|
||||
SESSION HERE, SESSION THERE
|
||||
|
||||
The obvious way to use sessions is when working on different projects.
|
||||
Suppose you store you session files in the directory "~/.vim". You are
|
||||
currently working on the "secret" project and have to switch to the "boring"
|
||||
project: >
|
||||
|
||||
:wall
|
||||
:mksession! ~/.vim/secret.vim
|
||||
:source ~/.vim/boring.vim
|
||||
|
||||
This first uses ":wall" to write all modified files. Then the current session
|
||||
is saved, using ":mksession!". This overwrites the previous session. The
|
||||
next time you load the secret session you can continue where you were at this
|
||||
point. And finally you load the new "boring" session.
|
||||
|
||||
If you open help windows, split and close various window, and generally mess
|
||||
up the window layout, you can go back to the last saved session: >
|
||||
|
||||
:source ~/.vim/boring.vim
|
||||
|
||||
Thus you have complete control over whether you want to continue next time
|
||||
where you are now, by saving the current setup in a session, or keep the
|
||||
session file as a starting point.
|
||||
Another way of using sessions is to create a window layout that you like to
|
||||
use, and save this in a session. Then you can go back to this layout whenever
|
||||
you want.
|
||||
For example, this is a nice layout to use:
|
||||
|
||||
+----------------------------------------+
|
||||
| VIM - main help file |
|
||||
| |
|
||||
|Move around: Use the cursor keys, or "h|
|
||||
|help.txt================================|
|
||||
|explorer | |
|
||||
|dir |~ |
|
||||
|dir |~ |
|
||||
|file |~ |
|
||||
|file |~ |
|
||||
|file |~ |
|
||||
|file |~ |
|
||||
|~/=========|[No File]===================|
|
||||
| |
|
||||
+----------------------------------------+
|
||||
|
||||
This has a help window at the top, so that you can read this text. The narrow
|
||||
vertical window on the left contains a file explorer. This is a Vim plugin
|
||||
that lists the contents of a directory. You can select files to edit there.
|
||||
More about this in the next chapter.
|
||||
Create this from a just started Vim with: >
|
||||
|
||||
:help
|
||||
CTRL-W w
|
||||
:vertical split ~/
|
||||
|
||||
You can resize the windows a bit to your liking. Then save the session with:
|
||||
>
|
||||
:mksession ~/.vim/mine.vim
|
||||
|
||||
Now you can start Vim with this layout: >
|
||||
|
||||
vim -S ~/.vim/mine.vim
|
||||
|
||||
Hint: To open a file you see listed in the explorer window in the empty
|
||||
window, move the cursor to the filename and press "O". Double clicking with
|
||||
the mouse will also do this.
|
||||
|
||||
|
||||
UNIX AND MS-WINDOWS
|
||||
|
||||
Some people have to do work on MS-Windows systems one day and on Unix another
|
||||
day. If you are one of them, consider adding "slash" and "unix" to
|
||||
'sessionoptions'. The session files will then be written in a format that can
|
||||
be used on both systems. This is the command to put in your vimrc file: >
|
||||
|
||||
:set sessionoptions+=unix,slash
|
||||
|
||||
Vim will use the Unix format then, because the MS-Windows Vim can read and
|
||||
write Unix files, but Unix Vim can't read MS-Windows format session files.
|
||||
Similarly, MS-Windows Vim understands file names with / to separate names, but
|
||||
Unix Vim doesn't understand \.
|
||||
|
||||
|
||||
SESSIONS AND VIMINFO
|
||||
|
||||
Sessions store many things, but not the position of marks, contents of
|
||||
registers and the command line history. You need to use the viminfo feature
|
||||
for these things.
|
||||
In most situations you will want to use sessions separately from viminfo.
|
||||
This can be used to switch to another session, but keep the command line
|
||||
history. And yank text into registers in one session, and paste it back in
|
||||
another session.
|
||||
You might prefer to keep the info with the session. You will have to do
|
||||
this yourself then. Example: >
|
||||
|
||||
:mksession! ~/.vim/secret.vim
|
||||
:wviminfo! ~/.vim/secret.viminfo
|
||||
|
||||
And to restore this again: >
|
||||
|
||||
:source ~/.vim/secret.vim
|
||||
:rviminfo! ~/.vim/secret.viminfo
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*21.5* Views
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
A session stores the looks of the whole of Vim. When you want to store the
|
||||
properties for one window only, use a view.
|
||||
The use of a view is for when you want to edit a file in a specific way.
|
||||
For example, you have line numbers enabled with the 'number' option and
|
||||
defined a few folds. Just like with sessions, you can remember this view on
|
||||
the file and restore it later. Actually, when you store a session, it stores
|
||||
the view of each window.
|
||||
There are two basic ways to use views. The first is to let Vim pick a name
|
||||
for the view file. You can restore the view when you later edit the same
|
||||
file. To store the view for the current window: >
|
||||
|
||||
:mkview
|
||||
|
||||
Vim will decide where to store the view. When you later edit the same file
|
||||
you get the view back with this command: >
|
||||
|
||||
:loadview
|
||||
|
||||
That's easy, isn't it?
|
||||
Now you want to view the file without the 'number' option on, or with all
|
||||
folds open, you can set the options to make the window look that way. Then
|
||||
store this view with: >
|
||||
|
||||
:mkview 1
|
||||
|
||||
Obviously, you can get this back with: >
|
||||
|
||||
:loadview 1
|
||||
|
||||
Now you can switch between the two views on the file by using ":loadview" with
|
||||
and without the "1" argument.
|
||||
You can store up to ten views for the same file this way, one unnumbered
|
||||
and nine numbered 1 to 9.
|
||||
|
||||
|
||||
A VIEW WITH A NAME
|
||||
|
||||
The second basic way to use views is by storing the view in a file with a name
|
||||
you chose. This view can be loaded while editing another file. Vim will then
|
||||
switch to editing the file specified in the view. Thus you can use this to
|
||||
quickly switch to editing another file, with all its options set as you saved
|
||||
them.
|
||||
For example, to save the view of the current file: >
|
||||
|
||||
:mkview ~/.vim/main.vim
|
||||
|
||||
You can restore it with: >
|
||||
|
||||
:source ~/.vim/main.vim
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*21.6* Modelines
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
When editing a specific file, you might set options specifically for that
|
||||
file. Typing these commands each time is boring. Using a session or view for
|
||||
editing a file doesn't work when sharing the file between several people.
|
||||
The solution for this situation is adding a modeline to the file. This is
|
||||
a line of text that tells Vim the values of options, to be used in this file
|
||||
only.
|
||||
A typical example is a C program where you make indents by a multiple of 4
|
||||
spaces. This requires setting the 'shiftwidth' option to 4. This modeline
|
||||
will do that:
|
||||
|
||||
/* vim:set shiftwidth=4: */ ~
|
||||
|
||||
Put this line as one of the first or last five lines in the file. When
|
||||
editing the file, you will notice that 'shiftwidth' will have been set to
|
||||
four. When editing another file, it's set back to the default value of eight.
|
||||
For some files the modeline fits well in the header, thus it can be put at
|
||||
the top of the file. For text files and other files where the modeline gets
|
||||
in the way of the normal contents, put it at the end of the file.
|
||||
|
||||
The 'modelines' option specifies how many lines at the start and end of the
|
||||
file are inspected for containing a modeline. To inspect ten lines: >
|
||||
|
||||
:set modelines=10
|
||||
|
||||
The 'modeline' option can be used to switch this off. Do this when you are
|
||||
working as root or don't trust the files you are editing: >
|
||||
|
||||
:set nomodeline
|
||||
|
||||
Use this format for the modeline:
|
||||
|
||||
any-text vim:set {option}={value} ... : any-text ~
|
||||
|
||||
The "any-text" indicates that you can put any text before and after the part
|
||||
that Vim will use. This allows making it look like a comment, like what was
|
||||
done above with /* and */.
|
||||
The " vim:" part is what makes Vim recognize this line. The must be white
|
||||
space before "vim", or "vim" must be at the start of the line. Thus using
|
||||
something like "gvim:" will not work.
|
||||
The part between the colons is a ":set" command. It works the same way as
|
||||
typing the ":set" command, except that you need to insert a backslash before a
|
||||
colon (otherwise it would be seen as the end of the modeline).
|
||||
|
||||
Another example:
|
||||
|
||||
// vim:set textwidth=72 dir=c\:\tmp: use c:\tmp here ~
|
||||
|
||||
There is an extra backslash before the first colon, so that it's included in
|
||||
the ":set" command. The text after the second colon is ignored, thus a remark
|
||||
can be placed there.
|
||||
|
||||
For more details see |modeline|.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_22.txt| Finding the file to edit
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,377 +0,0 @@
|
||||
*usr_22.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Finding the file to edit
|
||||
|
||||
|
||||
Files can be found everywhere. So how do you find them? Vim offers various
|
||||
ways to browse the directory tree. There are commands to jump to a file that
|
||||
is mentioned in another. And Vim remembers which files have been edited
|
||||
before.
|
||||
|
||||
|22.1| The file explorer
|
||||
|22.2| The current directory
|
||||
|22.3| Finding a file
|
||||
|22.4| The buffer list
|
||||
|
||||
Next chapter: |usr_23.txt| Editing other files
|
||||
Previous chapter: |usr_21.txt| Go away and come back
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*22.1* The file explorer
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Vim has a plugin that makes it possible to edit a directory. Try this: >
|
||||
|
||||
:edit .
|
||||
|
||||
Through the magic of autocommands and Vim scripts, the window will be filled
|
||||
with the contents of the directory. It looks like this:
|
||||
|
||||
" Press ? for keyboard shortcuts ~
|
||||
" Sorted by name (.bak,~,.o,.h,.info,.swp,.obj,.orig,.rej at end of list) ~
|
||||
"= /home/mool/vim/vim6/runtime/doc/ ~
|
||||
../ ~
|
||||
check/ ~
|
||||
Makefile ~
|
||||
autocmd.txt ~
|
||||
change.txt ~
|
||||
eval.txt~ ~
|
||||
filetype.txt~ ~
|
||||
help.txt.info ~
|
||||
|
||||
You can see these items:
|
||||
1. A comment about using ? to get help for the functionality of the file
|
||||
explorer.
|
||||
2. The second line mentions how the items in the directory are listed. They
|
||||
can be sorted in several ways.
|
||||
3. The third line is the name of the current directory.
|
||||
4. The "../" directory item. This is the parent directory.
|
||||
5. The directory names.
|
||||
6. The ordinary file names. As mentioned in the second line, some are not
|
||||
here but "at the end of the list".
|
||||
7. The less ordinary file names. You are expected to use these less often,
|
||||
therefore they have been moved to the end.
|
||||
|
||||
If you have syntax highlighting enabled, the different parts are highlighted
|
||||
to make it easier to spot them.
|
||||
|
||||
You can use Normal mode Vim commands to move around in the text. For example,
|
||||
move to a file and press <Enter>. Now you are editing that file. To go back
|
||||
to the explorer use ":edit ." again. CTRL-O also works.
|
||||
Try using <Enter> while the cursor is on a directory name. The result is
|
||||
that the explorer moves into that directory and displays the items found
|
||||
there. Pressing <Enter> on the first directory "../" moves you one level
|
||||
higher. Pressing "-" does the same thing, without the need to move to the
|
||||
"../" item first.
|
||||
|
||||
You can press ? to get short help on the things you can do in the explorer.
|
||||
This is what you get:
|
||||
|
||||
" <enter> : open file or directory ~
|
||||
" o : open new window for file/directory ~
|
||||
" O : open file in previously visited window ~
|
||||
" p : preview the file ~
|
||||
" i : toggle size/date listing ~
|
||||
" s : select sort field r : reverse sort ~
|
||||
" - : go up one level c : cd to this dir ~
|
||||
" R : rename file D : delete file ~
|
||||
" :help file-explorer for detailed help ~
|
||||
|
||||
The first few commands are for selecting a file to display. Depending on what
|
||||
command you use, the file appears somewhere:
|
||||
|
||||
<Enter> Uses the current window.
|
||||
o Opens a new window.
|
||||
O Uses the previously visited window.
|
||||
p Uses the preview window, and moves the cursor back
|
||||
into the explorer window. |preview-window|
|
||||
|
||||
The following commands are used to display other information:
|
||||
|
||||
i Display the size and date for the file. Using i again
|
||||
will hide the information.
|
||||
s Use the field the cursor is in to sort on. First
|
||||
display the size and date with i. Then Move the
|
||||
cursor to the size of any file and press s. The files
|
||||
will now be sorted on size. Press s wile the cursor
|
||||
is on a date and the items will be sorted on date.
|
||||
r reverse the sorting order (either size or date)
|
||||
|
||||
There are a few extra commands:
|
||||
|
||||
c Change the current directory to the displayed
|
||||
directory. You can then type an ":edit" command for
|
||||
one of the files without prepending the path.
|
||||
R Rename the file under the cursor. You will be
|
||||
prompted for the new name.
|
||||
D Delete the file under the cursor. You will get a
|
||||
prompt to confirm this.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*22.2* The current directory
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Just like the shell, Vim has the concept of a current directory. Suppose you
|
||||
are in your home directory and want to edit several files in a directory
|
||||
"VeryLongFileName". You could do: >
|
||||
|
||||
:edit VeryLongFileName/file1.txt
|
||||
:edit VeryLongFileName/file2.txt
|
||||
:edit VeryLongFileName/file3.txt
|
||||
|
||||
To avoid much of the typing, do this: >
|
||||
|
||||
:cd VeryLongFileName
|
||||
:edit file1.txt
|
||||
:edit file2.txt
|
||||
:edit file3.txt
|
||||
|
||||
The ":cd" command changes the current directory. You can see what the current
|
||||
directory is with the ":pwd" command: >
|
||||
|
||||
:pwd
|
||||
/home/Bram/VeryLongFileName
|
||||
|
||||
Vim remembers the last directory that you used. Use "cd -" to go back to it.
|
||||
Example: >
|
||||
|
||||
:pwd
|
||||
/home/Bram/VeryLongFileName
|
||||
:cd /etc
|
||||
:pwd
|
||||
/etc
|
||||
:cd -
|
||||
:pwd
|
||||
/home/Bram/VeryLongFileName
|
||||
:cd -
|
||||
:pwd
|
||||
/etc
|
||||
|
||||
|
||||
WINDOW LOCAL DIRECTORY
|
||||
|
||||
When you split a window, both windows use the same current directory. When
|
||||
you want to edit a number of files somewhere else in the new window, you can
|
||||
make it use a different directory, without changing the current directory in
|
||||
the other window. This is called a local directory. >
|
||||
|
||||
:pwd
|
||||
/home/Bram/VeryLongFileName
|
||||
:split
|
||||
:lcd /etc
|
||||
:pwd
|
||||
/etc
|
||||
CTRL-W w
|
||||
:pwd
|
||||
/home/Bram/VeryLongFileName
|
||||
|
||||
So long as no ":lcd" command has been used, all windows share the same current
|
||||
directory. Doing a ":cd" command in one window will also change the current
|
||||
directory of the other window.
|
||||
For a window where ":lcd" has been used a different current directory is
|
||||
remembered. Using ":cd" or ":lcd" in other windows will not change it.
|
||||
When using a ":cd" command in a window that uses a different current
|
||||
directory, it will go back to using the shared directory.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*22.3* Finding a file
|
||||
|
||||
<!--
|
||||
You are editing a C program that contains this line:
|
||||
|
||||
#include "inits.h" ~
|
||||
|
||||
You want to see what is in that "inits.h" file. Move the cursor on the name
|
||||
of the file and type: >
|
||||
|
||||
gf
|
||||
|
||||
Vim will find the file and edit it.
|
||||
What if the file is not in the current directory? Vim will use the 'path'
|
||||
option to find the file. This option is a list of directory names where to
|
||||
look for your file.
|
||||
Suppose you have your include files located in "c:/prog/include". This
|
||||
command will add it to the 'path' option: >
|
||||
|
||||
:set path+=c:/prog/include
|
||||
|
||||
This directory is an absolute path. No matter where you are, it will be the
|
||||
same place. What if you have located files in a subdirectory, below where the
|
||||
file is? Then you can specify a relative path name. This starts with a dot:
|
||||
>
|
||||
:set path+=./proto
|
||||
|
||||
This tells Vim to look in the directory "proto", below the directory where the
|
||||
file in which you use "gf" is. Thus using "gf" on "inits.h" will make Vim
|
||||
look for "proto/inits.h", starting in the directory of the file.
|
||||
Without the "./", thus "proto", Vim would look in the "proto" directory
|
||||
below the current directory. And the current directory might not be where the
|
||||
file that you are editing is located.
|
||||
|
||||
The 'path' option allows specifying the directories where to search for files
|
||||
in many more ways. See the help on the 'path' option.
|
||||
The 'isfname' option is used to decide which characters are included in the
|
||||
file name, and which ones are not (e.g., the " character in the example
|
||||
above).
|
||||
|
||||
-->
|
||||
When you know the file name, but it's not to be found in the file, you can
|
||||
type it: >
|
||||
|
||||
:find inits.h
|
||||
<!--
|
||||
|
||||
Vim will then use the 'path' option to try and locate the file. This is the
|
||||
same as the ":edit" command, except for the use of 'path'.
|
||||
|
||||
To open the found file in a new window use CTRL-W f instead of "gf", or use
|
||||
":sfind" instead of ":find".
|
||||
|
||||
|
||||
A nice way to directly start Vim to edit a file somewhere in the 'path': >
|
||||
|
||||
vim "+find stdio.h"
|
||||
|
||||
This finds the file "stdio.h" in your value of 'path'. The quotes are
|
||||
necessary to have one argument |-+c|.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*22.4* The buffer list
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
The Vim editor uses the term buffer to describe a file being edited.
|
||||
Actually, a buffer is a copy of the file that you edit. When you finish
|
||||
changing the buffer, you write the contents of the buffer to the file.
|
||||
Buffers not only contain file contents, but also all the marks, settings, and
|
||||
other stuff that goes with it.
|
||||
|
||||
|
||||
HIDDEN BUFFERS
|
||||
|
||||
Suppose you are editing the file one.txt and need to edit the file two.txt.
|
||||
You could simply use ":edit two.txt", but since you made changes to one.txt
|
||||
that won't work. You also don't want to write one.txt yet. Vim has a
|
||||
solution for you: >
|
||||
|
||||
:hide edit two.txt
|
||||
|
||||
The buffer "one.txt" disappears from the screen, but Vim still knows that you
|
||||
are editing this buffer, so it keeps the modified text. This is called a
|
||||
hidden buffer: The buffer contains text, but you can't see it.
|
||||
The ":hide" command argument is another command. It makes that command
|
||||
behave like the 'hidden' option was set. You could also set this option
|
||||
yourself. The effect is that when any buffer is abandoned, it becomes hidden.
|
||||
Be careful! When you have hidden buffers with changes, don't exit Vim
|
||||
without making sure you have saved all the buffers.
|
||||
|
||||
|
||||
INACTIVE BUFFERS
|
||||
|
||||
When a buffer has been used once, Vim remembers some information about it.
|
||||
When it is not displayed in a window and it is not hidden, it is still in the
|
||||
buffer list. This is called an inactive buffer. Overview:
|
||||
|
||||
Active Appears in a window, text loaded.
|
||||
Hidden Not in a window, text loaded.
|
||||
Inactive Not in a window, no text loaded.
|
||||
|
||||
The inactive buffers are remembered, because Vim keeps information about them,
|
||||
like marks. And remembering the file name is useful too, so that you can see
|
||||
which files you have edited. And edit them again.
|
||||
|
||||
|
||||
LISTING BUFFERS
|
||||
|
||||
View the buffer list with this command: >
|
||||
|
||||
:buffers
|
||||
|
||||
A command which does the same, is not so obvious to list buffers, but is much
|
||||
shorter to type: >
|
||||
|
||||
:ls
|
||||
|
||||
The output could look like this:
|
||||
|
||||
1 #h "help.txt" line 62 ~
|
||||
2 %l+ "usr_21.txt" line 1 ~
|
||||
3 "usr_toc.txt" line 1 ~
|
||||
|
||||
The first column contains the buffer number. You can use this to edit the
|
||||
buffer without having to type the name, see below.
|
||||
After the buffer number come the flags. Then the name of the file
|
||||
and the line number where the cursor was the last time.
|
||||
The flags that can appear are these (from left to right):
|
||||
|
||||
u Buffer is unlisted |unlisted-buffer|.
|
||||
% Current buffer.
|
||||
# Alternate buffer.
|
||||
l Buffer is loaded and displayed.
|
||||
h Buffer is loaded but hidden.
|
||||
= Buffer is read-only.
|
||||
- Buffer is not modifiable, the 'modifiable' option is off.
|
||||
+ Buffer has been modified.
|
||||
|
||||
|
||||
EDITING A BUFFER
|
||||
|
||||
You can edit a buffer by its number. That avoids having to type the file
|
||||
name: >
|
||||
|
||||
:buffer 2
|
||||
|
||||
But the only way to know the number is by looking in the buffer list. You can
|
||||
use the name, or part of it, instead: >
|
||||
|
||||
:buffer help
|
||||
|
||||
Vim will find a best match for the name you type. If there is only one
|
||||
buffer that matches the name, it will be used. In this case "help.txt".
|
||||
To open a buffer in a new window: >
|
||||
|
||||
:sbuffer 3
|
||||
|
||||
This works with a name as well.
|
||||
|
||||
|
||||
USING THE BUFFER LIST
|
||||
|
||||
You can move around in the buffer list with these commands:
|
||||
|
||||
:bnext go to next buffer
|
||||
:bprevious go to previous buffer
|
||||
:bfirst go to the first buffer
|
||||
:blast go to the last buffer
|
||||
|
||||
To remove a buffer from the list, use this command: >
|
||||
|
||||
:bdelete 3
|
||||
|
||||
Again, this also works with a name.
|
||||
If you delete a buffer that was active (visible in a window), that window
|
||||
will be closed. If you delete the current buffer, the current window will be
|
||||
closed. If it was the last window, Vim will find another buffer to edit. You
|
||||
can't be editing nothing!
|
||||
|
||||
Note:
|
||||
Even after removing the buffer with ":bdelete" Vim still remembers it.
|
||||
It's actually made "unlisted", it no longer appears in the list from
|
||||
":buffers". The ":buffers!" command will list unlisted buffers (yes,
|
||||
Vim can do the impossible). To really make Vim forget about a buffer,
|
||||
use ":bwipe". Also see the 'buflisted' option.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_23.txt| Editing other files
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,346 +0,0 @@
|
||||
*usr_23.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Editing other files
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
This chapter is about editing files that are not ordinary files. With Vim you
|
||||
can edit files that are compressed or encrypted. Some files need to be
|
||||
accessed over the internet. With some restrictions, binary files can be
|
||||
edited as well.
|
||||
|
||||
|23.1| DOS, Mac and Unix files
|
||||
|23.2| Files on the internet
|
||||
|23.3| Encryption
|
||||
|23.4| Binary files
|
||||
|23.5| Compressed files
|
||||
|
||||
Next chapter: |usr_24.txt| Inserting quickly
|
||||
Previous chapter: |usr_22.txt| Finding the file to edit
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*23.1* DOS, Mac and Unix files
|
||||
|
||||
Back in the early days, the old Teletype machines used two characters to
|
||||
start a new line. One to move the carriage back to the first position
|
||||
(carriage return, <CR>), another to move the paper up (line feed, <LF>).
|
||||
When computers came out, storage was expensive. Some people decided that
|
||||
they did not need two characters for end-of-line. The UNIX people decided
|
||||
they could use <Line Feed> only for end-of-line. The Apple people
|
||||
standardized on <CR>. The MS-DOS (and Microsoft Windows) folks decided to
|
||||
keep the old <CR><LF>.
|
||||
This means that if you try to move a file from one system to another, you
|
||||
have line-break problems. The Vim editor automatically recognizes the
|
||||
different file formats and handles things properly behind your back.
|
||||
The option 'fileformats' contains the various formats that will be tried
|
||||
when a new file is edited. The following command, for example, tells Vim to
|
||||
try UNIX format first and MS-DOS format second: >
|
||||
|
||||
:set fileformats=unix,dos
|
||||
|
||||
You will notice the format in the message you get when editing a file. You
|
||||
don't see anything if you edit a native file format. Thus editing a Unix file
|
||||
on Unix won't result in a remark. But when you edit a dos file, Vim will
|
||||
notify you of this:
|
||||
|
||||
"/tmp/test" [dos] 3L, 71C ~
|
||||
|
||||
For a Mac file you would see "[mac]".
|
||||
The detected file format is stored in the 'fileformat' option. To see
|
||||
which format you have, execute the following command: >
|
||||
|
||||
:set fileformat?
|
||||
|
||||
The three names that Vim uses are:
|
||||
|
||||
unix <LF>
|
||||
dos <CR><LF>
|
||||
mac <CR>
|
||||
|
||||
|
||||
USING THE MAC FORMAT
|
||||
|
||||
On Unix, <LF> is used to break a line. It's not unusual to have a <CR>
|
||||
character halfway a line. Incidentally, this happens quite often in Vi (and
|
||||
Vim) scripts.
|
||||
On the Macintosh, where <CR> is the line break character, it's possible to
|
||||
have a <LF> character halfway a line.
|
||||
The result is that it's not possible to be 100% sure whether a file
|
||||
containing both <CR> and <LF> characters is a Mac or a Unix file. Therefore,
|
||||
Vim assumes that on Unix you probably won't edit a Mac file, and doesn't check
|
||||
for this type of file. To check for this format anyway, add "mac" to
|
||||
'fileformats': >
|
||||
|
||||
:set fileformats+=mac
|
||||
|
||||
Then Vim will take a guess at the file format. Watch out for situations where
|
||||
Vim guesses wrong.
|
||||
|
||||
|
||||
OVERRULING THE FORMAT
|
||||
|
||||
If you use the good old Vi and try to edit an MS-DOS format file, you will
|
||||
find that each line ends with a ^M character. (^M is <CR>). The automatic
|
||||
detection avoids this. Suppose you do want to edit the file that way? Then
|
||||
you need to overrule the format: >
|
||||
|
||||
:edit ++ff=unix file.txt
|
||||
|
||||
The "++" string is an item that tells Vim that an option name follows, which
|
||||
overrules the default for this single command. "++ff" is used for
|
||||
'fileformat'. You could also use "++ff=mac" or "++ff=dos".
|
||||
This doesn't work for any option, only "++ff" and "++enc" are currently
|
||||
implemented. The full names "++fileformat" and "++encoding" also work.
|
||||
|
||||
|
||||
CONVERSION
|
||||
|
||||
You can use the 'fileformat' option to convert from one file format to
|
||||
another. Suppose, for example, that you have an MS-DOS file named README.TXT
|
||||
that you want to convert to UNIX format. Start by editing the MS-DOS format
|
||||
file: >
|
||||
vim README.TXT
|
||||
|
||||
Vim will recognize this as a dos format file. Now change the file format to
|
||||
UNIX: >
|
||||
|
||||
:set fileformat=unix
|
||||
:write
|
||||
|
||||
The file is written in Unix format.
|
||||
|
||||
==============================================================================
|
||||
*23.2* Files on the internet
|
||||
|
||||
Someone sends you an e-mail message, which refers to a file by its URL. For
|
||||
example:
|
||||
|
||||
You can find the information here: ~
|
||||
ftp://ftp.vim.org/pub/vim/README ~
|
||||
|
||||
You could start a program to download the file, save it on your local disk and
|
||||
then start Vim to edit it.
|
||||
There is a much simpler way. Move the cursor to any character of the URL.
|
||||
Then use this command: >
|
||||
|
||||
gf
|
||||
|
||||
With a bit of luck, Vim will figure out which program to use for downloading
|
||||
the file, download it and edit the copy. To open the file in a new window use
|
||||
CTRL-W f.
|
||||
If something goes wrong you will get an error message. It's possible that
|
||||
the URL is wrong, you don't have permission to read it, the network connection
|
||||
is down, etc. Unfortunately, it's hard to tell the cause of the error. You
|
||||
might want to try the manual way of downloading the file.
|
||||
|
||||
Accessing files over the internet works with the netrw plugin. Currently URLs
|
||||
with these formats are recognized:
|
||||
|
||||
ftp:// uses ftp
|
||||
rcp:// uses rcp
|
||||
scp:// uses scp
|
||||
http:// uses wget (reading only)
|
||||
|
||||
Vim doesn't do the communication itself, it relies on the mentioned programs
|
||||
to be available on your computer. On most Unix systems "ftp" and "rcp" will
|
||||
be present. "scp" and "wget" might need to be installed.
|
||||
|
||||
Vim detects these URLs for each command that starts editing a new file, also
|
||||
with ":edit" and ":split", for example. Write commands also work, except for
|
||||
http://.
|
||||
|
||||
For more information, also about passwords, see |netrw|.
|
||||
|
||||
==============================================================================
|
||||
*23.3* Encryption
|
||||
|
||||
Some information you prefer to keep to yourself. For example, when writing
|
||||
a test on a computer that students also use. You don't want clever students
|
||||
to figure out a way to read the questions before the exam starts. Vim can
|
||||
encrypt the file for you, which gives you some protection.
|
||||
To start editing a new file with encryption, use the "-x" argument to start
|
||||
Vim. Example: >
|
||||
|
||||
vim -x exam.txt
|
||||
|
||||
Vim prompts you for a key used for encrypting and decrypting the file:
|
||||
|
||||
Enter encryption key: ~
|
||||
|
||||
Carefully type the secret key now. You cannot see the characters you type,
|
||||
they will be replaced by stars. To avoid the situation that a typing mistake
|
||||
will cause trouble, Vim asks you to enter the key again:
|
||||
|
||||
Enter same key again: ~
|
||||
|
||||
You can now edit this file normally and put in all your secrets. When you
|
||||
finish editing the file and tell Vim to exit, the file is encrypted and
|
||||
written.
|
||||
When you edit the file with Vim, it will ask you to enter the same key
|
||||
again. You don't need to use the "-x" argument. You can also use the normal
|
||||
":edit" command. Vim adds a magic string to the file by which it recognizes
|
||||
that the file was encrypted.
|
||||
If you try to view this file using another program, all you get is garbage.
|
||||
Also, if you edit the file with Vim and enter the wrong key, you get garbage.
|
||||
Vim does not have a mechanism to check if the key is the right one (this makes
|
||||
it much harder to break the key).
|
||||
|
||||
|
||||
SWITCHING ENCRYPTION ON AND OFF
|
||||
|
||||
To disable the encryption of a file, set the 'key' option to an empty string:
|
||||
>
|
||||
:set key=
|
||||
|
||||
The next time you write the file this will be done without encryption.
|
||||
Setting the 'key' option to enable encryption is not a good idea, because
|
||||
the password appears in the clear. Anyone shoulder-surfing can read your
|
||||
password.
|
||||
To avoid this problem, the ":X" command was created. It asks you for an
|
||||
encryption key, just like the "-x" argument did: >
|
||||
|
||||
:X
|
||||
Enter encryption key: ******
|
||||
Enter same key again: ******
|
||||
|
||||
|
||||
LIMITS ON ENCRYPTION
|
||||
|
||||
The encryption algorithm used by Vim is weak. It is good enough to keep out
|
||||
the casual prowler, but not good enough to keep out a cryptology expert with
|
||||
lots of time on his hands. Also you should be aware that the swap file is not
|
||||
encrypted; so while you are editing, people with superuser privileges can read
|
||||
the unencrypted text from this file.
|
||||
One way to avoid letting people read your swap file is to avoid using one.
|
||||
If the -n argument is supplied on the command line, no swap file is used
|
||||
(instead, Vim puts everything in memory). For example, to edit the encrypted
|
||||
file "file.txt" without a swap file use the following command: >
|
||||
|
||||
vim -x -n file.txt
|
||||
|
||||
When already editing a file, the swapfile can be disabled with: >
|
||||
|
||||
:setlocal noswapfile
|
||||
|
||||
Since there is no swapfile, recovery will be impossible. Save the file a bit
|
||||
more often to avoid the risk of losing your changes.
|
||||
|
||||
While the file is in memory, it is in plain text. Anyone with privilege can
|
||||
look in the editor's memory and discover the contents of the file.
|
||||
If you use a viminfo file, be aware that the contents of text registers are
|
||||
written out in the clear as well.
|
||||
If you really want to secure the contents of a file, edit it only on a
|
||||
portable computer not connected to a network, use good encryption tools, and
|
||||
keep the computer locked up in a big safe when not in use.
|
||||
|
||||
==============================================================================
|
||||
*23.4* Binary files
|
||||
|
||||
You can edit binary files with Vim. Vim wasn't really made for this, thus
|
||||
there are a few restrictions. But you can read a file, change a character and
|
||||
write it back, with the result that only that one character was changed and
|
||||
the file is identical otherwise.
|
||||
To make sure that Vim does not use its clever tricks in the wrong way, add
|
||||
the "-b" argument when starting Vim: >
|
||||
|
||||
vim -b datafile
|
||||
|
||||
This sets the 'binary' option. The effect of this is that unexpected side
|
||||
effects are turned off. For example, 'textwidth' is set to zero, to avoid
|
||||
automatic formatting of lines. And files are always read in Unix file format.
|
||||
|
||||
Binary mode can be used to change a message in a program. Be careful not to
|
||||
insert or delete any characters, it would stop the program from working. Use
|
||||
"R" to enter replace mode.
|
||||
|
||||
Many characters in the file will be unprintable. To see them in Hex format: >
|
||||
|
||||
:set display=uhex
|
||||
|
||||
Otherwise, the "ga" command can be used to see the value of the character
|
||||
under the cursor. The output, when the cursor is on an <Esc>, looks like
|
||||
this:
|
||||
|
||||
<^[> 27, Hex 1b, Octal 033 ~
|
||||
|
||||
There might not be many line breaks in the file. To get some overview switch
|
||||
the 'wrap' option off: >
|
||||
|
||||
:set nowrap
|
||||
|
||||
|
||||
BYTE POSITION
|
||||
|
||||
To see on which byte you are in the file use this command: >
|
||||
|
||||
g CTRL-G
|
||||
|
||||
The output is verbose:
|
||||
|
||||
Col 9-16 of 9-16; Line 277 of 330; Word 1806 of 2058; Byte 10580 of 12206 ~
|
||||
|
||||
The last two numbers are the byte position in the file and the total number of
|
||||
bytes. This takes into account how 'fileformat' changes the number of bytes
|
||||
that a line break uses.
|
||||
To move to a specific byte in the file, use the "go" command. For
|
||||
example, to move to byte 2345: >
|
||||
|
||||
2345go
|
||||
|
||||
|
||||
USING XXD
|
||||
|
||||
A real binary editor shows the text in two ways: as it is and in hex format.
|
||||
You can do this in Vim by first converting the file with the "xxd" program.
|
||||
This comes with Vim.
|
||||
First edit the file in binary mode: >
|
||||
|
||||
vim -b datafile
|
||||
|
||||
Now convert the file to a hex dump with xxd: >
|
||||
|
||||
:%!xxd
|
||||
|
||||
The text will look like this:
|
||||
|
||||
0000000: 1f8b 0808 39d7 173b 0203 7474 002b 4e49 ....9..;..tt.+NI ~
|
||||
0000010: 4b2c 8660 eb9c ecac c462 eb94 345e 2e30 K,.`.....b..4^.0 ~
|
||||
0000020: 373b 2731 0b22 0ca6 c1a2 d669 1035 39d9 7;'1.".....i.59. ~
|
||||
|
||||
You can now view and edit the text as you like. Vim treats the information as
|
||||
ordinary text. Changing the hex does not cause the printable character to be
|
||||
changed, or the other way around.
|
||||
Finally convert it back with:
|
||||
>
|
||||
:%!xxd -r
|
||||
|
||||
Only changes in the hex part are used. Changes in the printable text part on
|
||||
the right are ignored.
|
||||
|
||||
See the manual page of xxd for more information.
|
||||
|
||||
==============================================================================
|
||||
*23.5* Compressed files
|
||||
|
||||
This is easy: You can edit a compressed file just like any other file. The
|
||||
"gzip" plugin takes care of decompressing the file when you edit it. And
|
||||
compressing it again when you write it.
|
||||
These compression methods are currently supported:
|
||||
|
||||
.Z compress
|
||||
.gz gzip
|
||||
.bz2 bzip2
|
||||
|
||||
Vim uses the mentioned programs to do the actual compression and
|
||||
decompression. You might need to install the programs first.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_24.txt| Inserting quickly
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,590 +0,0 @@
|
||||
*usr_24.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Inserting quickly
|
||||
|
||||
|
||||
When entering text, Vim offers various ways to reduce the number of keystrokes
|
||||
and avoid typing mistakes. Use Insert mode completion to repeat previously
|
||||
typed words. Abbreviate long words to short ones. Type characters that
|
||||
aren't on your keyboard.
|
||||
|
||||
|24.1| Making corrections
|
||||
|24.2| Showing matches
|
||||
|24.3| Completion
|
||||
|24.4| Repeating an insert
|
||||
|24.5| Copying from another line
|
||||
|24.6| Inserting a register
|
||||
|24.7| Abbreviations
|
||||
|24.8| Entering special characters
|
||||
|24.9| Digraphs
|
||||
|24.10| Normal mode commands
|
||||
|
||||
Next chapter: |usr_25.txt| Editing formatted text
|
||||
Previous chapter: |usr_23.txt| Editing other files
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*24.1* Making corrections
|
||||
|
||||
The <BS> key was already mentioned. It deletes the character just before the
|
||||
cursor. The <Del> key does the same for the character under (after) the
|
||||
cursor.
|
||||
When you typed a whole word wrong, use CTRL-W:
|
||||
|
||||
The horse had fallen to the sky ~
|
||||
CTRL-W
|
||||
The horse had fallen to the ~
|
||||
|
||||
If you really messed up a line and want to start over, use CTRL-U to delete
|
||||
it. This keeps the text after the cursor and the indent. Only the text from
|
||||
the first non-blank to the cursor is deleted. With the cursor on the "f" of
|
||||
"fallen" in the next line pressing CTRL-U does this:
|
||||
|
||||
The horse had fallen to the ~
|
||||
CTRL-U
|
||||
fallen to the ~
|
||||
|
||||
When you spot a mistake a few words back, you need to move the cursor there to
|
||||
correct it. For example, you typed this:
|
||||
|
||||
The horse had follen to the ground ~
|
||||
|
||||
You need to change "follen" to "fallen". With the cursor at the end, you
|
||||
would type this to correct it: >
|
||||
|
||||
<Esc>4blraA
|
||||
|
||||
< get out of Insert mode <Esc>
|
||||
four words back 4b
|
||||
move on top of the "o" l
|
||||
replace with "a" ra
|
||||
restart Insert mode A
|
||||
|
||||
Another way to do this: >
|
||||
|
||||
<C-Left><C-Left><C-Left><C-Left><Right><Del>a<End>
|
||||
|
||||
< four words back <C-Left><C-Left><C-Left><C-Left>
|
||||
move on top of the "o" <Right>
|
||||
delete the "o" <Del>
|
||||
insert an "a" a
|
||||
go to end of the line <End>
|
||||
|
||||
This uses special keys to move around, while remaining in Insert mode. This
|
||||
resembles what you would do in a modeless editor. It's easier to remember,
|
||||
but takes more time (you have to move your hand from the letters to the cursor
|
||||
keys, and the <End> key is hard to press without looking at the keyboard).
|
||||
These special keys are most useful when writing a mapping that doesn't
|
||||
leave Insert mode. The extra typing doesn't matter then.
|
||||
An overview of the keys you can use in Insert mode:
|
||||
|
||||
<C-Home> to start of the file
|
||||
<PageUp> a whole screenful up
|
||||
<Home> to start of line
|
||||
<S-Left> one word left
|
||||
<C-Left> one word left
|
||||
<S-Right> one word right
|
||||
<C-Right> one word right
|
||||
<End> to end of the line
|
||||
<PageDown> a whole screenful down
|
||||
<C-End> to end of the file
|
||||
|
||||
There are a few more, see |ins-special-special|.
|
||||
|
||||
==============================================================================
|
||||
*24.2* Showing matches
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
When you type a ) it would be nice to see with which ( it matches. To make
|
||||
Vim do that use this command: >
|
||||
|
||||
:set showmatch
|
||||
|
||||
When you now type a text like "(example)", as soon as you type the ) Vim will
|
||||
briefly move the cursor to the matching (, keep it there for half a second,
|
||||
and move back to where you were typing.
|
||||
In case there is not matching (, Vim will beep. Then you know that you
|
||||
might have forgotten the ( somewhere, or typed a ) too many.
|
||||
The match will also be shown for [] and {} pairs. You don't have to wait
|
||||
with typing the next character, as soon as Vim sees it the cursor will move
|
||||
back and inserting continues as before.
|
||||
You can change the time Vim waits with the 'matchtime' option. For
|
||||
example, to make Vim wait one and a half second: >
|
||||
|
||||
:set matchtime=15
|
||||
|
||||
The time is specified in tenths of a second.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*24.3* Completion
|
||||
|
||||
This information does not apply to IdeaVim. Use IDE's code completion features.
|
||||
<!--
|
||||
Vim can automatically complete words on insertion. You type the first part of
|
||||
a word, press CTRL-P, and Vim guesses the rest.
|
||||
Suppose, for example, that you are creating a C program and want to type in
|
||||
the following:
|
||||
|
||||
total = ch_array[0] + ch_array[1] + ch_array[2]; ~
|
||||
|
||||
You start by entering the following:
|
||||
|
||||
total = ch_array[0] + ch_ ~
|
||||
|
||||
At this point, you tell Vim to complete the word using the command CTRL-P.
|
||||
Vim searches for a word that starts with what's in front of the cursor. In
|
||||
this case, it is "ch_", which matches with the word ch_array. So typing
|
||||
CTRL-P gives you the following:
|
||||
|
||||
total = ch_array[0] + ch_array ~
|
||||
|
||||
After a little more typing, you get this (ending in a space):
|
||||
|
||||
total = ch_array[0] + ch_array[1] + ~
|
||||
|
||||
If you now type CTRL-P Vim will search again for a word that completes the
|
||||
word before the cursor. Since there is nothing in front of the cursor, it
|
||||
finds the first word backwards, which is "ch_array". Typing CTRL-P again
|
||||
gives you the next word that matches, in this case "total". A third CTRL-P
|
||||
searches further back. If there is nothing else, it causes the editor to run
|
||||
out of words, so it returns to the original text, which is nothing. A fourth
|
||||
CTRL-P causes the editor to start over again with "ch_array".
|
||||
|
||||
To search forward, use CTRL-N. Since the search wraps around the end of the
|
||||
file, CTRL-N and CTRL-P will find the same matches, but in a different
|
||||
sequence. Hint: CTRL-N is Next-match and CTRL-P is Previous-match.
|
||||
|
||||
The Vim editor goes through a lot of effort to find words to complete. By
|
||||
default, it searches the following places:
|
||||
|
||||
1. Current file
|
||||
2. Files in other windows
|
||||
3. Other loaded files (hidden buffers)
|
||||
4. Files which are not loaded (inactive buffers)
|
||||
5. Tag files
|
||||
6. All files #included by the current file
|
||||
|
||||
|
||||
OPTIONS
|
||||
|
||||
You can customize the search order with the 'complete' option.
|
||||
|
||||
The 'ignorecase' option is used. When it is set, case differences are ignored
|
||||
when searching for matches.
|
||||
|
||||
A special option for completion is 'infercase'. This is useful to find
|
||||
matches while ignoring case ('ignorecase' must be set) but still using the
|
||||
case of the word typed so far. Thus if you type "For" and Vim finds a match
|
||||
"fortunately", it will result in "Fortunately".
|
||||
|
||||
|
||||
COMPLETING SPECIFIC ITEMS
|
||||
|
||||
If you know what you are looking for, you can use these commands to complete
|
||||
with a certain type of item:
|
||||
|
||||
CTRL-X CTRL-F file names
|
||||
CTRL-X CTRL-L whole lines
|
||||
CTRL-X CTRL-D macro definitions (also in included files)
|
||||
CTRL-X CTRL-I current and included files
|
||||
CTRL-X CTRL-K words from a dictionary
|
||||
CTRL-X CTRL-T words from a thesaurus
|
||||
CTRL-X CTRL-] tags
|
||||
CTRL-X CTRL-V Vim command line
|
||||
|
||||
After each of them CTRL-N can be used to find the next match, CTRL-P to find
|
||||
the previous match.
|
||||
More information for each of these commands here: |ins-completion|.
|
||||
|
||||
|
||||
COMPLETING FILE NAMES
|
||||
|
||||
Let's take CTRL-X CTRL-F as an example. This will find file names. It scans
|
||||
the current directory for files and displays each one that matches the word in
|
||||
front of the cursor.
|
||||
Suppose, for example, that you have the following files in the current
|
||||
directory:
|
||||
|
||||
main.c sub_count.c sub_done.c sub_exit.c
|
||||
|
||||
Now enter Insert mode and start typing:
|
||||
|
||||
The exit code is in the file sub ~
|
||||
|
||||
At this point, you enter the command CTRL-X CTRL-F. Vim now completes the
|
||||
current word "sub" by looking at the files in the current directory. The
|
||||
first match is sub_count.c. This is not the one you want, so you match the
|
||||
next file by typing CTRL-N. This match is sub_done.c. Typing CTRL-N again
|
||||
takes you to sub_exit.c. The results:
|
||||
|
||||
The exit code is in the file sub_exit.c ~
|
||||
|
||||
If the file name starts with / (Unix) or C:\ (MS-Windows) you can find all
|
||||
files in the file system. For example, type "/u" and CTRL-X CTRL-F. This
|
||||
will match "/usr" (this is on Unix):
|
||||
|
||||
the file is found in /usr/ ~
|
||||
|
||||
If you now press CTRL-N you go back to "/u". Instead, to accept the "/usr/"
|
||||
and go one directory level deeper, use CTRL-X CTRL-F again:
|
||||
|
||||
the file is found in /usr/X11R6/ ~
|
||||
|
||||
The results depend on what is found in your file system, of course. The
|
||||
matches are sorted alphabetically.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*24.4* Repeating an insert
|
||||
|
||||
If you press CTRL-A, the editor inserts the text you typed the last time you
|
||||
were in Insert mode.
|
||||
Assume, for example, that you have a file that begins with the following:
|
||||
|
||||
"file.h" ~
|
||||
/* Main program begins */ ~
|
||||
|
||||
You edit this file by inserting "#include " at the beginning of the first
|
||||
line:
|
||||
|
||||
#include "file.h" ~
|
||||
/* Main program begins */ ~
|
||||
|
||||
You go down to the beginning of the next line using the commands "j^". You
|
||||
now start to insert a new "#include" line. So you type: >
|
||||
|
||||
i CTRL-A
|
||||
|
||||
The result is as follows:
|
||||
|
||||
#include "file.h" ~
|
||||
#include /* Main program begins */ ~
|
||||
|
||||
The "#include " was inserted because CTRL-A inserts the text of the previous
|
||||
insert. Now you type "main.h"<Enter> to finish the line:
|
||||
|
||||
|
||||
#include "file.h" ~
|
||||
#include "main.h" ~
|
||||
/* Main program begins */ ~
|
||||
|
||||
The CTRL-@ command does a CTRL-A and then exits Insert mode. That's a quick
|
||||
way of doing exactly the same insertion again.
|
||||
|
||||
==============================================================================
|
||||
*24.5* Copying from another line
|
||||
|
||||
The CTRL-Y command inserts the character above the cursor. This is useful
|
||||
when you are duplicating a previous line. For example, you have this line of
|
||||
C code:
|
||||
|
||||
b_array[i]->s_next = a_array[i]->s_next; ~
|
||||
|
||||
Now you need to type the same line, but with "s_prev" instead of "s_next".
|
||||
Start the new line, and press CTRL-Y 14 times, until you are at the "n" of
|
||||
"next":
|
||||
|
||||
b_array[i]->s_next = a_array[i]->s_next;~
|
||||
b_array[i]->s_ ~
|
||||
|
||||
Now you type "prev":
|
||||
|
||||
b_array[i]->s_next = a_array[i]->s_next; ~
|
||||
b_array[i]->s_prev ~
|
||||
|
||||
Continue pressing CTRL-Y until the following "next":
|
||||
|
||||
b_array[i]->s_next = a_array[i]->s_next;~
|
||||
b_array[i]->s_prev = a_array[i]->s_ ~
|
||||
|
||||
Now type "prev;" to finish it off.
|
||||
|
||||
The CTRL-E command acts like CTRL-Y except it inserts the character below the
|
||||
cursor.
|
||||
|
||||
==============================================================================
|
||||
*24.6* Inserting a register
|
||||
|
||||
The command CTRL-R {register} inserts the contents of the register. This is
|
||||
useful to avoid having to type a long word. For example, you need to type
|
||||
this:
|
||||
|
||||
r = VeryLongFunction(a) + VeryLongFunction(b) + VeryLongFunction(c) ~
|
||||
|
||||
The function name is defined in a different file. Edit that file and move the
|
||||
cursor on top of the function name there, and yank it into register v: >
|
||||
|
||||
"vyiw
|
||||
|
||||
"v is the register specification, "yiw" is yank-inner-word. Now edit the file
|
||||
where the new line is to be inserted, and type the first letters:
|
||||
|
||||
r = ~
|
||||
|
||||
Now use CTRL-R v to insert the function name:
|
||||
|
||||
r = VeryLongFunction ~
|
||||
|
||||
You continue to type the characters in between the function name, and use
|
||||
CTRL-R v two times more.
|
||||
You could have done the same with completion. Using a register is useful
|
||||
when there are many words that start with the same characters.
|
||||
<!--
|
||||
|
||||
If the register contains characters such as <BS> or other special characters,
|
||||
they are interpreted as if they had been typed from the keyboard. If you do
|
||||
not want this to happen (you really want the <BS> to be inserted in the text),
|
||||
use the command CTRL-R CTRL-R {register}.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*24.7* Abbreviations
|
||||
|
||||
This functionality is not currently support by IdeaVim.
|
||||
<!--
|
||||
An abbreviation is a short word that takes the place of a long one. For
|
||||
example, "ad" stands for "advertisement". Vim enables you to type an
|
||||
abbreviation and then will automatically expand it for you.
|
||||
To tell Vim to expand "ad" into "advertisement" every time you insert it,
|
||||
use the following command: >
|
||||
|
||||
:iabbrev ad advertisement
|
||||
|
||||
Now, when you type "ad", the whole word "advertisement" will be inserted into
|
||||
the text. This is triggered by typing a character that can't be part of a
|
||||
word, for example a space:
|
||||
|
||||
What Is Entered What You See
|
||||
I saw the a I saw the a ~
|
||||
I saw the ad I saw the ad ~
|
||||
I saw the ad<Space> I saw the advertisement<Space> ~
|
||||
|
||||
The expansion doesn't happen when typing just "ad". That allows you to type a
|
||||
word like "add", which will not get expanded. Only whole words are checked
|
||||
for abbreviations.
|
||||
|
||||
|
||||
ABBREVIATING SEVERAL WORDS
|
||||
|
||||
It is possible to define an abbreviation that results in multiple words. For
|
||||
example, to define "JB" as "Jack Benny", use the following command: >
|
||||
|
||||
:iabbrev JB Jack Benny
|
||||
|
||||
As a programmer, I use two rather unusual abbreviations: >
|
||||
|
||||
:iabbrev #b /****************************************
|
||||
:iabbrev #e <Space>****************************************/
|
||||
|
||||
These are used for creating boxed comments. The comment starts with #b, which
|
||||
draws the top line. I then type the comment text and use #e to draw the
|
||||
bottom line.
|
||||
Notice that the #e abbreviation begins with a space. In other words, the
|
||||
first two characters are space-star. Usually Vim ignores spaces between the
|
||||
abbreviation and the expansion. To avoid that problem, I spell space as seven
|
||||
characters: <, S, p, a, c, e, >.
|
||||
|
||||
Note:
|
||||
":iabbrev" is a long word to type. ":iab" works just as well.
|
||||
That's abbreviating the abbreviate command!
|
||||
|
||||
|
||||
FIXING TYPING MISTAKES
|
||||
|
||||
It's very common to make the same typing mistake every time. For example,
|
||||
typing "teh" instead of "the". You can fix this with an abbreviation: >
|
||||
|
||||
:abbreviate teh the
|
||||
|
||||
You can add a whole list of these. Add one each time you discover a common
|
||||
mistake.
|
||||
|
||||
|
||||
LISTING ABBREVIATIONS
|
||||
|
||||
The ":abbreviate" command lists the abbreviations:
|
||||
|
||||
:abbreviate
|
||||
i #e ****************************************/
|
||||
i #b /****************************************
|
||||
i JB Jack Benny
|
||||
i ad advertisement
|
||||
! teh the
|
||||
|
||||
The "i" in the first column indicates Insert mode. These abbreviations are
|
||||
only active in Insert mode. Other possible characters are:
|
||||
|
||||
c Command-line mode :cabbrev
|
||||
! both Insert and Command-line mode :abbreviate
|
||||
|
||||
Since abbreviations are not often useful in Command-line mode, you will mostly
|
||||
use the ":iabbrev" command. That avoids, for example, that "ad" gets expanded
|
||||
when typing a command like: >
|
||||
|
||||
:edit ad
|
||||
|
||||
|
||||
DELETING ABBREVIATIONS
|
||||
|
||||
To get rid of an abbreviation, use the ":unabbreviate" command. Suppose you
|
||||
have the following abbreviation: >
|
||||
|
||||
:abbreviate @f fresh
|
||||
|
||||
You can remove it with this command: >
|
||||
|
||||
:unabbreviate @f
|
||||
|
||||
While you type this, you will notice that @f is expanded to "fresh". Don't
|
||||
worry about this, Vim understands it anyway (except when you have an
|
||||
abbreviation for "fresh", but that's very unlikely).
|
||||
To remove all the abbreviations: >
|
||||
|
||||
:abclear
|
||||
|
||||
":unabbreviate" and ":abclear" also come in the variants for Insert mode
|
||||
(":iunabbeviate and ":iabclear") and Command-line mode (":cunabbreviate" and
|
||||
":cabclear").
|
||||
|
||||
|
||||
REMAPPING ABBREVIATIONS
|
||||
|
||||
There is one thing to watch out for when defining an abbreviation: The
|
||||
resulting string should not be mapped. For example: >
|
||||
|
||||
:abbreviate @a adder
|
||||
:imap dd disk-door
|
||||
|
||||
When you now type @a, you will get "adisk-doorer". That's not what you want.
|
||||
To avoid this, use the ":noreabbrev" command. It does the same as
|
||||
":abbreviate", but avoids that the resulting string is used for mappings: >
|
||||
|
||||
:noreabbrev @a adder
|
||||
|
||||
Fortunately, it's unlikely that the result of an abbreviation is mapped.
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*24.8* Entering special characters
|
||||
|
||||
<!--
|
||||
The CTRL-V command is used to insert the next character literally. In other
|
||||
words, any special meaning the character has, it will be ignored. For
|
||||
example: >
|
||||
|
||||
CTRL-V <Esc>
|
||||
|
||||
Inserts an escape character. Thus you don't leave Insert mode. (Don't type
|
||||
the space after CTRL-V, it's only to make this easier to read).
|
||||
|
||||
Note:
|
||||
On MS-Windows CTRL-V is used to paste text. Use CTRL-Q instead of
|
||||
CTRL-V. On Unix, on the other hand, CTRL-Q does not work on some
|
||||
terminals, because it has a special meaning.
|
||||
|
||||
-->
|
||||
You can use the command CTRL-V {digits} to insert a character with the
|
||||
decimal number {digits}. For example, the character number 127 is the <Del>
|
||||
character (but not necessarily the <Del> key!). To insert <Del> type: >
|
||||
|
||||
CTRL-V 127
|
||||
|
||||
You can enter characters up to 255 this way. When you type fewer than two
|
||||
digits, a non-digit will terminate the command. To avoid the need of typing a
|
||||
non-digit, prepend one or two zeros to make three digits.
|
||||
All the next commands insert a <Tab> and then a dot:
|
||||
|
||||
CTRL-V 9.
|
||||
CTRL-V 09.
|
||||
CTRL-V 009.
|
||||
|
||||
To enter a character in hexadecimal, use an "x" after the CTRL-V: >
|
||||
|
||||
CTRL-V x7f
|
||||
|
||||
This also goes up to character 255 (CTRL-V xff). You can use "o" to type a
|
||||
character as an octal number and two more methods allow you to type up to
|
||||
a 16 bit and a 32 bit number (e.g., for a Unicode character): >
|
||||
|
||||
CTRL-V o123
|
||||
CTRL-V u1234
|
||||
CTRL-V U12345678
|
||||
|
||||
==============================================================================
|
||||
*24.9* Digraphs
|
||||
|
||||
Some characters are not on the keyboard. For example, the copyright character
|
||||
(<28>). To type these characters in Vim, you use digraphs, where two characters
|
||||
represent one. To enter a <20>, for example, you press three keys: >
|
||||
|
||||
CTRL-K Co
|
||||
|
||||
To find out what digraphs are available, use the following command: >
|
||||
|
||||
:digraphs
|
||||
|
||||
Vim will display the digraph table. Here are three lines of it:
|
||||
|
||||
AC ~_ 159 NS | 160 !I <20> 161 Ct <20> 162 Pd <20> 163 Cu <20> 164 Ye <20> 165 ~
|
||||
BB <20> 166 SE <20> 167 ': <20> 168 Co <20> 169 -a <20> 170 << <20> 171 NO <20> 172 ~
|
||||
-- <20> 173 Rg <20> 174 'm <20> 175 DG <20> 176 +- <20> 177 2S <20> 178 3S <20> 179 ~
|
||||
|
||||
This shows, for example, that the digraph you get by typing CTRL-K Pd is the
|
||||
character (<28>). This is character number 163 (decimal).
|
||||
Pd is short for Pound. Most digraphs are selected to give you a hint about
|
||||
the character they will produce. If you look through the list you will
|
||||
understand the logic.
|
||||
You can exchange the first and second character, if there is no digraph for
|
||||
that combination. Thus CTRL-K dP also works. Since there is no digraph for
|
||||
"dP" Vim will also search for a "Pd" digraph.
|
||||
|
||||
Note:
|
||||
The digraphs depend on the character set that Vim assumes you are
|
||||
using. On MS-DOS they are different from MS-Windows. Always use
|
||||
":digraphs" to find out which digraphs are currently available.
|
||||
<!--
|
||||
|
||||
You can define your own digraphs. Example: >
|
||||
|
||||
:digraph a" <20>
|
||||
|
||||
This defines that CTRL-K a" inserts an <20> character. You can also specify the
|
||||
character with a decimal number. This defines the same digraph: >
|
||||
|
||||
:digraph a" 228
|
||||
-->
|
||||
|
||||
More information about digraphs here: |digraphs|
|
||||
<!--
|
||||
Another way to insert special characters is with a keymap. More about that
|
||||
here: |45.5|
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
*24.10* Normal mode commands
|
||||
|
||||
Insert mode offers a limited number of commands. In Normal mode you have many
|
||||
more. When you want to use one, you usually leave Insert mode with <Esc>,
|
||||
execute the Normal mode command, and re-enter Insert mode with "i" or "a".
|
||||
There is a quicker way. With CTRL-O {command} you can execute any Normal
|
||||
mode command from Insert mode. For example, to delete from the cursor to the
|
||||
end of the line: >
|
||||
|
||||
CTRL-O D
|
||||
|
||||
You can execute only one Normal mode command this way. But you can specify a
|
||||
register or a count. A more complicated example: >
|
||||
|
||||
CTRL-O "g3dw
|
||||
|
||||
This deletes up to the third word into register g.
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_25.txt| Editing formatted text
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
@@ -1,578 +0,0 @@
|
||||
*usr_25.txt* For IdeaVim version @VERSION@. Last change: 2006 Nov 12
|
||||
|
||||
IdeaVim USER MANUAL - by Rick Maddy
|
||||
|
||||
Editing formatted text
|
||||
|
||||
|
||||
This information does not apply to IdeaVim.
|
||||
<!--
|
||||
Text hardly ever comes in one sentence per line. This chapter is about
|
||||
breaking sentences to make them fit on a page and other formatting.
|
||||
Vim also has useful features for editing single-line paragraphs and tables.
|
||||
|
||||
|25.1| Breaking lines
|
||||
|25.2| Aligning text
|
||||
|25.3| Indents and tabs
|
||||
|25.4| Dealing with long lines
|
||||
|25.5| Editing tables
|
||||
|
||||
Next chapter: |usr_26.txt| Repeating
|
||||
Previous chapter: |usr_24.txt| Inserting quickly
|
||||
Table of contents: |usr_toc.txt|
|
||||
|
||||
==============================================================================
|
||||
*25.1* Breaking lines
|
||||
|
||||
Vim has a number of functions that make dealing with text easier. By default,
|
||||
the editor does not perform automatic line breaks. In other words, you have
|
||||
to press <Enter> yourself. This is useful when you are writing programs where
|
||||
you want to decide where the line ends. It is not so good when you are
|
||||
creating documentation and want the text to be at most 70 character wide.
|
||||
If you set the 'textwidth' option, Vim automatically inserts line breaks.
|
||||
Suppose, for example, that you want a very narrow column of only 30
|
||||
characters. You need to execute the following command: >
|
||||
|
||||
:set textwidth=30
|
||||
|
||||
Now you start typing (ruler added):
|
||||
|
||||
1 2 3
|
||||
12345678901234567890123456789012345
|
||||
I taught programming for a whi ~
|
||||
|
||||
If you type "l" next, this makes the line longer than the 30-character limit.
|
||||
When Vim sees this, it inserts a line break and you get the following:
|
||||
|
||||
1 2 3
|
||||
12345678901234567890123456789012345
|
||||
I taught programming for a ~
|
||||
whil ~
|
||||
|
||||
Continuing on, you can type in the rest of the paragraph:
|
||||
|
||||
1 2 3
|
||||
12345678901234567890123456789012345
|
||||
I taught programming for a ~
|
||||
while. One time, I was stopped ~
|
||||
by the Fort Worth police, ~
|
||||
because my homework was too ~
|
||||
hard. True story. ~
|
||||
|
||||
You do not have to type newlines; Vim puts them in automatically.
|
||||
|
||||
Note:
|
||||
The 'wrap' option makes Vim display lines with a line break, but this
|
||||
doesn't insert a line break in the file.
|
||||
|
||||
|
||||
REFORMATTING
|
||||
|
||||
The Vim editor is not a word processor. In a word processor, if you delete
|
||||
something at the beginning of the paragraph, the line breaks are reworked. In
|
||||
Vim they are not; so if you delete the word "programming" from the first line,
|
||||
all you get is a short line:
|
||||
|
||||
1 2 3
|
||||
12345678901234567890123456789012345
|
||||
I taught for a ~
|
||||
while. One time, I was stopped ~
|
||||
by the Fort Worth police, ~
|
||||
because my homework was too ~
|
||||
hard. True story. ~
|
||||
|
||||
This does not look good. To get the paragraph into shape you use the "gq"
|
||||
operator.
|
||||
Let's first use this with a Visual selection. Starting from the first
|
||||
line, type: >
|
||||
|
||||
v4jgq
|
||||
|
||||
"v" to start Visual mode, "4j' to move to the end of the paragraph and then
|
||||
the "gq" operator. The result is:
|
||||
|
||||
1 2 3
|
||||
12345678901234567890123456789012345
|
||||
I taught for a while. One ~
|
||||
time, I was stopped by the ~
|
||||
Fort Worth police, because my ~
|
||||
homework was too hard. True ~
|
||||
story. ~
|
||||
|
||||
Since "gq" is an operator, you can use one of the three ways to select the
|
||||
text it works on: With Visual mode, with a movement and with a text object.
|
||||
The example above could also be done with "gq4j". That's less typing, but
|
||||
you have to know the line count. A more useful motion command is "}". This
|
||||
moves to the end of a paragraph. Thus "gq}" formats from the cursor to the
|
||||
end of the current paragraph.
|
||||
A very useful text object to use with "gq" is the paragraph. Try this: >
|
||||
|
||||
gqap
|
||||
|
||||
"ap" stands for "a-paragraph". This formats the text of one paragraph
|
||||
(separated by empty lines). Also the part before the cursor.
|
||||
If you have your paragraphs separated by empty lines, you can format the
|
||||
whole file by typing this: >
|
||||
|
||||
gggqG
|
||||
|
||||
"gg" to move to the first line, "gqG" to format until the last line.
|
||||
Warning: If your paragraphs are not properly separated, they will be joined
|
||||
together. A common mistake is to have a line with a space or Tab. That's a
|
||||
blank line, but not an empty line.
|
||||
|
||||
Vim is able format more than just plain text. See |fo-table| for how to
|
||||
change this. See the 'joinspaces' option to change the number of spaces used
|
||||
after a full stop.
|
||||
It is possible to use an external program for formatting. This is useful
|
||||
if your text can't be properly formatted with Vim's builtin command. See the
|
||||
'formatprg' option.
|
||||
|
||||
==============================================================================
|
||||
*25.2* Aligning text
|
||||
|
||||
To center a range of lines, use the following command: >
|
||||
|
||||
:{range}center [width]
|
||||
|
||||
{range} is the usual command-line range. [width] is an optional line width to
|
||||
use for centering. If [width] is not specified, it defaults to the value of
|
||||
'textwidth'. (If 'textwidth' is 0, the default is 80.)
|
||||
For example: >
|
||||
|
||||
:1,5center 40
|
||||
|
||||
results in the following:
|
||||
|
||||
I taught for a while. One ~
|
||||
time, I was stopped by the ~
|
||||
Fort Worth police, because my ~
|
||||
homework was too hard. True ~
|
||||
story. ~
|
||||
|
||||
|
||||
RIGHT ALIGNMENT
|
||||
|
||||
Similarly, the ":right" command right-justifies the text: >
|
||||
|
||||
:1,5right 37
|
||||
|
||||
gives this result:
|
||||
|
||||
I taught for a while. One ~
|
||||
time, I was stopped by the ~
|
||||
Fort Worth police, because my ~
|
||||
homework was too hard. True ~
|
||||
story. ~
|
||||
|
||||
LEFT ALIGNMENT
|
||||
|
||||
Finally there is this command: >
|
||||
|
||||
:{range}left [margin]
|
||||
|
||||
Unlike ":center" and ":right", however, the argument to ":left" is not the
|
||||
length of the line. Instead it is the left margin. If it is omitted, the
|
||||
text will be put against the left side of the screen (using a zero margin
|
||||
would do the same). If it is 5, the text will be indented 5 spaces. For
|
||||
example, use these commands: >
|
||||
|
||||
:1left 5
|
||||
:2,5left
|
||||
|
||||
This results in the following:
|
||||
|
||||
I taught for a while. One ~
|
||||
time, I was stopped by the ~
|
||||
Fort Worth police, because my ~
|
||||
homework was too hard. True ~
|
||||
story. ~
|
||||
|
||||
|
||||
JUSTIFYING TEXT
|
||||
|
||||
Vim has no built-in way of justifying text. However, there is a neat macro
|
||||
package that does the job. To use this package, execute the following
|
||||
command: >
|
||||
|
||||
:runtime macros/justify.vim
|
||||
|
||||
This Vim script file defines a new visual command "_j". To justify a block of
|
||||
text, highlight the text in Visual mode and then execute "_j".
|
||||
Look in the file for more explanations. To go there, do "gf" on this name:
|
||||
$VIMRUNTIME/macros/justify.vim.
|
||||
|
||||
An alternative is to filter the text through an external program. Example: >
|
||||
|
||||
:%!fmt
|
||||
|
||||
==============================================================================
|
||||
*25.3* Indents and tabs
|
||||
|
||||
Indents can be used to make text stand out from the rest. The example texts
|
||||
in this manual, for example, are indented by eight spaces or a tab. You would
|
||||
normally enter this by typing a tab at the start of each line. Take this
|
||||
text:
|
||||
the first line ~
|
||||
the second line ~
|
||||
|
||||
This is entered by typing a tab, some text, <Enter>, tab and more text.
|
||||
The 'autoindent' option inserts indents automatically: >
|
||||
|
||||
:set autoindent
|
||||
|
||||
When a new line is started it gets the same indent as the previous line. In
|
||||
the above example, the tab after the <Enter> is not needed anymore.
|
||||
|
||||
|
||||
INCREASING INDENT
|
||||
|
||||
To increase the amount of indent in a line, use the ">" operator. Often this
|
||||
is used as ">>", which adds indent to the current line.
|
||||
The amount of indent added is specified with the 'shiftwidth' option. The
|
||||
default value is 8. To make ">>" insert four spaces worth of indent, for
|
||||
example, type this: >
|
||||
|
||||
:set shiftwidth=4
|
||||
|
||||
When used on the second line of the example text, this is what you get:
|
||||
|
||||
the first line ~
|
||||
the second line ~
|
||||
|
||||
"4>>" will increase the indent of four lines.
|
||||
|
||||
|
||||
TABSTOP
|
||||
|
||||
If you want to make indents a multiple of 4, you set 'shiftwidth' to 4. But
|
||||
when pressing a Tab you still get 8 spaces worth of indent. To change this,
|
||||
set the 'softtabstop' option: >
|
||||
|
||||
:set softtabstop=4
|
||||
|
||||
This will make the <Tab> key insert 4 spaces worth of indent. If there are
|
||||
already four spaces, a <Tab> character is used (saving seven characters in the
|
||||
file). (If you always want spaces and no tab characters, set the 'expandtab'
|
||||
option.)
|
||||
|
||||
Note:
|
||||
You could set the 'tabstop' option to 4. However, if you edit the
|
||||
file another time, with 'tabstop' set to the default value of 8, it
|
||||
will look wrong. In other programs and when printing the indent will
|
||||
also be wrong. Therefore it is recommended to keep 'tabstop' at eight
|
||||
all the time. That's the standard value everywhere.
|
||||
|
||||
|
||||
CHANGING TABS
|
||||
|
||||
You edit a file which was written with a tabstop of 3. In Vim it looks ugly,
|
||||
because it uses the normal tabstop value of 8. You can fix this by setting
|
||||
'tabstop' to 3. But you have to do this every time you edit this file.
|
||||
Vim can change the use of tabstops in your file. First, set 'tabstop' to
|
||||
make the indents look good, then use the ":retab" command: >
|
||||
|
||||
:set tabstop=3
|
||||
:retab 8
|
||||
|
||||
The ":retab" command will change 'tabstop' to 8, while changing the text such
|
||||
that it looks the same. It changes spans of white space into tabs and spaces
|
||||
for this. You can now write the file. Next time you edit it the indents will
|
||||
be right without setting an option.
|
||||
Warning: When using ":retab" on a program, it may change white space inside
|
||||
a string constant. Therefore it's a good habit to use "\t" instead of a
|
||||
real tab.
|
||||
|
||||
==============================================================================
|
||||
*25.4* Dealing with long lines
|
||||
|
||||
Sometimes you will be editing a file that is wider than the number of columns
|
||||
in the window. When that occurs, Vim wraps the lines so that everything fits
|
||||
on the screen.
|
||||
If you switch the 'wrap' option off, each line in the file shows up as one
|
||||
line on the screen. Then the ends of the long lines disappear off the screen
|
||||
to the right.
|
||||
When you move the cursor to a character that can't be seen, Vim will scroll
|
||||
the text to show it. This is like moving a viewport over the text in the
|
||||
horizontal direction.
|
||||
By default, Vim does not display a horizontal scrollbar in the GUI. If you
|
||||
want to enable one, use the following command: >
|
||||
|
||||
:set guioptions+=b
|
||||
|
||||
One horizontal scrollbar will appear at the bottom of the Vim window.
|
||||
|
||||
If you don't have a scrollbar or don't want to use it, use these commands to
|
||||
scroll the text. The cursor will stay in the same place, but it's move back
|
||||
into the visible text if necessary.
|
||||
|
||||
zh scroll right
|
||||
4zh scroll four characters right
|
||||
zH scroll half a window width right
|
||||
ze scroll right to put the cursor at the end
|
||||
zl scroll left
|
||||
4zl scroll four characters left
|
||||
zL scroll half a window width left
|
||||
zs scroll left to put the cursor at the start
|
||||
|
||||
Let's attempt to show this with one line of text. The cursor is on the "w" of
|
||||
"which". The "current window" above the line indicates the text that is
|
||||
currently visible. The "window"s below the text indicate the text that is
|
||||
visible after the command left of it.
|
||||
|
||||
|<-- current window -->|
|
||||
some long text, part of which is visible in the window~
|
||||
ze |<-- window -->|
|
||||
zH |<-- window -->|
|
||||
4zh |<-- window -->|
|
||||
zh |<-- window -->|
|
||||
zl |<-- window -->|
|
||||
4zl |<-- window -->|
|
||||
zL |<-- window -->|
|
||||
zs |<-- window -->|
|
||||
|
||||
|
||||
MOVING WITH WRAP OFF
|
||||
|
||||
When 'wrap' is off and the text has scrolled horizontally, you can use the
|
||||
following commands to move the cursor to a character you can see. Thus text
|
||||
left and right of the window is ignored. These never cause the text to
|
||||
scroll:
|
||||
|
||||
g0 to first visible character in this line
|
||||
g^ to first non-blank visible character in this line
|
||||
gm to middle of this line
|
||||
g$ to last visible character in this line
|
||||
|
||||
|<-- window -->|
|
||||
some long text, part of which is visible ~
|
||||
g0 g^ gm g$
|
||||
|
||||
|
||||
BREAKING AT WORDS *edit-no-break*
|
||||
|
||||
When preparing text for use by another program, you might have to make
|
||||
paragraphs without a line break. A disadvantage of using 'nowrap' is that you
|
||||
can't see the whole sentence you are working on. When 'wrap' is on, words are
|
||||
broken halfway, which makes them hard to read.
|
||||
A good solution for editing this kind of paragraph is setting the
|
||||
'linebreak' option. Vim then breaks lines at an appropriate place when
|
||||
displaying the line. The text in the file remains unchanged.
|
||||
Without 'linebreak' text might look like this:
|
||||
|
||||
+---------------------------------+
|
||||
|letter generation program for a b|
|
||||
|ank. They wanted to send out a s|
|
||||
|pecial, personalized letter to th|
|
||||
|eir richest 1000 customers. Unfo|
|
||||
|rtunately for the programmer, he |
|
||||
+---------------------------------+
|
||||
After: >
|
||||
|
||||
:set linebreak
|
||||
|
||||
it looks like this:
|
||||
|
||||
+---------------------------------+
|
||||
|letter generation program for a |
|
||||
|bank. They wanted to send out a |
|
||||
|special, personalized letter to |
|
||||
|their richest 1000 customers. |
|
||||
|Unfortunately for the programmer,|
|
||||
+---------------------------------+
|
||||
|
||||
Related options:
|
||||
'breakat' specifies the characters where a break can be inserted.
|
||||
'showbreak' specifies a string to show at the start of broken line.
|
||||
Set 'textwidth' to zero to avoid a paragraph to be split.
|
||||
|
||||
|
||||
MOVING BY VISIBLE LINES
|
||||
|
||||
The "j" and "k" commands move to the next and previous lines. When used on
|
||||
a long line, this means moving a lot of screen lines at once.
|
||||
To move only one screen line, use the "gj" and "gk" commands. When a line
|
||||
doesn't wrap they do the same as "j" and "k". When the line does wrap, they
|
||||
move to a character displayed one line below or above.
|
||||
You might like to use these mappings, which bind these movement commands to
|
||||
the cursor keys: >
|
||||
|
||||
:map <Up> gk
|
||||
:map <Down> gj
|
||||
|
||||
|
||||
TURNING A PARAGRAPH INTO ONE LINE
|
||||
|
||||
If you want to import text into a program like MS-Word, each paragraph should
|
||||
be a single line. If your paragraphs are currently separated with empty
|
||||
lines, this is how you turn each paragraph into a single line: >
|
||||
|
||||
:g/./,/^$/join
|
||||
|
||||
That looks complicated. Let's break it up in pieces:
|
||||
|
||||
:g/./ A ":global" command that finds all lines that contain
|
||||
at least one character.
|
||||
,/^$/ A range, starting from the current line (the non-empty
|
||||
line) until an empty line.
|
||||
join The ":join" command joins the range of lines together
|
||||
into one line.
|
||||
|
||||
Starting with this text, containing eight lines broken at column 30:
|
||||
|
||||
+----------------------------------+
|
||||
|A letter generation program |
|
||||
|for a bank. They wanted to |
|
||||
|send out a special, |
|
||||
|personalized letter. |
|
||||
| |
|
||||
|To their richest 1000 |
|
||||
|customers. Unfortunately for |
|
||||
|the programmer, |
|
||||
+----------------------------------+
|
||||
|
||||
You end up with two lines:
|
||||
|
||||
+----------------------------------+
|
||||
|A letter generation program for a |
|
||||
|bank. They wanted to send out a s|
|
||||
|pecial, personalized letter. |
|
||||
|To their richest 1000 customers. |
|
||||
|Unfortunately for the programmer, |
|
||||
+----------------------------------+
|
||||
|
||||
Note that this doesn't work when the separating line is blank but not empty;
|
||||
when it contains spaces and/or tabs. This command does work with blank lines:
|
||||
>
|
||||
:g/\S/,/^\s*$/join
|
||||
|
||||
This still requires a blank or empty line at the end of the file for the last
|
||||
paragraph to be joined.
|
||||
|
||||
==============================================================================
|
||||
*25.5* Editing tables
|
||||
|
||||
Suppose you are editing a table with four columns:
|
||||
|
||||
nice table test 1 test 2 test 3 ~
|
||||
input A 0.534 ~
|
||||
input B 0.913 ~
|
||||
|
||||
You need to enter numbers in the third column. You could move to the second
|
||||
line, use "A", enter a lot of spaces and type the text.
|
||||
For this kind of editing there is a special option: >
|
||||
|
||||
set virtualedit=all
|
||||
|
||||
Now you can move the cursor to positions where there isn't any text. This is
|
||||
called "virtual space". Editing a table is a lot easier this way.
|
||||
Move the cursor by searching for the header of the last column: >
|
||||
|
||||
/test 3
|
||||
|
||||
Now press "j" and you are right where you can enter the value for "input A".
|
||||
Typing "0.693" results in:
|
||||
|
||||
nice table test 1 test 2 test 3 ~
|
||||
input A 0.534 0.693 ~
|
||||
input B 0.913 ~
|
||||
|
||||
Vim has automatically filled the gap in front of the new text for you. Now,
|
||||
to enter the next field in this column use "Bj". "B" moves back to the start
|
||||
of a white space separated word. Then "j" moves to the place where the next
|
||||
field can be entered.
|
||||
|
||||
Note:
|
||||
You can move the cursor anywhere in the display, also beyond the end
|
||||
of a line. But Vim will not insert spaces there, until you insert a
|
||||
character in that position.
|
||||
|
||||
|
||||
COPYING A COLUMN
|
||||
|
||||
You want to add a column, which should be a copy of the third column and
|
||||
placed before the "test 1" column. Do this in seven steps:
|
||||
1. Move the cursor to the left upper corner of this column, e.g., with
|
||||
"/test 3".
|
||||
2. Press CTRL-V to start blockwise Visual mode.
|
||||
3. Move the cursor down two lines with "2j". You are now in "virtual space":
|
||||
the "input B" line of the "test 3" column.
|
||||
4. Move the cursor right, to include the whole column in the selection, plus
|
||||
the space that you want between the columns. "9l" should do it.
|
||||
5. Yank the selected rectangle with "y".
|
||||
6. Move the cursor to "test 1", where the new column must be placed.
|
||||
7. Press "P".
|
||||
|
||||
The result should be:
|
||||
|
||||
nice table test 3 test 1 test 2 test 3 ~
|
||||
input A 0.693 0.534 0.693 ~
|
||||
input B 0.913 ~
|
||||
|
||||
Notice that the whole "test 1" column was shifted right, also the line where
|
||||
the "test 3" column didn't have text.
|
||||
|
||||
Go back to non-virtual cursor movements with: >
|
||||
|
||||
:set virtualedit=
|
||||
|
||||
|
||||
VIRTUAL REPLACE MODE
|
||||
|
||||
The disadvantage of using 'virtualedit' is that it "feels" different. You
|
||||
can't recognize tabs or spaces beyond the end of line when moving the cursor
|
||||
around. Another method can be used: Virtual Replace mode.
|
||||
Suppose you have a line in a table that contains both tabs and other
|
||||
characters. Use "rx" on the first tab:
|
||||
|
||||
inp 0.693 0.534 0.693 ~
|
||||
|
||||
|
|
||||
rx |
|
||||
V
|
||||
|
||||
inpx0.693 0.534 0.693 ~
|
||||
|
||||
The layout is messed up. To avoid that, use the "gr" command:
|
||||
|
||||
inp 0.693 0.534 0.693 ~
|
||||
|
||||
|
|
||||
grx |
|
||||
V
|
||||
|
||||
inpx 0.693 0.534 0.693 ~
|
||||
|
||||
What happens is that the "gr" command makes sure the new character takes the
|
||||
right amount of screen space. Extra spaces or tabs are inserted to fill the
|
||||
gap. Thus what actually happens is that a tab is replaced by "x" and then
|
||||
blanks added to make the text after it keep it's place. In this case a
|
||||
tab is inserted.
|
||||
When you need to replace more than one character, you use the "R" command
|
||||
to go to Replace mode (see |04.9|). This messes up the layout and replaces
|
||||
the wrong characters:
|
||||
|
||||
inp 0 0.534 0.693 ~
|
||||
|
||||
|
|
||||
R0.786 |
|
||||
V
|
||||
|
||||
inp 0.78634 0.693 ~
|
||||
|
||||
The "gR" command uses Virtual Replace mode. This preserves the layout:
|
||||
|
||||
inp 0 0.534 0.693 ~
|
||||
|
||||
|
|
||||
gR0.786 |
|
||||
V
|
||||
|
||||
inp 0.786 0.534 0.693 ~
|
||||
-->
|
||||
|
||||
==============================================================================
|
||||
|
||||
Next chapter: |usr_26.txt| Repeating
|
||||
|
||||
Copyright: see |manual-copyright|
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user