mirror of
https://github.com/chylex/IntelliJ-IdeaVim.git
synced 2025-08-19 22:24:57 +02:00
Compare commits
1157 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
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 | ||
|
|
efad5545de | ||
|
|
afb411dd35 | ||
|
|
fe1184b0d3 |
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
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1,5 +1,6 @@
|
|||||||
*.swp
|
*.swp
|
||||||
|
/.gradle/
|
||||||
/.idea/
|
/.idea/
|
||||||
/idea/
|
/build/
|
||||||
/out/
|
/out/
|
||||||
/tmp/
|
/tmp/
|
||||||
276
.idea/codeStyleSettings.xml
generated
276
.idea/codeStyleSettings.xml
generated
@@ -1,276 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectCodeStyleSettingsManager">
|
|
||||||
<option name="PER_PROJECT_SETTINGS">
|
|
||||||
<value>
|
|
||||||
<option name="JAVA_INDENT_OPTIONS">
|
|
||||||
<value>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
<option name="USE_TAB_CHARACTER" value="false" />
|
|
||||||
<option name="SMART_TABS" value="false" />
|
|
||||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
|
||||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
|
||||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="JSP_INDENT_OPTIONS">
|
|
||||||
<value>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
<option name="USE_TAB_CHARACTER" value="false" />
|
|
||||||
<option name="SMART_TABS" value="false" />
|
|
||||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
|
||||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
|
||||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="XML_INDENT_OPTIONS">
|
|
||||||
<value>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
<option name="USE_TAB_CHARACTER" value="false" />
|
|
||||||
<option name="SMART_TABS" value="false" />
|
|
||||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
|
||||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
|
||||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="OTHER_INDENT_OPTIONS">
|
|
||||||
<value>
|
|
||||||
<option name="INDENT_SIZE" value="4" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="4" />
|
|
||||||
<option name="USE_TAB_CHARACTER" value="false" />
|
|
||||||
<option name="SMART_TABS" value="false" />
|
|
||||||
<option name="LABEL_INDENT_SIZE" value="0" />
|
|
||||||
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
|
|
||||||
<option name="USE_RELATIVE_INDENTS" value="false" />
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="FIELD_NAME_PREFIX" value="my" />
|
|
||||||
<option name="STATIC_FIELD_NAME_PREFIX" value="our" />
|
|
||||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
|
||||||
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
|
|
||||||
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
|
||||||
<option name="THROWS_LIST_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="IF_BRACE_FORCE" value="1" />
|
|
||||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FOR_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FIELD_ANNOTATION_WRAP" value="0" />
|
|
||||||
<XML>
|
|
||||||
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
|
|
||||||
</XML>
|
|
||||||
<ADDITIONAL_INDENT_OPTIONS fileType="rb">
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
</ADDITIONAL_INDENT_OPTIONS>
|
|
||||||
<codeStyleSettings language="CFML">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="ECMA Script Level 4">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
|
||||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="IF_BRACE_FORCE" value="1" />
|
|
||||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FOR_BRACE_FORCE" value="1" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="GSP">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="Groovy">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
|
||||||
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
|
||||||
<option name="THROWS_LIST_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="IF_BRACE_FORCE" value="1" />
|
|
||||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FOR_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FIELD_ANNOTATION_WRAP" value="0" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="HTML">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="JAVA">
|
|
||||||
<option name="LINE_COMMENT_AT_FIRST_COLUMN" value="false" />
|
|
||||||
<option name="BLOCK_COMMENT_AT_FIRST_COLUMN" value="false" />
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_ASSIGNMENT" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_THROWS_LIST" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_EXTENDS_LIST" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARENTHESIZED_EXPRESSION" value="true" />
|
|
||||||
<option name="SPACE_AFTER_TYPE_CAST" value="false" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_LIST_WRAP" value="1" />
|
|
||||||
<option name="THROWS_LIST_WRAP" value="5" />
|
|
||||||
<option name="EXTENDS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="THROWS_KEYWORD_WRAP" value="1" />
|
|
||||||
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="IF_BRACE_FORCE" value="1" />
|
|
||||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FOR_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FIELD_ANNOTATION_WRAP" value="0" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="2" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="JSON">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="JSP">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="JavaScript">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ELSE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="WHILE_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="CATCH_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="FINALLY_ON_NEW_LINE" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="true" />
|
|
||||||
<option name="ALIGN_MULTILINE_TERNARY_OPERATION" value="true" />
|
|
||||||
<option name="CALL_PARAMETERS_WRAP" value="1" />
|
|
||||||
<option name="METHOD_PARAMETERS_WRAP" value="5" />
|
|
||||||
<option name="BINARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_WRAP" value="5" />
|
|
||||||
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
|
|
||||||
<option name="FOR_STATEMENT_WRAP" value="5" />
|
|
||||||
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
|
|
||||||
<option name="ASSIGNMENT_WRAP" value="1" />
|
|
||||||
<option name="IF_BRACE_FORCE" value="1" />
|
|
||||||
<option name="DOWHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="WHILE_BRACE_FORCE" value="1" />
|
|
||||||
<option name="FOR_BRACE_FORCE" value="1" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="Python">
|
|
||||||
<option name="KEEP_LINE_BREAKS" value="false" />
|
|
||||||
<option name="ALIGN_MULTILINE_PARAMETERS_IN_CALLS" value="true" />
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="SQL">
|
|
||||||
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
|
|
||||||
</codeStyleSettings>
|
|
||||||
<codeStyleSettings language="XML">
|
|
||||||
<indentOptions>
|
|
||||||
<option name="INDENT_SIZE" value="2" />
|
|
||||||
<option name="CONTINUATION_INDENT_SIZE" value="4" />
|
|
||||||
<option name="TAB_SIZE" value="8" />
|
|
||||||
</indentOptions>
|
|
||||||
</codeStyleSettings>
|
|
||||||
</value>
|
|
||||||
</option>
|
|
||||||
<option name="USE_PER_PROJECT_SETTINGS" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
10
.idea/misc.xml
generated
10
.idea/misc.xml
generated
@@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="EntryPointsManager">
|
|
||||||
<entry_points version="2.0" />
|
|
||||||
</component>
|
|
||||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="IntelliJ Plugin SDK" project-jdk-type="IDEA JDK">
|
|
||||||
<output url="file://$PROJECT_DIR$/out" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
9
.idea/modules.xml
generated
9
.idea/modules.xml
generated
@@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/ideavim.iml" filepath="$PROJECT_DIR$/ideavim.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
36
.idea/runConfigurations/All_tests.xml
generated
36
.idea/runConfigurations/All_tests.xml
generated
@@ -1,36 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="All tests" type="JUnit" factoryName="JUnit">
|
|
||||||
<extension name="coverage" enabled="false" merge="false" runner="idea">
|
|
||||||
<pattern>
|
|
||||||
<option name="PATTERN" value="com.maddyhome.idea.vim.*" />
|
|
||||||
<option name="ENABLED" value="true" />
|
|
||||||
</pattern>
|
|
||||||
<pattern>
|
|
||||||
<option name="PATTERN" value="org.jetbrains.plugins.ideavim.*" />
|
|
||||||
<option name="ENABLED" value="true" />
|
|
||||||
</pattern>
|
|
||||||
</extension>
|
|
||||||
<module name="ideavim" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
|
|
||||||
<option name="ALTERNATIVE_JRE_PATH" value="" />
|
|
||||||
<option name="PACKAGE_NAME" value="org.jetbrains.plugins.ideavim" />
|
|
||||||
<option name="MAIN_CLASS_NAME" value="" />
|
|
||||||
<option name="METHOD_NAME" value="" />
|
|
||||||
<option name="TEST_OBJECT" value="package" />
|
|
||||||
<option name="VM_PARAMETERS" value="-ea" />
|
|
||||||
<option name="PARAMETERS" value="" />
|
|
||||||
<option name="WORKING_DIRECTORY" value="file://$PROJECT_DIR$" />
|
|
||||||
<option name="ENV_VARIABLES" />
|
|
||||||
<option name="PASS_PARENT_ENVS" value="true" />
|
|
||||||
<option name="TEST_SEARCH_SCOPE">
|
|
||||||
<value defaultName="moduleWithDependencies" />
|
|
||||||
</option>
|
|
||||||
<envs />
|
|
||||||
<patterns />
|
|
||||||
<RunnerSettings RunnerId="Cover" />
|
|
||||||
<RunnerSettings RunnerId="Run" />
|
|
||||||
<ConfigurationWrapper RunnerId="Cover" />
|
|
||||||
<ConfigurationWrapper RunnerId="Run" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
||||||
10
.idea/runConfigurations/IdeaVim.xml
generated
10
.idea/runConfigurations/IdeaVim.xml
generated
@@ -1,10 +0,0 @@
|
|||||||
<component name="ProjectRunConfigurationManager">
|
|
||||||
<configuration default="false" name="IdeaVim" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin">
|
|
||||||
<module name="ideavim" />
|
|
||||||
<option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -Didea.is.internal=true" />
|
|
||||||
<option name="PROGRAM_PARAMETERS" value="" />
|
|
||||||
<RunnerSettings RunnerId="Run" />
|
|
||||||
<ConfigurationWrapper RunnerId="Run" />
|
|
||||||
<method />
|
|
||||||
</configuration>
|
|
||||||
</component>
|
|
||||||
7
.idea/vcs.xml
generated
7
.idea/vcs.xml
generated
@@ -1,7 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
||||||
|
|
||||||
41
AUTHORS.md
41
AUTHORS.md
@@ -5,9 +5,10 @@ The original author:
|
|||||||
|
|
||||||
* [Rick Maddy](mailto:rmaddy@maddyhome.com)
|
* [Rick Maddy](mailto:rmaddy@maddyhome.com)
|
||||||
|
|
||||||
The current maintainer:
|
The current maintainers:
|
||||||
|
|
||||||
* [Andrey Vlasovskikh](mailto:andrey.vlasovskikh@gmail.com)
|
* [Andrey Vlasovskikh](mailto:andrey.vlasovskikh@gmail.com)
|
||||||
|
* [Alex Plate](mailto:alexpl292@gmail.com)
|
||||||
|
|
||||||
Previous maintainers:
|
Previous maintainers:
|
||||||
|
|
||||||
@@ -34,6 +35,44 @@ Contributors:
|
|||||||
* [smartbomb](mailto:smartbomb@server.fake)
|
* [smartbomb](mailto:smartbomb@server.fake)
|
||||||
* [Tuomas Tynkkynen](mailto:tuomas.tynkkynen@iki.fi)
|
* [Tuomas Tynkkynen](mailto:tuomas.tynkkynen@iki.fi)
|
||||||
* [Jackson Popkin](mailto:jackson@donorschoose.org)
|
* [Jackson Popkin](mailto:jackson@donorschoose.org)
|
||||||
|
* [Teruo Kunihiro](mailto:yuyuyu1999@gmail.com)
|
||||||
|
* [Liubov Paina](mailto:lubashka.994@mail.ru)
|
||||||
|
* [Daniel Leong](mailto:me@dhleong.net)
|
||||||
|
* [Aleksey Lagoshin](mailto:aleksey@pri-num.com)
|
||||||
|
* [Paulo Bu](mailto:pbu_98@yahoo.com)
|
||||||
|
* [Giorgos Gaganis](mailto:gaganis@yahoo.com)
|
||||||
|
* [Pavel Fatin](mailto:pavel.fatin@jetbrains.com)
|
||||||
|
* [tieTYT](mailto:tietyt@gmail.com)
|
||||||
|
* [Nick Gieschen](mailto:nickgieschen@gmail.com)
|
||||||
|
* [Naoto Ikeno](mailto:ikenox@gmail.com)
|
||||||
|
* [Maximilian Luz](mailto:qzed@users.noreply.github.com)
|
||||||
|
* [Vladimir Parfinenko](mailto:vparfinenko@excelsior-usa.com)
|
||||||
|
* [Florian Hassmann](mailto:hassmann@hwdev.de)
|
||||||
|
* [Jan Palus](mailto:jpalus@fastmail.com)
|
||||||
|
* [Konstantin Petrov](mailto:kpetrov@ripe.net)
|
||||||
|
* [Vasily Alferov](mailto:ya-ikmik2012@yandex.ru)
|
||||||
|
* [Vitalii Karavaev](mailto:fkve97@gmail.com)
|
||||||
|
* [John Lin](mailto:johnlinp@gmail.com)
|
||||||
|
* [Alex Plate](mailto:alexpl292@gmail.com)
|
||||||
|
* [Matt Ellis](mailto:m.t.ellis@gmail.com)
|
||||||
|
* [John Grib](mailto:johngrib82@gmail.com)
|
||||||
|
* [Marcel Hild](mailto:hild@b4mad.net)
|
||||||
|
* [Vedran Budimcic](mailto:vedranb@gmail.com)
|
||||||
|
* [Andrei Gasparovici](mailto:andreigasparovici1@gmail.com)
|
||||||
|
* [dos65](mailto:qtankle@gmail.com)
|
||||||
|
* [Tony Arra](mailto:ttonyarra@gmail.com)
|
||||||
|
* [Brad Ziolko](mailto:bradziolko@gmail.com)
|
||||||
|
* [sumoooru2](mailto:sumoooru2@gmail.com)
|
||||||
|
* [gecko655](mailto:aqwsedrft1234@yahoo.co.jp)
|
||||||
|
* [Daniele Megna](mailto:megna.dany@gmail.com)
|
||||||
|
* [Andrew Potter](mailto:apottere@gmail.com)
|
||||||
|
* [Romain Gautier](mailto:romain.gautier@nimamoh.net)
|
||||||
|
* [Elliot Courant](mailto:elliot.courant@wheniwork.com)
|
||||||
|
* [Simon Rainer](mailto:simon.rainer@fau.de)
|
||||||
|
* [Michael Ziwisky](mailto:mziwisky@instructure.com)
|
||||||
|
* [Pierce Corcoran](mailto:pierce@plasticcow.com)
|
||||||
|
* [Jonatan Tierno](mailto:jonatantierno@gmail.com)
|
||||||
|
* [Brendan Annable](mailto:brendan@annable.me)
|
||||||
|
|
||||||
If you are a contributor and your name is not listed here, feel free to
|
If you are a contributor and your name is not listed here, feel free to
|
||||||
contact the maintainer.
|
contact the maintainer.
|
||||||
|
|||||||
244
CHANGES.md
244
CHANGES.md
@@ -4,6 +4,248 @@ The Changelog
|
|||||||
History of changes in IdeaVim for the IntelliJ platform.
|
History of changes in IdeaVim for the IntelliJ platform.
|
||||||
|
|
||||||
|
|
||||||
|
Get an Early Access
|
||||||
|
-------------------
|
||||||
|
|
||||||
|
Would you like to try new features and fixes? Join the Early Access Program and
|
||||||
|
receive EAP builds as updates! Add this URL to "Settings | Plugins |
|
||||||
|
Browse Repositories | Manage Repositories":
|
||||||
|
[https://plugins.jetbrains.com/plugins/eap/ideavim](https://plugins.jetbrains.com/plugins/eap/ideavim)
|
||||||
|
|
||||||
|
It is important to distinguish EAP from traditional pre-release software.
|
||||||
|
Please note that the quality of EAP versions may at times be way below even
|
||||||
|
usual beta standards.
|
||||||
|
|
||||||
|
0.52, 2019-07-23
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* Introduce [Select Mode](https://vimhelp.org/visual.txt.html#Select-mode).
|
||||||
|
|
||||||
|
|
||||||
|
* Fixed `:only` command
|
||||||
|
* [VIM-1586](https://youtrack.jetbrains.com/issue/VIM-1586) Support `:shell` command
|
||||||
|
* [VIM-801](https://youtrack.jetbrains.com/issue/VIM-801) Support `:tabnext` and `:tabprevious` commands
|
||||||
|
* [VIM-1570](https://youtrack.jetbrains.com/issue/VIM-1570) Support `g<C-A>` and `g<C-X>` commands for visual mode
|
||||||
|
* [VIM-1119](https://youtrack.jetbrains.com/issue/VIM-1119) Fixed 'e' search offset
|
||||||
|
* [VIM-1587](https://youtrack.jetbrains.com/issue/VIM-1587) Fixed end-of-line multi line percent match in visual mode
|
||||||
|
* [VIM-1303](https://youtrack.jetbrains.com/issue/VIM-1303) Fixed "Changing color schemes doesn't change find input"
|
||||||
|
* [VIM-944](https://youtrack.jetbrains.com/issue/VIM-944) Fixed navigation with keypad arrows
|
||||||
|
* [VIM-1569](https://youtrack.jetbrains.com/issue/VIM-1569) Fixed surround plugin bug by `S<tag attr="attr">`
|
||||||
|
* [VIM-1012](https://youtrack.jetbrains.com/issue/VIM-1012) Fixed wrong tab selection after`:q`
|
||||||
|
* [VIM-1245](https://youtrack.jetbrains.com/issue/VIM-1245) Clear switcher list after`:q`
|
||||||
|
* [VIM-1425](https://youtrack.jetbrains.com/issue/VIM-1425) Correct `%` command
|
||||||
|
* [VIM-1521](https://youtrack.jetbrains.com/issue/VIM-1521) Support `commentary` extension
|
||||||
|
* [VIM-907](https://youtrack.jetbrains.com/issue/VIM-907) Fix `va(` command
|
||||||
|
* [VIM-1067](https://youtrack.jetbrains.com/issue/VIM-1067) Fix repeating of `A` command
|
||||||
|
* [VIM-1615](https://youtrack.jetbrains.com/issue/VIM-1615) Fix `set so=999` command and line "bouncing" with inlays
|
||||||
|
* [VIM-1630](https://youtrack.jetbrains.com/issue/VIM-1630) Support `:tabonly` command
|
||||||
|
* [VIM-607](https://youtrack.jetbrains.com/issue/VIM-607) Fix memory leaks
|
||||||
|
* [VIM-1546](https://youtrack.jetbrains.com/issue/VIM-1546) Storing TAB key as input
|
||||||
|
* [VIM-1231](https://youtrack.jetbrains.com/issue/VIM-1231) Get indent from PsiFile
|
||||||
|
* [VIM-1633](https://youtrack.jetbrains.com/issue/VIM-1633) Fixed sequential text object commands in visual mode
|
||||||
|
* [VIM-1105](https://youtrack.jetbrains.com/issue/VIM-1105) Added the `:command` command
|
||||||
|
* [VIM-1090](https://youtrack.jetbrains.com/issue/VIM-1090) Fixed tag motion with duplicate tags
|
||||||
|
* [VIM-1644](https://youtrack.jetbrains.com/issue/VIM-1644) Fixed repeat with visual mode
|
||||||
|
* Fixed invoking IDE actions instead of command line actions with same shortcuts
|
||||||
|
* [VIM-1550](https://youtrack.jetbrains.com/issue/VIM-1550) Fixed leaving command line mode on backspace
|
||||||
|
* Fix insert position of `<C-R>` in ex commands
|
||||||
|
* Command line editing caret shape and insert digraph/register feedback
|
||||||
|
* [VIM-1419](https://youtrack.jetbrains.com/issue/VIM-1419),
|
||||||
|
[VIM-1493](https://youtrack.jetbrains.com/issue/VIM-1493) Correctly set focus when handling cmode mapping
|
||||||
|
* Fix incorrect handling of subsequent key strokes after ex command line loses focus
|
||||||
|
* [VIM-1240](https://youtrack.jetbrains.com/issue/VIM-1240) Improve UI of ex command line and output panel
|
||||||
|
* [VIM-1485](https://youtrack.jetbrains.com/issue/VIM-1485) Remove incorrect gap between ex command line label and text
|
||||||
|
* [VIM-1496](https://youtrack.jetbrains.com/issue/VIM-1496) Fix focus for Recent Files action
|
||||||
|
* [VIM-1275](https://youtrack.jetbrains.com/issue/VIM-1275) "Change In Brackets" for string
|
||||||
|
* [VIM-941](https://youtrack.jetbrains.com/issue/VIM-941) Fix tab for visual block mode
|
||||||
|
* [VIM-1002](https://youtrack.jetbrains.com/issue/VIM-1002) Fix dot command for tab
|
||||||
|
* [VIM-1426](https://youtrack.jetbrains.com/issue/VIM-1426) Correct `%` command
|
||||||
|
* [VIM-1655](https://youtrack.jetbrains.com/issue/VIM-1655) Deleted word should is not yanked with Ctrl-W in insert mode
|
||||||
|
* [VIM-1031](https://youtrack.jetbrains.com/issue/VIM-1031),
|
||||||
|
[VIM-1389](https://youtrack.jetbrains.com/issue/VIM-1389),
|
||||||
|
[VIM-1666](https://youtrack.jetbrains.com/issue/VIM-1666) Fix `<BS>` for digraphs
|
||||||
|
* [VIM-1628](https://youtrack.jetbrains.com/issue/VIM-1628) Fix dead keys for JBR11
|
||||||
|
* [VIM-1061](https://youtrack.jetbrains.com/issue/VIM-1061) Fix `^K` for digraphs
|
||||||
|
* [VIM-437](https://youtrack.jetbrains.com/issue/VIM-437) Support `keymode` option
|
||||||
|
* [VIM-274](https://youtrack.jetbrains.com/issue/VIM-274) Enter select mode for refactoring
|
||||||
|
* [VIM-510](https://youtrack.jetbrains.com/issue/VIM-510) Support `Extend Selection` for visual mode
|
||||||
|
* [VIM-606](https://youtrack.jetbrains.com/issue/VIM-606) Fix select text with mouse in insert mode
|
||||||
|
* [VIM-800](https://youtrack.jetbrains.com/issue/VIM-800) Fix surround with live template
|
||||||
|
* [VIM-1013](https://youtrack.jetbrains.com/issue/VIM-1013) Fix reformat code on selection
|
||||||
|
* [VIM-1214](https://youtrack.jetbrains.com/issue/VIM-1214) Fix insert text to empty row
|
||||||
|
* [VIM-1452](https://youtrack.jetbrains.com/issue/VIM-1452) Fix reselect visual block
|
||||||
|
* [VIM-1497](https://youtrack.jetbrains.com/issue/VIM-1497) Fix rename variable action
|
||||||
|
* [VIM-1541](https://youtrack.jetbrains.com/issue/VIM-1541) Fix visual block mode problems
|
||||||
|
* [VIM-1619](https://youtrack.jetbrains.com/issue/VIM-1619) Extract method for visual mode
|
||||||
|
* [VIM-1616](https://youtrack.jetbrains.com/issue/VIM-1616) `I` with multicaret works correctly
|
||||||
|
* [VIM-1631](https://youtrack.jetbrains.com/issue/VIM-1631) Fix visual block for tab character
|
||||||
|
* [VIM-1649](https://youtrack.jetbrains.com/issue/VIM-1649) Type variable for surround live template
|
||||||
|
* [VIM-1654](https://youtrack.jetbrains.com/issue/VIM-1654) Fix NPE while indent in visual block mode
|
||||||
|
* [VIM-1657](https://youtrack.jetbrains.com/issue/VIM-1657) Fix vim repeat in visual block
|
||||||
|
* [VIM-1659](https://youtrack.jetbrains.com/issue/VIM-1658) Fix selection on empty line
|
||||||
|
* [VIM-1473](https://youtrack.jetbrains.com/issue/VIM-1473) Yanked lines are not handled as block
|
||||||
|
selection when clipboard is used
|
||||||
|
* [VIM-714](https://youtrack.jetbrains.com/issue/VIM-714) Fixed problems with caret position by vertical movement
|
||||||
|
* [VIM-635](https://youtrack.jetbrains.com/issue/VIM-635) Supported `gn` commands
|
||||||
|
* [VIM-1535](https://youtrack.jetbrains.com/issue/VIM-1535) Use same text attributes and highlight layer as IntelliJ's own Find command
|
||||||
|
* [VIM-1413](https://youtrack.jetbrains.com/issue/VIM-1413) Fix `smartcase` option being ignored in incremental search
|
||||||
|
* Fix incremental search not matching with trailing options, e.g. `/Foo/+1`
|
||||||
|
* Move the current line as well as scrolling during incremental search
|
||||||
|
* [VIM-128](https://youtrack.jetbrains.com/issue/VIM-128) Fix `:substitute` not respecting `ignorecase` and `smartcase` options
|
||||||
|
* Fix next/previous search commands not respecting `smartcase` override
|
||||||
|
* Search highlights are updated when `ignorecase`, `smartcase` and `hlsearch` options are updated, and when plugin is disabled
|
||||||
|
* Incremental search highlights all matches in file, not just first
|
||||||
|
* Added incremental search highlights for `:substitute` command
|
||||||
|
* Fix exception when trying to highlight last CR in file
|
||||||
|
* Improve behavior of `<BS>` in command line entry
|
||||||
|
* [VIM-1626](https://youtrack.jetbrains.com/issue/VIM-1626) Add `ideajoin` option
|
||||||
|
* [VIM-959](https://youtrack.jetbrains.com/issue/VIM-959) Add `ideamarks` option
|
||||||
|
* [VIM-608](https://youtrack.jetbrains.com/issue/VIM-608) Automatic upload files on explicit save
|
||||||
|
* [VIM-1548](https://youtrack.jetbrains.com/issue/VIM-1548) Respect editor settings about tabs and spaces
|
||||||
|
* [VIM-1682](https://youtrack.jetbrains.com/issue/VIM-1682) Fix backward search with OR
|
||||||
|
* [VIM-752](https://youtrack.jetbrains.com/issue/VIM-752) Enter finishes template in normal mode
|
||||||
|
* [VIM-1668](https://youtrack.jetbrains.com/issue/VIM-1668) Fix smart step into
|
||||||
|
* [VIM-1697](https://youtrack.jetbrains.com/issue/VIM-1697) Fix wrong search with tab characters
|
||||||
|
* [VIM-1700](https://youtrack.jetbrains.com/issue/VIM-1700) Fix wrong search with tab characters
|
||||||
|
* [VIM-1698](https://youtrack.jetbrains.com/issue/VIM-1698) Paste doesn't clear clipboard
|
||||||
|
* [VIM-1359](https://youtrack.jetbrains.com/issue/VIM-1359) Fix behavior of i_CTRL-W action
|
||||||
|
|
||||||
|
0.51, 2019-02-12
|
||||||
|
----------------
|
||||||
|
|
||||||
|
* [VIM-1558](https://youtrack.jetbrains.com/issue/VIM-1558) Fixed scrolling for code with block inlays in Rider 2018.3
|
||||||
|
* [VIM-1187](https://youtrack.jetbrains.com/issue/VIM-1187) Improved performance of `set relativelinenumber` on large files
|
||||||
|
* [VIM-620](https://youtrack.jetbrains.com/issue/VIM-620) Fixed handling `<C-O>` and `<Esc>` in Insert and Replace modes
|
||||||
|
* [VIM-798](https://youtrack.jetbrains.com/issue/VIM-798) Allow arrow keys for window navigation commands
|
||||||
|
|
||||||
|
|
||||||
|
0.50, 2018-10-18
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Moved "Vim Emulation" settings into "File | Settings | Vim Emulation". Support
|
||||||
|
for vim-multiple-cursors commands `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>` (put `set
|
||||||
|
multiple-cursors` into your ~/.ideavimrc to enable it). Support for running
|
||||||
|
Vim commands for multiple cursors. Various bug fixes.
|
||||||
|
|
||||||
|
* [VIM-634](https://youtrack.jetbrains.com/issue/VIM-634) Support for vim-multiple-cursors commands `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||||
|
* [VIM-780](https://youtrack.jetbrains.com/issue/VIM-780) Support for running Vim commands for multiple cursors
|
||||||
|
* [VIM-176](https://youtrack.jetbrains.com/issue/VIM-176) Fixed arrow key navigation in Run/Debug tool windows
|
||||||
|
* [VIM-339](https://youtrack.jetbrains.com/issue/VIM-339) Fixed `<Esc>` in diff windows
|
||||||
|
* [VIM-862](https://youtrack.jetbrains.com/issue/VIM-862) Allow `:action` to work in visual mode
|
||||||
|
* [VIM-1110](https://youtrack.jetbrains.com/issue/VIM-1110) Put the caret in correct place after `I` in visual block mode
|
||||||
|
* [VIM-1329](https://youtrack.jetbrains.com/issue/VIM-1329) Request focus reliably for Ex entry and output panels
|
||||||
|
* [VIM-1368](https://youtrack.jetbrains.com/issue/VIM-1368) Wait for focus reliably before running an `:action`
|
||||||
|
* [VIM-1379](https://youtrack.jetbrains.com/issue/VIM-1379) Fixed `I` for short lines in visual block mode
|
||||||
|
* [VIM-1380](https://youtrack.jetbrains.com/issue/VIM-1380) Fixed `cw` with count at the end of a word
|
||||||
|
* [VIM-1404](https://youtrack.jetbrains.com/issue/VIM-1404) Fixed the ability to use `:e#` when editor tabs are hidden
|
||||||
|
* [VIM-1431](https://youtrack.jetbrains.com/issue/VIM-1431) Fixed pasting text into the empty document
|
||||||
|
* [VIM-1427](https://youtrack.jetbrains.com/issue/VIM-1427) Added the support for count to the `it` and `at` motions
|
||||||
|
* [VIM-1287](https://youtrack.jetbrains.com/issue/VIM-1287) Fixed `i(` actions inside string literals
|
||||||
|
* [VIM-1317](https://youtrack.jetbrains.com/issue/VIM-1317) Don't run Undo/Redo inside write actions
|
||||||
|
* [VIM-1366](https://youtrack.jetbrains.com/issue/VIM-1366) Don't wrap a secondary event loop for `input()` into a write action
|
||||||
|
* [VIM-1274](https://youtrack.jetbrains.com/issue/VIM-1274) Correctly process escaping when `smartcase` is on
|
||||||
|
|
||||||
|
|
||||||
|
0.49, 2017-12-12
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Enabled zero-latency typing for Vim emulation. Added support for `iskeyword` option. Various bug fixes.
|
||||||
|
|
||||||
|
* [VIM-1254](https://youtrack.jetbrains.com/issue/VIM-1254) Enable zero-latency typing for Vim emulation
|
||||||
|
* [VIM-1367](https://youtrack.jetbrains.com/issue/VIM-1367) Support `iskeyword` option
|
||||||
|
* [VIM-523](https://youtrack.jetbrains.com/issue/VIM-523) Fixed global mark remembering only the line number
|
||||||
|
|
||||||
|
0.48, 2017-01-15
|
||||||
|
----------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* [VIM-1205](https://youtrack.jetbrains.com/issue/VIM-1205) Don't move key handling into separate event for raw handlers
|
||||||
|
* [VIM-1216](https://youtrack.jetbrains.com/issue/VIM-1216) Fixed `.` resetting the last find movement while repeating change that also uses movement
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
* Support for zero-latency rendering
|
||||||
|
|
||||||
|
|
||||||
|
0.47, 2016-10-19
|
||||||
|
----------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* VIM-1098 Don't start visual selection when mouse click was actually drag over single character
|
||||||
|
* VIM-1190 Fixed exception "Write access is allowed from write-safe contexts only"
|
||||||
|
|
||||||
|
|
||||||
|
0.46, 2016-07-07
|
||||||
|
----------------
|
||||||
|
|
||||||
|
Added `incsearch` option for incremental search. Added support for `it` and
|
||||||
|
`at` tag block selection. Added `vim-surround` commands `ys`, `cs`, `ds`,
|
||||||
|
`S`. Various bug fixes.
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
* VIM-769 Added `vim-surround` commands `ys`, `cs`, `ds`, `S`
|
||||||
|
* VIM-264 Added tag block selection
|
||||||
|
* VIM-271 Added `incsearch` option for showing search results while typing
|
||||||
|
* VIM-217 Added support for `={motion}` formatting command
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
|
||||||
|
* VIM-796 Fixed focus issues with `:action` command
|
||||||
|
* VIM-581 Fixed use of special registers `0`-`9` and `-` in delete commands
|
||||||
|
* VIM-965 Fixed exception in `[m` in some file types
|
||||||
|
* VIM-564 Fixed `g_` move to go to the current line
|
||||||
|
* VIM-964 Fixed marks behavior when the whole line got deleted
|
||||||
|
* VIM-259 Move caret to the line beginning after `==`
|
||||||
|
* VIM-246 Fixed `{count}==` formatting
|
||||||
|
* VIM-287 Fixed insert new line before and after folds
|
||||||
|
* VIM-139 Focus on current search and use modal confirmation for `:s///gc`
|
||||||
|
* VIM-843 Don't highlight search results after restart
|
||||||
|
* VIM-1126 Fixed warning about modifying shortcuts of global actions for 2016.2
|
||||||
|
|
||||||
|
|
||||||
|
0.44, 2015-11-02
|
||||||
|
----------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
|
||||||
|
* VIM-1040 Fixed typing keys in completion menus and typing with the
|
||||||
|
plugin disabled
|
||||||
|
|
||||||
|
|
||||||
|
0.43, 2015-11-02
|
||||||
|
----------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
* VIM-1039 Fixed running the plugin with Java 6
|
||||||
|
|
||||||
|
|
||||||
|
0.42, 2015-11-01
|
||||||
|
----------------
|
||||||
|
|
||||||
|
This release is compatible with IntelliJ 15+ and other IDEs based on the
|
||||||
|
IntelliJ platform branch 143+.
|
||||||
|
|
||||||
|
* VIM-970 Fixed move commands in read-only files
|
||||||
|
|
||||||
|
|
||||||
|
0.41, 2015-06-10
|
||||||
|
----------------
|
||||||
|
|
||||||
|
A bugfix release.
|
||||||
|
|
||||||
|
* VIM-957 Fixed plugin version 0.40 is not compatible with IDEs other than
|
||||||
|
IntelliJ
|
||||||
|
|
||||||
|
|
||||||
0.40, 2015-06-09
|
0.40, 2015-06-09
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
@@ -310,7 +552,7 @@ Bug fixes:
|
|||||||
* VIM-312 Fixed range and caret position after `dw` on the last single-word
|
* VIM-312 Fixed range and caret position after `dw` on the last single-word
|
||||||
line, `w` command argument for the last word in file
|
line, `w` command argument for the last word in file
|
||||||
* Fixed `w` motion at the last word
|
* Fixed `w` motion at the last word
|
||||||
* VIM-85 Bug fix for gi behaviour
|
* VIM-85 Bug fix for gi behavior
|
||||||
* Always move cursor at the beginning of the deleted range
|
* Always move cursor at the beginning of the deleted range
|
||||||
* VIM-275 Fixed edge cases for `i{` motion
|
* VIM-275 Fixed edge cases for `i{` motion
|
||||||
* VIM-314 Made `i{` motion characterwise, not linewise/characterwise in visual
|
* VIM-314 Made `i{` motion characterwise, not linewise/characterwise in visual
|
||||||
|
|||||||
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.
|
||||||
|
|
||||||
106
CONTRIBUTING.md
Normal file
106
CONTRIBUTING.md
Normal file
@@ -0,0 +1,106 @@
|
|||||||
|
<div>
|
||||||
|
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20183&guest=1">
|
||||||
|
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20183)/statusIcon.svg?guest=1"/>
|
||||||
|
</a>
|
||||||
|
<span>2018.3 Tests</span>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
||||||
|
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
||||||
|
</a>
|
||||||
|
<span>2019.1 Tests</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
### Where to Start
|
||||||
|
|
||||||
|
In order to contribute to IdeaVim, you should have some understanding of Java or [Kotlin](https://kotlinlang.org/).
|
||||||
|
|
||||||
|
See also these docs on the IntelliJ API:
|
||||||
|
|
||||||
|
* [IntelliJ architectural overview](http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Architectural+Overview)
|
||||||
|
* [IntelliJ plugin development resources](http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment)
|
||||||
|
|
||||||
|
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 <http://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.
|
||||||
45
LICENSE.txt
45
LICENSE.txt
@@ -1,12 +1,12 @@
|
|||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 2, June 1991
|
Version 2, June 1991
|
||||||
|
|
||||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
|
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||||
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
Preamble
|
Preamble
|
||||||
|
|
||||||
The licenses for most software are designed to take away your
|
The licenses for most software are designed to take away your
|
||||||
freedom to share and change it. By contrast, the GNU General Public
|
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
|
General Public License applies to most of the Free Software
|
||||||
Foundation's software and to any other program whose authors commit to
|
Foundation's software and to any other program whose authors commit to
|
||||||
using it. (Some other Free Software Foundation software is covered by
|
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.
|
your programs, too.
|
||||||
|
|
||||||
When we speak of free software, we are referring to freedom, not
|
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
|
The precise terms and conditions for copying, distribution and
|
||||||
modification follow.
|
modification follow.
|
||||||
|
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||||
|
|
||||||
0. This License applies to any program or other work which contains
|
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
|
License. (Exception: if the Program itself is interactive but
|
||||||
does not normally print such an announcement, your work based on
|
does not normally print such an announcement, your work based on
|
||||||
the Program is not required to print an announcement.)
|
the Program is not required to print an announcement.)
|
||||||
|
|
||||||
These requirements apply to the modified work as a whole. If
|
These requirements apply to the modified work as a whole. If
|
||||||
identifiable sections of that work are not derived from the Program,
|
identifiable sections of that work are not derived from the Program,
|
||||||
and can be reasonably considered independent and separate works in
|
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
|
access to copy the source code from the same place counts as
|
||||||
distribution of the source code, even though third parties are not
|
distribution of the source code, even though third parties are not
|
||||||
compelled to copy the source along with the object code.
|
compelled to copy the source along with the object code.
|
||||||
|
|
||||||
4. You may not copy, modify, sublicense, or distribute the Program
|
4. You may not copy, modify, sublicense, or distribute the Program
|
||||||
except as expressly provided under this License. Any attempt
|
except as expressly provided under this License. Any attempt
|
||||||
otherwise to copy, modify, sublicense or distribute the Program is
|
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
|
This section is intended to make thoroughly clear what is believed to
|
||||||
be a consequence of the rest of this License.
|
be a consequence of the rest of this License.
|
||||||
|
|
||||||
8. If the distribution and/or use of the Program is restricted in
|
8. If the distribution and/or use of the Program is restricted in
|
||||||
certain countries either by patents or by copyrighted interfaces, the
|
certain countries either by patents or by copyrighted interfaces, the
|
||||||
original copyright holder who places the Program under this License
|
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 preserving the free status of all derivatives of our free software and
|
||||||
of promoting the sharing and reuse of software generally.
|
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
|
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
|
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
|
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||||
POSSIBILITY OF SUCH DAMAGES.
|
POSSIBILITY OF SUCH DAMAGES.
|
||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
How to Apply These Terms to Your New Programs
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
If you develop a new program, and you want it to be of the greatest
|
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
|
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.
|
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.>
|
<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
|
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
|
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
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License along
|
||||||
along with this program; if not, write to the Free Software
|
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
|
|
||||||
|
|
||||||
Also add information on how to contact you by electronic and paper mail.
|
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
|
If the program is interactive, make it output a short notice like this
|
||||||
when it starts in an interactive mode:
|
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'.
|
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||||
This is free software, and you are welcome to redistribute it
|
This is free software, and you are welcome to redistribute it
|
||||||
under certain conditions; type `show c' for details.
|
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
|
This General Public License does not permit incorporating your program into
|
||||||
proprietary programs. If your program is a subroutine library, you may
|
proprietary programs. If your program is a subroutine library, you may
|
||||||
consider it more useful to permit linking proprietary applications with the
|
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
|
library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
169
README.md
169
README.md
@@ -2,27 +2,34 @@ IdeaVim
|
|||||||
=======
|
=======
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=bt299&guest=1">
|
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:bt299)/statusIcon"/>
|
<img src="http://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||||
</a>
|
</a>
|
||||||
<span>Build<span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=bt453&guest=1">
|
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Deploy&guest=1">
|
||||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:bt453)/statusIcon"/>
|
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Deploy)/statusIcon.svg?guest=1"/>
|
||||||
</a>
|
</a>
|
||||||
<span>Tests</span>
|
<span>Stable</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
IdeaVim is a Vim emulation plug-in for IDEs based on the IntelliJ platform.
|
<div>
|
||||||
IdeaVim can be used with IntelliJ IDEA, RubyMine, PyCharm, PhpStorm, WebStorm,
|
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Build&guest=1">
|
||||||
AppCode, CLion and Android Studio.
|
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Build)/statusIcon.svg?guest=1"/>
|
||||||
|
</a>
|
||||||
|
<span>EAP</span>
|
||||||
|
</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:
|
Resources:
|
||||||
|
|
||||||
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
|
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
|
||||||
* [Changelog](https://github.com/JetBrains/ideavim/blob/master/CHANGES.md)
|
* [Changelog](CHANGES.md)
|
||||||
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
||||||
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||||
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
||||||
@@ -36,12 +43,35 @@ 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.
|
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
|
If you wish to disable the plugin, select the "Tools | Vim Emulator" menu so
|
||||||
it is unchecked. At this point IDE will work with its regular keyboard
|
it is unchecked. At this point your IDE will work with its regular keyboard
|
||||||
shortcuts.
|
shortcuts.
|
||||||
|
|
||||||
Keyboard shortcut conflicts between the Vim emulation and the IDE can be
|
Keyboard shortcut conflicts between the Vim emulation and the IDE can be
|
||||||
resolved via "File | Settings | Vim Emulation", "File | Settings | Keymap"
|
resolved via "File | Settings | Editor | Vim Emulation", "File | Settings |
|
||||||
and key mapping commands in your ~/.ideavimrc file.
|
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. 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](http://twitter.com/ideavim) in Twitter
|
||||||
|
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
||||||
|
|
||||||
|
|
||||||
Summary of Supported Vim Features
|
Summary of Supported Vim Features
|
||||||
@@ -57,7 +87,7 @@ Supported:
|
|||||||
* Undo/redo
|
* Undo/redo
|
||||||
* Visual mode commands
|
* Visual mode commands
|
||||||
* Some Ex commands
|
* Some Ex commands
|
||||||
* Some [:set options](https://github.com/JetBrains/ideavim/blob/master/doc/set-commands.md)
|
* Some [:set options](doc/set-commands.md)
|
||||||
* Full Vim regexps for search and search/replace
|
* Full Vim regexps for search and search/replace
|
||||||
* Key mappings
|
* Key mappings
|
||||||
* Macros
|
* Macros
|
||||||
@@ -65,15 +95,22 @@ Supported:
|
|||||||
* Command line and search history
|
* Command line and search history
|
||||||
* Window commands
|
* Window commands
|
||||||
* Vim web help
|
* Vim web help
|
||||||
|
* Select mode
|
||||||
|
|
||||||
|
Emulated Vim plugins:
|
||||||
|
|
||||||
|
* vim-surround
|
||||||
|
* vim-multiple-cursors
|
||||||
|
* vim-commentary
|
||||||
|
|
||||||
Not supported (yet):
|
Not supported (yet):
|
||||||
|
|
||||||
* Jump lists
|
* Jump lists
|
||||||
* Various less used commands
|
* Various less-used commands
|
||||||
|
|
||||||
See also:
|
See also:
|
||||||
|
|
||||||
* [List of recently added commands](https://github.com/JetBrains/ideavim/blob/master/src/com/maddyhome/idea/vim/package-info.java)
|
* [The list of all supported commands](src/com/maddyhome/idea/vim/package-info.java)
|
||||||
* [Top features and bugs](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
* [Top features and bugs](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
||||||
|
|
||||||
|
|
||||||
@@ -83,37 +120,59 @@ Files
|
|||||||
* ~/.ideavimrc
|
* ~/.ideavimrc
|
||||||
* Your IdeaVim-specific Vim initialization commands
|
* Your IdeaVim-specific Vim initialization commands
|
||||||
|
|
||||||
You can read your ~/.vimrc file from ~/.ideavimrc using this command:
|
You can read your ~/.vimrc file from ~/.ideavimrc with this command:
|
||||||
|
|
||||||
source ~/.vimrc
|
source ~/.vimrc
|
||||||
|
|
||||||
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching,
|
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching.
|
||||||
see [VIM-669](http://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
See [VIM-669](http://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||||
of VimL files.
|
of VimL files.
|
||||||
|
|
||||||
Also note that if you have overridden the `user.home` JVM option, this will
|
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
|
will affect where IdeaVim looks for your .ideavimrc file. For example, if you
|
||||||
have `-Duser.home=/my/alternate/home` then IdeaVim will source
|
have `-Duser.home=/my/alternate/home` then IdeaVim will source
|
||||||
`/my/alternate/home/.ideavimrc` instead of `~/.ideavimrc`.
|
`/my/alternate/home/.ideavimrc` instead of `~/.ideavimrc`.
|
||||||
|
|
||||||
|
|
||||||
|
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:
|
||||||
|
|
||||||
|
* surround
|
||||||
|
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||||
|
* Commands: `ys`, `cs`, `ds`, `S`
|
||||||
|
* multiple-cursors
|
||||||
|
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||||
|
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||||
|
* commentary
|
||||||
|
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
||||||
|
* Commands: `gcc`, `gc + motion`, `v_gc`
|
||||||
|
|
||||||
|
|
||||||
Changes to the IDE
|
Changes to the IDE
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
### Undo/Redo
|
### Undo/Redo
|
||||||
|
|
||||||
The IdeaVim plugin uses the undo/redo functionality of the IntelliJ platform,
|
The IdeaVim plugin uses the undo/redo functionality of the IntelliJ Platform,
|
||||||
so the behaviour of the `u` and `<C-R>` commands may differ from the original
|
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 the future releases.
|
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||||
|
|
||||||
See also [unresolved undo issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
See also [unresolved undo issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||||
|
|
||||||
### Escape
|
### Escape
|
||||||
|
|
||||||
Using `<Esc>` in dialog windows remains problematic. For most dialog windows
|
Using `<Esc>` in dialog windows remains problematic. For most dialog windows,
|
||||||
the Vim emulator is put into the insert mode without the possibility to switch to
|
the Vim emulator is put into insert mode with `<Esc>` not working. You
|
||||||
the normal mode. In some dialog windows the normal mode is on by default. The
|
should use `<C-c>` or `<C-[>` instead. In some dialog windows, the normal mode is
|
||||||
usage of the Vim emulator in dialog windows is an area for improvements.
|
switched by default. The usage of the Vim emulator in dialog windows is an area for
|
||||||
|
improvement.
|
||||||
|
|
||||||
See also [unresolved escape issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
See also [unresolved escape issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||||
|
|
||||||
@@ -123,7 +182,7 @@ IdeaVim adds two commands for listing and executing arbitrary IDE actions as
|
|||||||
Ex commands or via `:map` command mappings:
|
Ex commands or via `:map` command mappings:
|
||||||
|
|
||||||
* `:actionlist [pattern]`
|
* `:actionlist [pattern]`
|
||||||
* Find IDE actions by name pattern
|
* Find IDE actions by name or keymap pattern (E.g. `:actionlist extract`, `:actionlist <C-D`)
|
||||||
* `:action {name}`
|
* `:action {name}`
|
||||||
* Execute an action named `NAME`
|
* Execute an action named `NAME`
|
||||||
|
|
||||||
@@ -135,62 +194,16 @@ For example, here `\r` is mapped to the Reformat Code action:
|
|||||||
Contributing
|
Contributing
|
||||||
------------
|
------------
|
||||||
|
|
||||||
### Where to Start
|
See [CONTRIBUTING.md](CONTRIBUTING.md)
|
||||||
|
|
||||||
In order to contribute to IdeaVim you should have some understanding of Java.
|
|
||||||
|
|
||||||
See also these docs on the IntelliJ API:
|
|
||||||
|
|
||||||
* [IntelliJ architectural overview](http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Architectural+Overview)
|
|
||||||
* [IntelliJ plugin development resources](http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment)
|
|
||||||
|
|
||||||
You can start by picking relatively simple tasks that are tagged with
|
|
||||||
[#patch_welcome](http://youtrack.jetbrains.com/issues/VIM?q=%23patch_welcome)
|
|
||||||
in the issue tracker.
|
|
||||||
|
|
||||||
|
|
||||||
### Development Environment
|
|
||||||
|
|
||||||
1. Fork IdeaVim on GitHub and clone the repository on your local machine.
|
|
||||||
|
|
||||||
2. Open the project in IntelliJ IDEA 13.1+ (Community or Ultimate) using "File |
|
|
||||||
Open... | /path/to/ideavim".
|
|
||||||
|
|
||||||
3. Set up a JDK if you haven't got it yet. Use "File | Project Structure | SDKs
|
|
||||||
| Add new JDK".
|
|
||||||
|
|
||||||
4. Set up an IntelliJ plugin SDK using "File | Project Structure | SDKs | Add
|
|
||||||
new IntelliJ IDEA Plugin SDK". The correct path to your current installation
|
|
||||||
of IntelliJ will be suggested automatically. You will be prompted to select a
|
|
||||||
JDK for your plugin SDK. Select the JDK from the previous step. You
|
|
||||||
**should** name your plugin SDK `IntelliJ Plugin SDK` in order to match the
|
|
||||||
name in the project settings stored in the Git repository.
|
|
||||||
|
|
||||||
5. Select a project SDK for your project using "File | Project Structure |
|
|
||||||
Project | Project SDK". Choose the plugin SDK you have created at the
|
|
||||||
previous step.
|
|
||||||
|
|
||||||
6. Build IdeaVim and run IntelliJ with IdeaVim enabled using the "IdeaVim" run
|
|
||||||
configuration (use "Run | Run... | IdeaVim"). This will launch a spare
|
|
||||||
instance of IntelliJ running the compiled plugin in a sandboxed enviroment.
|
|
||||||
To actually deploy the plugin the recommended way is executing `ant dist`
|
|
||||||
from command line, which will update versions in plugin.xml among other
|
|
||||||
tasks. Install the generated "ideavim.jar" file from
|
|
||||||
"Settings | Plugins | Install plugin from disk".
|
|
||||||
|
|
||||||
7. In order to be able to run tests in your IntelliJ edition uncomment the
|
|
||||||
appropriate lines in the constructor of the `VimTestCase` class.
|
|
||||||
|
|
||||||
|
|
||||||
Authors
|
Authors
|
||||||
-------
|
-------
|
||||||
|
|
||||||
See [AUTHORS.md](https://github.com/JetBrains/ideavim/blob/master/AUTHORS.md)
|
See [AUTHORS.md](AUTHORS.md)
|
||||||
for a list of authors and contributors.
|
for a list of authors and contributors.
|
||||||
|
|
||||||
|
|
||||||
License
|
License
|
||||||
-------
|
-------
|
||||||
|
|
||||||
IdeaVim is licensed under the terms of the GNU Public license version 2.
|
IdeaVim is licensed under the terms of the GNU Public License version 2.
|
||||||
|
|
||||||
|
|||||||
77
build.gradle
Normal file
77
build.gradle
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'org.jetbrains.intellij' version '0.4.9'
|
||||||
|
}
|
||||||
|
|
||||||
|
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 {
|
||||||
|
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||||
|
compile "org.jetbrains:annotations:17.0.0"
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("slackEapNotification") {
|
||||||
|
doLast {
|
||||||
|
if (!slackUrl) return
|
||||||
|
def post = new URL(slackUrl).openConnection()
|
||||||
|
def message = "{\"text\":\"New EAP released: $version\"}"
|
||||||
|
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.equals(200)) {
|
||||||
|
println(post.getInputStream().getText())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
version-id:0.40
|
|
||||||
platform-version:135.0
|
|
||||||
idea.download.url=http://download.jetbrains.com/idea/ideaIU-14.0.2.zip
|
|
||||||
build.number=dev
|
|
||||||
181
build.xml
181
build.xml
@@ -1,181 +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="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}"/>
|
|
||||||
<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"/>
|
|
||||||
|
|
||||||
<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" encoding="UTF-8" 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}"/>
|
|
||||||
<filter token="BUILD-NUMBER" value="${build.number}"/>
|
|
||||||
</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>
|
|
||||||
|
|
||||||
<target name="build" depends="unzip, clean, compile, jar" 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 file="${basedir}/LICENSE.txt" tofile="${build}/IdeaVim/LICENSE"/>
|
|
||||||
<copy todir="${build}/IdeaVim/lib">
|
|
||||||
<fileset dir="${build}" includes="*.jar"/>
|
|
||||||
</copy>
|
|
||||||
<copy file="${basedir}/README.md" tofile="${build}/IdeaVim/README"/>
|
|
||||||
<copy file="${basedir}/CHANGES.md" tofile="${build}/IdeaVim/CHANGES"/>
|
|
||||||
<zip basedir="${build}" zipfile="${dist}/${filename}-${build.number}.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/**,out/**,*.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" encoding="UTF-8" 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"/>
|
|
||||||
</target>
|
|
||||||
|
|
||||||
<target name="test" depends="unzip, clean, prepare-tests">
|
|
||||||
<mkdir dir="${test-reports}"/>
|
|
||||||
<junit fork="true" forkmode="once" 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"/>
|
|
||||||
<formatter type="xml" usefile="true" />
|
|
||||||
|
|
||||||
<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.
|
||||||
@@ -1,28 +1,92 @@
|
|||||||
List of Supported Set Commands
|
List of Supported Set Commands
|
||||||
==============================
|
==============================
|
||||||
|
|
||||||
The following `:set` commands can appear in `~/.ideavimrc` or set manually in the command mode:
|
The following `:set` commands can appear in `~/.ideavimrc` or be set manually in the command mode:
|
||||||
|
|
||||||
'clipboard' 'cb' clipboard options
|
'clipboard' 'cb' clipboard options
|
||||||
'digraph' 'dg' enable the entering of digraphs in Insert mode
|
Standard clipboard options plus
|
||||||
'gdefault' 'gd' the ":substitute" flag 'g' is default on
|
|
||||||
'history' 'hi' number of command-lines that are remembered
|
`ideaput` (default on) - IdeaVim ONLY
|
||||||
'hlsearch' 'hls' highlight matches with last search pattern
|
enable native idea paste action for put operations
|
||||||
'ignorecase' 'ic' ignore case in search patterns
|
|
||||||
|
'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
|
||||||
|
|
||||||
|
`ideamarks` `ideamarks` Boolean (default true) - IdeaVim ONLY
|
||||||
|
|
||||||
|
If true, creation of global mark will trigger creation of IDE's bookmark
|
||||||
|
and vice versa.
|
||||||
|
|
||||||
|
'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
|
'matchpairs' 'mps' pairs of characters that "%" can match
|
||||||
'nrformats' 'nf' number formats recognized for CTRL-A command
|
'nrformats' 'nf' number formats recognized for CTRL-A command
|
||||||
'number' 'nu' print the line number in front of each line
|
'number' 'nu' print the line number in front of each line
|
||||||
|
|
||||||
|
`lookupactions` `lookupactions` String (default "VimLookupUp,VimLookupDown") - IdeaVim Only
|
||||||
|
|
||||||
|
By default all actions are handled by the IDE if lookup is active.
|
||||||
|
This list of comma-separated words enables defined vim actions for active lookup.
|
||||||
|
|
||||||
'relativenumber' 'rnu' show the line number relative to the line with
|
'relativenumber' 'rnu' show the line number relative to the line with
|
||||||
the cursor
|
the cursor
|
||||||
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
|
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
|
||||||
'scrolljump' 'sj' minimum number of lines to scroll
|
'scrolljump' 'sj' minimum number of lines to scroll
|
||||||
'scrolloff' 'so' minimum nr. of lines above and below cursor
|
'scrolloff' 'so' minimum number of lines above and below the cursor
|
||||||
'selection' 'sel' what type of selection to use
|
'selection' 'sel' what type of selection to use
|
||||||
'showmode' 'smd' message on status line to show current mode
|
|
||||||
'sidescroll' 'ss' minimum number of columns to scroll horizontal
|
`selectmode` `slm` String (default "template")
|
||||||
'sidescrolloff' 'siso' min. nr. of columns to left and right of cursor
|
|
||||||
'smartcase' 'scs' no ignore case when pattern has uppercase
|
This is a comma-separated list of words, which specify when to start
|
||||||
'timeoutlen' 'tm' time that is waited for a mapped key sequence
|
Select mode instead of Visual mode, when a selection is started.
|
||||||
'undolevels' 'ul' maximum number of changes that can be undone
|
Possible values:
|
||||||
'visualbell' 'vb' use visual bell instead of beeping
|
mouse when using the mouse
|
||||||
'wrapscan' 'ws' searches wrap around the end of the file
|
key when using shifted special[1] keys
|
||||||
|
cmd when using "v", "V", or <C-V>
|
||||||
|
template when starting a template - IdeaVim ONLY
|
||||||
|
refactoring when refactoring without - IdeaVim ONLY
|
||||||
|
a template is performed
|
||||||
|
|
||||||
|
'showmode' 'smd' message on the status line to show current mode
|
||||||
|
|
||||||
|
`ideajoin` `ideajoin` Boolean (default false) - IdeaVim ONLY
|
||||||
|
|
||||||
|
If true, join command will be performed via IDE
|
||||||
|
See ideajoin-examples.md
|
||||||
|
|
||||||
|
'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
|
||||||
|
|
||||||
|
----------
|
||||||
|
[1] - cursor keys, <End>, <Home>, <PageUp> and <PageDown>
|
||||||
14
gradle.properties
Normal file
14
gradle.properties
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
ideaVersion=192-EAP-SNAPSHOT
|
||||||
|
downloadIdeaSources=true
|
||||||
|
instrumentPluginCode=true
|
||||||
|
version=SNAPSHOT
|
||||||
|
javaVersion=1.8
|
||||||
|
kotlinVersion=1.3.40
|
||||||
|
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.
24
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
24
gradle/wrapper/gradle-wrapper.properties
vendored
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
#
|
||||||
|
# IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
# Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
|
#Thu Feb 21 15:20:13 MSK 2019
|
||||||
|
distributionBase=GRADLE_USER_HOME
|
||||||
|
distributionPath=wrapper/dists
|
||||||
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
|
||||||
172
gradlew
vendored
Executable file
172
gradlew
vendored
Executable file
@@ -0,0 +1,172 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
##############################################################################
|
||||||
|
##
|
||||||
|
## 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"'
|
||||||
|
|
||||||
|
# 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, switch paths to Windows format before running java
|
||||||
|
if $cygwin ; 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" "$@"
|
||||||
84
gradlew.bat
vendored
Normal file
84
gradlew.bat
vendored
Normal file
@@ -0,0 +1,84 @@
|
|||||||
|
@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"
|
||||||
|
|
||||||
|
@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
|
||||||
15
ideavim.iml
15
ideavim.iml
@@ -1,15 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="PLUGIN_MODULE" version="4">
|
|
||||||
<component name="DevKit.ModuleBuildProperties" url="file://$MODULE_DIR$/resources/META-INF/plugin.xml" />
|
|
||||||
<component name="NewModuleRootManager" inherit-compiler-output="true">
|
|
||||||
<exclude-output />
|
|
||||||
<content url="file://$MODULE_DIR$">
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/resources" isTestSource="false" />
|
|
||||||
<sourceFolder url="file://$MODULE_DIR$/test" isTestSource="true" />
|
|
||||||
</content>
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
||||||
|
|
||||||
191
index.txt
191
index.txt
@@ -1,191 +0,0 @@
|
|||||||
*index.txt*
|
|
||||||
|
|
||||||
|
|
||||||
IDEAVIM REFERENCE MANUAL based on Vim Reference Manual
|
|
||||||
|
|
||||||
*index*
|
|
||||||
This file contains a list of commands that are covered with tests, for each
|
|
||||||
mode, with a tag and a short description. The lists are sorted on ASCII value.
|
|
||||||
|
|
||||||
Tip: When looking for certain functionality, use a search command. E.g.,
|
|
||||||
to look for deleting something, use: "/delete".
|
|
||||||
|
|
||||||
1. Insert mode |insert-index|
|
|
||||||
2. Normal mode |normal-index|
|
|
||||||
2.1. Text objects |objects|
|
|
||||||
2.3. Square bracket commands |[|
|
|
||||||
3. Visual mode |visual-index|
|
|
||||||
5. EX commands |ex-cmd-index|
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
1. Insert mode *insert-index*
|
|
||||||
|
|
||||||
tag char action in Insert mode ~
|
|
||||||
-----------------------------------------------------------------------
|
|
||||||
|i_CTRL-K| CTRL-K {char1} {char2}
|
|
||||||
enter digraph
|
|
||||||
|i_CTRL-O| CTRL-O execute a single command and return to insert
|
|
||||||
mode
|
|
||||||
|i_CTRL-R| CTRL-R {0-9a-z"%#*:=}
|
|
||||||
insert the contents of a register
|
|
||||||
|i_CTRL-W| CTRL-W delete word before the cursor
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
2. Normal mode *normal-index*
|
|
||||||
|
|
||||||
CHAR any non-blank character
|
|
||||||
WORD a sequence of non-blank characters
|
|
||||||
N a number entered before the command
|
|
||||||
{motion} a cursor movement command
|
|
||||||
Nmove the text that is moved over with a {motion}
|
|
||||||
SECTION a section that possibly starts with '}' instead of '{'
|
|
||||||
|
|
||||||
note: 1 = cursor movement command; 2 = can be undone/redone
|
|
||||||
|
|
||||||
tag char note action in Normal mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|quote| "{a-zA-Z0-9.%#:-"} use register {a-zA-Z0-9.%#:-"} for next
|
|
||||||
delete, yank or put (uppercase to append)
|
|
||||||
({.%#:} only work with put)
|
|
||||||
|%| % 1 find the next (curly/square) bracket on
|
|
||||||
this line and go to its match, or go to
|
|
||||||
matching comment bracket, or go to matching
|
|
||||||
preprocessor directive.
|
|
||||||
|/| /{pattern}<CR> 1 search forward for the Nth occurrence of
|
|
||||||
{pattern}
|
|
||||||
|count| 0 1 cursor to the first char of the line
|
|
||||||
|count| 1 prepend to command to give a count
|
|
||||||
|count| 2 "
|
|
||||||
|count| 3 "
|
|
||||||
|count| 4 "
|
|
||||||
|count| 5 "
|
|
||||||
|count| 6 "
|
|
||||||
|count| 7 "
|
|
||||||
|count| 8 "
|
|
||||||
|count| 9 "
|
|
||||||
|F| F{char} 1 cursor to the Nth occurrence of {char} to
|
|
||||||
the left
|
|
||||||
|O| O 2 begin a new line above the cursor and
|
|
||||||
insert text, repeat N times
|
|
||||||
|P| ["x]P 2 put the text [from buffer x] before the
|
|
||||||
cursor N times
|
|
||||||
|T| T{char} 1 cursor till after Nth occurrence of {char}
|
|
||||||
to the left
|
|
||||||
|Y| ["x]Y yank N lines [into buffer x]; synonym for
|
|
||||||
"yy"
|
|
||||||
|c| ["x]c{motion} 2 delete Nmove text [into buffer x] and start
|
|
||||||
insert
|
|
||||||
|cc| ["x]cc 2 delete N lines [into buffer x] and start
|
|
||||||
|d| ["x]d{motion} 2 delete Nmove text [into buffer x]
|
|
||||||
|f| f{char} 1 cursor to Nth occurrence of {char} to the
|
|
||||||
right
|
|
||||||
|i| i 2 insert text before the cursor N times
|
|
||||||
|p| ["x]p 2 put the text [from register x] after the
|
|
||||||
cursor N times
|
|
||||||
|q| q{0-9a-zA-Z"} record typed characters into named register
|
|
||||||
{0-9a-zA-Z"} (uppercase to append)
|
|
||||||
|q| q (while recording) stops recording
|
|
||||||
|t| t{char} 1 cursor till before Nth occurrence of {char}
|
|
||||||
to the right
|
|
||||||
|y| ["x]y{motion} yank Nmove text [into buffer x]
|
|
||||||
|yy| ["x]yy yank N lines [into buffer x]
|
|
||||||
|~| ~ 2 'tildeop' off: switch case of N characters
|
|
||||||
under cursor and move the cursor N
|
|
||||||
characters to the right
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
2.1 Text objects *objects*
|
|
||||||
|
|
||||||
These can be used after an operator or in Visual mode to select an object.
|
|
||||||
|
|
||||||
tag command action in op-pending and Visual mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|v_aquote| a" double quoted string
|
|
||||||
|v_a'| a' single quoted string
|
|
||||||
|v_a(| a( same as ab
|
|
||||||
|v_a)| a) same as ab
|
|
||||||
|v_a<| a< "a <>" from '<' to the matching '>'
|
|
||||||
|v_a>| a> same as a<
|
|
||||||
|v_aB| aB "a Block" from "[{" to "]}" (with brackets)
|
|
||||||
|v_aW| aW "a WORD" (with white space)
|
|
||||||
|v_a[| a[ "a []" from '[' to the matching ']'
|
|
||||||
|v_a]| a] same as a[
|
|
||||||
|v_a`| a` string in backticks
|
|
||||||
|v_ab| ab "a block" from "[(" to "])" (with braces)
|
|
||||||
|v_ap| ap "a paragraph" (with white space)
|
|
||||||
|v_as| as "a sentence" (with white space)
|
|
||||||
|v_aw| aw "a word" (with white space)
|
|
||||||
|v_a{| a{ same as aB
|
|
||||||
|v_a}| a} same as aB
|
|
||||||
|v_iquote| i" double quoted string without the quotes
|
|
||||||
|v_i'| i' single quoted string without the quotes
|
|
||||||
|v_i(| i( same as ib
|
|
||||||
|v_i)| i) same as ib
|
|
||||||
|v_i<| i< "inner <>" from '<' to the matching '>'
|
|
||||||
|v_i>| i> same as i<
|
|
||||||
|v_iB| iB "inner Block" from "[{" and "]}"
|
|
||||||
|v_iW| iW "inner WORD"
|
|
||||||
|v_i[| i[ "inner []" from '[' to the matching ']'
|
|
||||||
|v_i]| i] same as i[
|
|
||||||
|v_i`| i` string in backticks without the backticks
|
|
||||||
|v_ib| ib "inner block" from "[(" to "])"
|
|
||||||
|v_ip| ip "inner paragraph"
|
|
||||||
|v_is| is "inner sentence"
|
|
||||||
|v_iw| iw "inner word"
|
|
||||||
|v_i{| i{ same as iB
|
|
||||||
|v_i}| i} same as iB
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
2.3 Square bracket commands *[* *]*
|
|
||||||
|
|
||||||
tag char note action in Normal mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|[(| [( 1 cursor N times back to unmatched '('
|
|
||||||
|[{| [{ 1 cursor N times back to unmatched '{'
|
|
||||||
|])| ]) 1 cursor N times forward to unmatched ')'
|
|
||||||
|]}| ]} 1 cursor N times forward to unmatched '}'
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
2.4 Commands starting with 'g' *g*
|
|
||||||
|
|
||||||
tag char note action in Normal mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|gg| gg 1 cursor to line N, default first line
|
|
||||||
|gi| gi 2 like "i", but first move to the |'^| mark
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
3. Visual mode *visual-index*
|
|
||||||
|
|
||||||
Most commands in Visual mode are the same as in Normal mode. The ones listed
|
|
||||||
here are those that are different.
|
|
||||||
|
|
||||||
tag command note action in Visual mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|v_y| y yank the highlighted area
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
4. Command-line editing *ex-edit-index*
|
|
||||||
|
|
||||||
Get to the command-line with the ':', '!', '/' or '?' commands.
|
|
||||||
Normal characters are inserted at the current cursor position.
|
|
||||||
"Completion" below refers to context-sensitive completion. It will complete
|
|
||||||
file names, tags, commands etc. as appropriate.
|
|
||||||
|
|
||||||
tag command action in Command-line editing mode ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|c_CTRL-R| CTRL-R {0-9a-z"%#*:= CTRL-F CTRL-P CTRL-W CTRL-A}
|
|
||||||
insert the contents of a register or object
|
|
||||||
under the cursor as if typed
|
|
||||||
|
|
||||||
==============================================================================
|
|
||||||
5. EX commands *ex-cmd-index*
|
|
||||||
|
|
||||||
This is a brief but complete listing of all the ":" commands, without
|
|
||||||
mentioning any arguments. The optional part of the command name is inside [].
|
|
||||||
The commands are sorted on the non-optional part of their name.
|
|
||||||
|
|
||||||
tag command action ~
|
|
||||||
------------------------------------------------------------------------------
|
|
||||||
|:display| :di[splay] display registers
|
|
||||||
|:registers| :reg[isters] display the contents of registers
|
|
||||||
|:substitute| :s[ubstitute] find and replace text
|
|
||||||
@@ -2,38 +2,21 @@
|
|||||||
<name>IdeaVim</name>
|
<name>IdeaVim</name>
|
||||||
<id>IdeaVIM</id>
|
<id>IdeaVIM</id>
|
||||||
<change-notes><![CDATA[
|
<change-notes><![CDATA[
|
||||||
<p>0.40:</p>
|
|
||||||
<ul>
|
<ul>
|
||||||
<li>Support for <code>mapleader</code></li>
|
<li>Support select mode</li>
|
||||||
<li>Support comments in <code>%</code> brace matching</li>
|
<li>Integration with templates & in-line refactorings using Select mode</li>
|
||||||
<li>Various bug fixes</li>
|
<li>Support "Extend selection" action in visual mode</li>
|
||||||
</ul>
|
<li>Commentary extension</li>
|
||||||
<p>0.39:</p>
|
<li>Add options to integrate paste/join/marks with the IDE</li>
|
||||||
<ul>
|
<li>Support 'gn' commands</li>
|
||||||
<li>Various bug fixes</li>
|
<li>Support :command command</li>
|
||||||
</ul>
|
<li>Support :shell command</li>
|
||||||
<p>0.38:</p>
|
<li>Support :tabnext and :tabprevious commands</li>
|
||||||
<ul>
|
|
||||||
<li>Support for <code>:action</code> and <code>:actionlist</code> for executing arbitrary IDE actions</li>
|
|
||||||
<li>Support for <code>number</code> and <code>relativenumber</code> options</li>
|
|
||||||
<li>Support for <code>clipboard=unnamed</code> option</li>
|
|
||||||
<li>Various bug fixes</li>
|
|
||||||
</ul>
|
|
||||||
<p>0.37:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Various bug fixes</li>
|
|
||||||
</ul>
|
|
||||||
<p>0.36:</p>
|
|
||||||
<ul>
|
|
||||||
<li>Window commands from the <code><C-W></code> family</li>
|
|
||||||
<li>Support for <code>:split</code>/<code>:vsplit</code> commands</li>
|
|
||||||
<li>Fixed visual block selection mode</li>
|
|
||||||
<li>Various bug fixes</li>
|
<li>Various bug fixes</li>
|
||||||
</ul>
|
</ul>
|
||||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||||
]]></change-notes>
|
]]></change-notes>
|
||||||
<description><![CDATA[
|
<description><![CDATA[
|
||||||
<p>Build @VERSION@-@BUILD-NUMBER@</p>
|
|
||||||
<p>Vim emulation plug-in for IDEs based on the IntelliJ platform.</p>
|
<p>Vim emulation plug-in for IDEs based on the IntelliJ platform.</p>
|
||||||
<p>IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing, marks, registers, some Ex commands, Vim regexps, configuration via ~/.ideavimrc, macros, window commands, etc.</p>
|
<p>IdeaVim supports many Vim features including normal/insert/visual modes, motion keys, deletion/changing, marks, registers, some Ex commands, Vim regexps, configuration via ~/.ideavimrc, macros, window commands, etc.</p>
|
||||||
<p>See also:</p>
|
<p>See also:</p>
|
||||||
@@ -42,10 +25,10 @@
|
|||||||
<li><a href="http://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
<li><a href="http://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
||||||
</ul>
|
</ul>
|
||||||
]]></description>
|
]]></description>
|
||||||
<version>@VERSION@</version>
|
<version>SNAPSHOT</version>
|
||||||
<vendor>JetBrains</vendor>
|
<vendor>JetBrains</vendor>
|
||||||
|
|
||||||
<idea-version since-build="@SINCE-VERSION@"/>
|
<idea-version since-build="183.2940.10"/>
|
||||||
|
|
||||||
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
||||||
<depends>com.intellij.modules.lang</depends>
|
<depends>com.intellij.modules.lang</depends>
|
||||||
@@ -55,11 +38,31 @@
|
|||||||
<component>
|
<component>
|
||||||
<implementation-class>com.maddyhome.idea.vim.VimPlugin</implementation-class>
|
<implementation-class>com.maddyhome.idea.vim.VimPlugin</implementation-class>
|
||||||
</component>
|
</component>
|
||||||
|
<component>
|
||||||
|
<implementation-class>com.maddyhome.idea.vim.VimLocalConfig</implementation-class>
|
||||||
|
</component>
|
||||||
</application-components>
|
</application-components>
|
||||||
|
<project-components>
|
||||||
|
<component>
|
||||||
|
<implementation-class>com.maddyhome.idea.vim.VimProjectComponent</implementation-class>
|
||||||
|
</component>
|
||||||
|
</project-components>
|
||||||
|
|
||||||
|
<extensionPoints>
|
||||||
|
<extensionPoint qualifiedName="IdeaVIM.vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||||
|
</extensionPoints>
|
||||||
|
|
||||||
<extensions defaultExtensionNs="com.intellij">
|
<extensions defaultExtensionNs="com.intellij">
|
||||||
<errorHandler implementation="com.intellij.diagnostic.ITNReporter"/>
|
<applicationConfigurable groupId="editor" instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
||||||
<applicationConfigurable instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
|
||||||
|
<projectService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||||
|
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||||
|
</extensions>
|
||||||
|
|
||||||
|
<extensions defaultExtensionNs="IdeaVIM">
|
||||||
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.surround.VimSurroundExtension"/>
|
||||||
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.multiplecursors.VimMultipleCursorsExtension"/>
|
||||||
|
<vimExtension implementation="com.maddyhome.idea.vim.extension.commentary.CommentaryExtension"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
|
|
||||||
<actions>
|
<actions>
|
||||||
@@ -74,33 +77,52 @@
|
|||||||
<!-- Left/Right -->
|
<!-- Left/Right -->
|
||||||
<action id="VimMotionColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" text="Move to Column"/>
|
<action id="VimMotionColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" text="Move to Column"/>
|
||||||
<action id="VimMotionFirstColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" text="Start of Line"/>
|
<action id="VimMotionFirstColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" text="Start of Line"/>
|
||||||
|
<action id="VimMotionFirstColumnInsertMode" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnInsertModeAction" text="Start of Line"/>
|
||||||
<action id="VimMotionFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenColumnAction" text="Start of Screen Line"/>
|
<action id="VimMotionFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenColumnAction" text="Start of Screen Line"/>
|
||||||
<action id="VimMotionFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" text="First Character of Line"/>
|
<action id="VimMotionFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" text="First Character of Line"/>
|
||||||
<action id="VimMotionFirstScreenNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenNonSpaceAction" text="First Character of Screen Line"/>
|
<action id="VimMotionFirstScreenNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenNonSpaceAction" text="First Character of Screen Line"/>
|
||||||
<action id="VimMotionLastColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" text="End of Line"/>
|
<action id="VimMotionLastColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" text="End of Line"/>
|
||||||
|
<action id="VimMotionLastColumnInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnInsertAction" text="End of Line"/>
|
||||||
<action id="VimMotionLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastScreenColumnAction" text="End of Screen Line"/>
|
<action id="VimMotionLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastScreenColumnAction" text="End of Screen Line"/>
|
||||||
<action id="VimMotionLastMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" text="Repeat Last Character Match"/>
|
<action id="VimMotionLastMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" text="Repeat Last Character Match"/>
|
||||||
<action id="VimMotionLastMatchCharReverse" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" text="Repeat Last Character Match in Reverse"/>
|
<action id="VimMotionLastMatchCharReverse" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" text="Repeat Last Character Match in Reverse"/>
|
||||||
<action id="VimMotionLastNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" text="Last Character of Line"/>
|
<action id="VimMotionLastNonSpace" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" text="Last Character of Line"/>
|
||||||
<action id="VimMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" text="Left"/>
|
<action id="VimMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" text="Left"/>
|
||||||
|
<action id="VimMotionLeftInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftInsertModeAction" text="Left"/>
|
||||||
<action id="VimMotionLeftWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" text="Left"/>
|
<action id="VimMotionLeftWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" text="Left"/>
|
||||||
<action id="VimMotionLeftMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" text="Move Left to Character"/>
|
<action id="VimMotionLeftMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" text="Move Left to Character"/>
|
||||||
<action id="VimMotionLeftTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" text="Move Left till Character"/>
|
<action id="VimMotionLeftTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" text="Move Left till Character"/>
|
||||||
<action id="VimMotionMiddleColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" text="Middle of Screen"/>
|
<action id="VimMotionMiddleColumn" class="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" text="Middle of Screen"/>
|
||||||
<action id="VimMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" text="Right"/>
|
<action id="VimMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" text="Right"/>
|
||||||
|
<action id="VimMotionRightInsert" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightInsertAction" text="Right"/>
|
||||||
<action id="VimMotionRightWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" text="Right"/>
|
<action id="VimMotionRightWrap" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" text="Right"/>
|
||||||
<action id="VimMotionRightMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" text="Move Right to Character"/>
|
<action id="VimMotionRightMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" text="Move Right to Character"/>
|
||||||
<action id="VimMotionRightTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" text="Move Right till Character"/>
|
<action id="VimMotionRightTillMatchChar" class="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" text="Move Right till Character"/>
|
||||||
|
<action id="VimMotionHome" class="com.maddyhome.idea.vim.action.motion.leftright.MotionHomeAction" text="Move Home Key"/>
|
||||||
|
<action id="VimMotionShiftHome" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction" text="Move Shift Home"/>
|
||||||
|
<action id="VimMotionEnd" class="com.maddyhome.idea.vim.action.motion.leftright.MotionEndAction" text="Move End Key"/>
|
||||||
|
<action id="VimMotionShiftEnd" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction" text="Move Shift End Key"/>
|
||||||
<!-- Up/Down -->
|
<!-- Up/Down -->
|
||||||
<action id="VimMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" text="Down"/>
|
<action id="VimMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" text="Down"/>
|
||||||
|
<action id="VimMotionNotLineWiseDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownNotLineWiseAction" text="Down"/>
|
||||||
<action id="VimMotionDownFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" text="Down to First non-Space"/>
|
<action id="VimMotionDownFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" text="Down to First non-Space"/>
|
||||||
|
<action id="VimEnterNormalAction" class="com.maddyhome.idea.vim.action.motion.updown.EnterNormalAction" text="Down to First non-Space"/>
|
||||||
<action id="VimMotionDownLess1FirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" text="Down to First non-Space"/>
|
<action id="VimMotionDownLess1FirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" text="Down to First non-Space"/>
|
||||||
<action id="VimMotionGotoLineFirst" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" text="Goto Line"/>
|
<action id="VimMotionGotoLineFirst" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" text="Goto Line"/>
|
||||||
|
<action id="VimMotionGotoLineFirstInsertMode" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstInsertAction" text="Goto Line"/>
|
||||||
<action id="VimMotionGotoLineLast" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" text="Goto Line"/>
|
<action id="VimMotionGotoLineLast" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" text="Goto Line"/>
|
||||||
<action id="VimMotionGotoLineLastEnd" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" text="Goto Line End"/>
|
<action id="VimMotionGotoLineLastEnd" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" text="Goto Line End"/>
|
||||||
|
<action id="VimMotionGotoLineLastEndInsert" class="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndInsertAction" text="Goto Line End"/>
|
||||||
<action id="VimMotionPercentOrMatch" class="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" text="Percent Down or Match"/>
|
<action id="VimMotionPercentOrMatch" class="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" text="Percent Down or Match"/>
|
||||||
<action id="VimMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" text="Up"/>
|
<action id="VimMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" text="Up"/>
|
||||||
|
<action id="VimMotionUpNotLineWise" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpNotLineWiseAction" text="Up"/>
|
||||||
<action id="VimMotionUpFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" text="Up to First non-Space"/>
|
<action id="VimMotionUpFirstNonSpace" class="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" text="Up to First non-Space"/>
|
||||||
|
<action id="VimArrowMotionDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionArrowDownAction" text="Arrow Down"/>
|
||||||
|
<action id="VimArrowMotionUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionArrowUpAction" text="Arrow Up"/>
|
||||||
|
<action id="VimArrowMotionLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowLeftAction" text="Arrow Left"/>
|
||||||
|
<action id="VimArrowMotionRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowRightAction" text="Arrow Right"/>
|
||||||
|
<action id="VimLookupDown" class="com.maddyhome.idea.vim.action.window.LookupDownAction" text="Down"/>
|
||||||
|
<action id="VimLookupUp" class="com.maddyhome.idea.vim.action.window.LookupUpAction" text="Up"/>
|
||||||
<!-- Text -->
|
<!-- Text -->
|
||||||
<action id="VimMotionCamelEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction" text="Camel Word End Left"/>
|
<action id="VimMotionCamelEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction" text="Camel Word End Left"/>
|
||||||
<action id="VimMotionCamelEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction" text="Camel Word End Right"/>
|
<action id="VimMotionCamelEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction" text="Camel Word End Right"/>
|
||||||
@@ -112,8 +134,10 @@
|
|||||||
<action id="VimMotionWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" text="Word End Right"/>
|
<action id="VimMotionWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" text="Word End Right"/>
|
||||||
<action id="VimMotionBigWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction" text="BigWord End Right"/>
|
<action id="VimMotionBigWordEndRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction" text="BigWord End Right"/>
|
||||||
<action id="VimMotionWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" text="Word Left"/>
|
<action id="VimMotionWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" text="Word Left"/>
|
||||||
|
<action id="VimMotionWordLeftInsert" class="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftInsertAction" text="Word Left"/>
|
||||||
<action id="VimMotionBigWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction" text="BigWord Left"/>
|
<action id="VimMotionBigWordLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction" text="BigWord Left"/>
|
||||||
<action id="VimMotionWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" text="Word Right"/>
|
<action id="VimMotionWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" text="Word Right"/>
|
||||||
|
<action id="VimMotionWordRightInsert" class="com.maddyhome.idea.vim.action.motion.text.MotionWordRightInsertAction" text="Word Right"/>
|
||||||
<action id="VimMotionBigWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction" text="BigWord Right"/>
|
<action id="VimMotionBigWordRight" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction" text="BigWord Right"/>
|
||||||
<action id="VimMotionSentenceStartNext" class="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextStartAction" text="Next Sentence Start"/>
|
<action id="VimMotionSentenceStartNext" class="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextStartAction" text="Next Sentence Start"/>
|
||||||
<action id="VimMotionSentenceStartPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousStartAction" text="Previous Sentence Start"/>
|
<action id="VimMotionSentenceStartPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousStartAction" text="Previous Sentence Start"/>
|
||||||
@@ -145,6 +169,7 @@
|
|||||||
<action id="VimMotionInnerBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction" text="Select inner double quote block"/>
|
<action id="VimMotionInnerBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction" text="Select inner double quote block"/>
|
||||||
<action id="VimMotionInnerBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction" text="Select inner single quote block"/>
|
<action id="VimMotionInnerBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction" text="Select inner single quote block"/>
|
||||||
<action id="VimMotionInnerBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction" text="Select inner back quote block"/>
|
<action id="VimMotionInnerBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction" text="Select inner back quote block"/>
|
||||||
|
<action id="VimMotionInnerBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockTagAction" text="Select inner >< block >/<"/>
|
||||||
<action id="VimMotionOuterBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction" text="Select outer < block"/>
|
<action id="VimMotionOuterBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction" text="Select outer < block"/>
|
||||||
<action id="VimMotionOuterBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction" text="Select outer { block"/>
|
<action id="VimMotionOuterBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction" text="Select outer { block"/>
|
||||||
<action id="VimMotionOuterBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction" text="Select outer [ block"/>
|
<action id="VimMotionOuterBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction" text="Select outer [ block"/>
|
||||||
@@ -152,6 +177,7 @@
|
|||||||
<action id="VimMotionOuterBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction" text="Select outer double quote block"/>
|
<action id="VimMotionOuterBlockDoubleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction" text="Select outer double quote block"/>
|
||||||
<action id="VimMotionOuterBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction" text="Select outer single quote block"/>
|
<action id="VimMotionOuterBlockSingleQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction" text="Select outer single quote block"/>
|
||||||
<action id="VimMotionOuterBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction" text="Select outer back quote block"/>
|
<action id="VimMotionOuterBlockBackQuote" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction" text="Select outer back quote block"/>
|
||||||
|
<action id="VimMotionOuterBlockTag" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockTagAction" text="Select outer >< block >/<"/>
|
||||||
<action id="VimMotionInnerParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction" text="Select Inner Paragraph"/>
|
<action id="VimMotionInnerParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction" text="Select Inner Paragraph"/>
|
||||||
<action id="VimMotionOuterParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction" text="Select Outer Paragraph"/>
|
<action id="VimMotionOuterParagraph" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction" text="Select Outer Paragraph"/>
|
||||||
<action id="VimMotionInnerSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction" text="Select Inner Sentence"/>
|
<action id="VimMotionInnerSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction" text="Select Inner Sentence"/>
|
||||||
@@ -159,13 +185,15 @@
|
|||||||
<!-- Marks -->
|
<!-- Marks -->
|
||||||
<action id="VimMotionMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" text="Mark"/>
|
<action id="VimMotionMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" text="Mark"/>
|
||||||
<action id="VimMotionGotoFileMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" text="Goto Mark"/>
|
<action id="VimMotionGotoFileMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" text="Goto Mark"/>
|
||||||
|
<action id="VimMotionGotoFileMarkNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkNoSaveJumpAction" text="Goto Mark"/>
|
||||||
<action id="VimMotionGotoFileMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" text="Goto Mark Line"/>
|
<action id="VimMotionGotoFileMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" text="Goto Mark Line"/>
|
||||||
|
<action id="VimMotionGotoFileMarkLineNoSaveJumo" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineNoSaveJumpAction" text="Goto Mark Line"/>
|
||||||
<action id="VimMotionGotoMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" text="Goto Mark"/>
|
<action id="VimMotionGotoMark" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" text="Goto Mark"/>
|
||||||
|
<action id="VimMotionGotoMarkNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkNoSaveJumpAction" text="Goto Mark"/>
|
||||||
<action id="VimMotionGotoMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" text="Goto Mark Line"/>
|
<action id="VimMotionGotoMarkLine" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" text="Goto Mark Line"/>
|
||||||
|
<action id="VimMotionGotoMarkLineNoSaveJump" class="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineNoSaveJumpAction" text="Goto Mark Line"/>
|
||||||
<action id="VimMotionJumpNext" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction" text="Goto Next Jump"/>
|
<action id="VimMotionJumpNext" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction" text="Goto Next Jump"/>
|
||||||
<action id="VimMotionJumpPrevious" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" text="Goto Previous Jump"/>
|
<action id="VimMotionJumpPrevious" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" text="Goto Previous Jump"/>
|
||||||
<action id="VimForward" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction" text="Forward"/>
|
|
||||||
<action id="VimBack" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" text="Back"/>
|
|
||||||
<!-- Screen -->
|
<!-- Screen -->
|
||||||
<action id="VimMotionFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" text="First Screen Line"/>
|
<action id="VimMotionFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" text="First Screen Line"/>
|
||||||
<action id="VimMotionLastScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" text="Last Screen Line"/>
|
<action id="VimMotionLastScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" text="Last Screen Line"/>
|
||||||
@@ -184,11 +212,17 @@
|
|||||||
<action id="VimMotionScrollMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" text="Scroll Line to Middle"/>
|
<action id="VimMotionScrollMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" text="Scroll Line to Middle"/>
|
||||||
<action id="VimMotionScrollMiddleScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction" text="Scroll Line to Middle"/>
|
<action id="VimMotionScrollMiddleScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction" text="Scroll Line to Middle"/>
|
||||||
<action id="VimMotionScrollPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" text="Scroll Page Down"/>
|
<action id="VimMotionScrollPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" text="Scroll Page Down"/>
|
||||||
|
<action id="VimMotionScrollPageDownInsertMode" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownInsertModeAction" text="Scroll Page Down"/>
|
||||||
<action id="VimMotionScrollPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" text="Scroll Page Up"/>
|
<action id="VimMotionScrollPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" text="Scroll Page Up"/>
|
||||||
|
<action id="VimMotionScrollPageUpInsertMode" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpInsertModeAction" text="Scroll Page Up"/>
|
||||||
<action id="VimMotionScrollFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenColumnAction" text="Scroll Column to first column"/>
|
<action id="VimMotionScrollFirstScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenColumnAction" text="Scroll Column to first column"/>
|
||||||
<action id="VimMotionScrollLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenColumnAction" text="Scroll Column to last column"/>
|
<action id="VimMotionScrollLastScreenColumn" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenColumnAction" text="Scroll Column to last column"/>
|
||||||
<action id="VimMotionScrollColumnLeft" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnLeftAction" text="Scroll Column Left"/>
|
<action id="VimMotionScrollColumnLeft" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnLeftAction" text="Scroll Column Left"/>
|
||||||
<action id="VimMotionScrollColumnRight" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction" text="Scroll Column Right"/>
|
<action id="VimMotionScrollColumnRight" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction" text="Scroll Column Right"/>
|
||||||
|
<action id="VimMotionShiftDown" class="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction" text="Shift Down"/>
|
||||||
|
<action id="VimMotionShiftUp" class="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction" text="Shift Up"/>
|
||||||
|
<action id="VimMotionShiftRight" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction" text="Shift Right"/>
|
||||||
|
<action id="VimMotionShiftLeft" class="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction" text="Shift Left"/>
|
||||||
<!-- Visual -->
|
<!-- Visual -->
|
||||||
<action id="VimVisualExitMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" text="Exit Visual Mode"/>
|
<action id="VimVisualExitMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" text="Exit Visual Mode"/>
|
||||||
<action id="VimVisualToggleCharacterMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" text="Toggle Character Selection"/>
|
<action id="VimVisualToggleCharacterMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" text="Toggle Character Selection"/>
|
||||||
@@ -199,6 +233,28 @@
|
|||||||
<action id="VimVisualSelectPrevious" class="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" text="Visual Select Previous"/>
|
<action id="VimVisualSelectPrevious" class="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" text="Visual Select Previous"/>
|
||||||
<action id="VimVisualSwapSelections" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" text="Swap Visual Selection Ends"/>
|
<action id="VimVisualSwapSelections" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" text="Swap Visual Selection Ends"/>
|
||||||
|
|
||||||
|
<!-- Select-->
|
||||||
|
<action id="VimSelectEnableCharacterMode"
|
||||||
|
class="com.maddyhome.idea.vim.action.motion.select.SelectEnableCharacterModeAction"
|
||||||
|
text="Enter Character Select Mode"/>
|
||||||
|
<action id="VimSelectEnableLineMode" class="com.maddyhome.idea.vim.action.motion.select.SelectEnableLineModeAction"
|
||||||
|
text="Enter Line Select Mode"/>
|
||||||
|
<action id="VimSelectEnableBlockMode"
|
||||||
|
class="com.maddyhome.idea.vim.action.motion.select.SelectEnableBlockModeAction"
|
||||||
|
text="Enter Block Select Mode"/>
|
||||||
|
<action id="VimSelectMotionRight" class="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionRightAction"
|
||||||
|
text="Move Right Select Mode"/>
|
||||||
|
<action id="VimSelectMotionLeft" class="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionLeftAction"
|
||||||
|
text="Move Left Select Mode"/>
|
||||||
|
<action id="VimToggleVisual" class="com.maddyhome.idea.vim.action.motion.select.SelectToggleVisualMode"
|
||||||
|
text="Toggle Select/Visual mode"/>
|
||||||
|
<action id="VimSelectInsert" class="com.maddyhome.idea.vim.action.motion.select.SelectEnterAction"
|
||||||
|
text="Select Enter Action"/>
|
||||||
|
<action id="VimEscapeSelect" class="com.maddyhome.idea.vim.action.motion.select.SelectEscapeAction"
|
||||||
|
text="Select Escape Action"/>
|
||||||
|
<action id="VimDeleteAction" class="com.maddyhome.idea.vim.action.motion.select.SelectDeleteAction"
|
||||||
|
text="Select Delete Action"/>
|
||||||
|
|
||||||
<!-- Insert -->
|
<!-- Insert -->
|
||||||
<action id="VimInsertAfterCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" text="Insert After Cursor"/>
|
<action id="VimInsertAfterCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" text="Insert After Cursor"/>
|
||||||
<action id="VimInsertAfterLineEnd" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" text="Insert After Line End"/>
|
<action id="VimInsertAfterLineEnd" class="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" text="Insert After Line End"/>
|
||||||
@@ -250,8 +306,12 @@
|
|||||||
<action id="VimChangeEndOfLine" class="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" text="Change to End-of-Line"/>
|
<action id="VimChangeEndOfLine" class="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" text="Change to End-of-Line"/>
|
||||||
<action id="VimChangeLine" class="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" text="Change Line"/>
|
<action id="VimChangeLine" class="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" text="Change Line"/>
|
||||||
<action id="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
|
<action id="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
|
||||||
<action id="VimChangeNumberInc" class="com.maddyhome.idea.vim.action.change.change.ChangeNumberIncAction" text="Increment Number"/>
|
<action id="VimChangeNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberIncAction" text="Increment Number"/>
|
||||||
<action id="VimChangeNumberDec" class="com.maddyhome.idea.vim.action.change.change.ChangeNumberDecAction" text="Decrement Number"/>
|
<action id="VimChangeNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberDecAction" text="Decrement Number"/>
|
||||||
|
<action id="VimChangeVisualNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberIncAction" text="Increment Number"/>
|
||||||
|
<action id="VimChangeVisualNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberDecAction" text="Decrement Number"/>
|
||||||
|
<action id="VimChangeVisualAvalancheNumberInc" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheIncAction" text="Increment Number"/>
|
||||||
|
<action id="VimChangeVisualAvalancheNumberDec" class="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheDecAction" text="Decrement Number"/>
|
||||||
<action id="VimChangeReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" text="Replace"/>
|
<action id="VimChangeReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" text="Replace"/>
|
||||||
<action id="VimChangeVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" text="Change Motion"/>
|
<action id="VimChangeVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" text="Change Motion"/>
|
||||||
<action id="VimChangeVisualCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" text="Change Motion"/>
|
<action id="VimChangeVisualCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" text="Change Motion"/>
|
||||||
@@ -265,10 +325,13 @@
|
|||||||
|
|
||||||
<!-- Shift -->
|
<!-- Shift -->
|
||||||
<action id="VimAutoIndentLines" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction" text="Auto Indent Lines"/>
|
<action id="VimAutoIndentLines" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentLinesAction" text="Auto Indent Lines"/>
|
||||||
|
<action id="VimAutoIndentMotion" class="com.maddyhome.idea.vim.action.change.shift.AutoIndentMotionAction" text="Auto Indent Lines"/>
|
||||||
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
|
<action id="VimShiftLeftLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" text="Shift Lines Left"/>
|
||||||
|
<action id="VimShiftLeftLinesNormalMode" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesNormalModeAction" text="Shift Lines Left"/>
|
||||||
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
|
<action id="VimShiftLeftMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" text="Shift Motion Left"/>
|
||||||
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
|
<action id="VimShiftLeftVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" text="Shift Visual Left"/>
|
||||||
<action id="VimShiftRightLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" text="Shift Lines Right"/>
|
<action id="VimShiftRightLines" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" text="Shift Lines Right"/>
|
||||||
|
<action id="VimShiftRightLinesNormalMode" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesNormalModeAction" text="Shift Lines Right"/>
|
||||||
<action id="VimShiftRightMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" text="Shift Motion Right"/>
|
<action id="VimShiftRightMotion" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" text="Shift Motion Right"/>
|
||||||
<action id="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
|
<action id="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
|
||||||
|
|
||||||
@@ -281,6 +344,7 @@
|
|||||||
<action id="VimCopyPutTextBeforeCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor" text="Put Text"/>
|
<action id="VimCopyPutTextBeforeCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor" text="Put Text"/>
|
||||||
<action id="VimCopySelectRegister" class="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" text="Select Register"/>
|
<action id="VimCopySelectRegister" class="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" text="Select Register"/>
|
||||||
<action id="VimCopyYankLine" class="com.maddyhome.idea.vim.action.copy.YankLineAction" text="Yank Line"/>
|
<action id="VimCopyYankLine" class="com.maddyhome.idea.vim.action.copy.YankLineAction" text="Yank Line"/>
|
||||||
|
<action id="VimCopyYankMidCountLine" class="com.maddyhome.idea.vim.action.copy.YankLineMidCountAction" text="Yank Line"/>
|
||||||
<action id="VimCopyYankMotion" class="com.maddyhome.idea.vim.action.copy.YankMotionAction" text="Yank Motion"/>
|
<action id="VimCopyYankMotion" class="com.maddyhome.idea.vim.action.copy.YankMotionAction" text="Yank Motion"/>
|
||||||
<action id="VimCopyYankVisual" class="com.maddyhome.idea.vim.action.copy.YankVisualAction" text="Yank Motion"/>
|
<action id="VimCopyYankVisual" class="com.maddyhome.idea.vim.action.copy.YankVisualAction" text="Yank Motion"/>
|
||||||
<action id="VimCopyYankVisualLines" class="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" text="Yank Motion"/>
|
<action id="VimCopyYankVisualLines" class="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" text="Yank Motion"/>
|
||||||
@@ -325,10 +389,7 @@
|
|||||||
<action id="VimPlaybackLastRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction" text="Playback Last Register"/>
|
<action id="VimPlaybackLastRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction" text="Playback Last Register"/>
|
||||||
|
|
||||||
<!-- Command Line -->
|
<!-- Command Line -->
|
||||||
<action id="VimExBackspace" class="com.maddyhome.idea.vim.action.ex.BackspaceAction" text="Backspace"/>
|
|
||||||
<action id="VimProcessExEntry" class="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" text="Process Ex Entry"/>
|
<action id="VimProcessExEntry" class="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" text="Process Ex Entry"/>
|
||||||
<action id="VimProcessExKey" class="com.maddyhome.idea.vim.action.ex.ProcessExKeyAction" text="Process Ex Key"/>
|
|
||||||
<action id="VimCancelExEntry" class="com.maddyhome.idea.vim.action.ex.CancelExEntryAction" text="Cancel Ex Entry"/>
|
|
||||||
|
|
||||||
<!-- Other -->
|
<!-- Other -->
|
||||||
<action id="VimLastSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" text="Repeat Last :s"/>
|
<action id="VimLastSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" text="Repeat Last :s"/>
|
||||||
@@ -340,7 +401,20 @@
|
|||||||
<action id="VimRedo" class="com.maddyhome.idea.vim.action.change.RedoAction" text="Redo"/>
|
<action id="VimRedo" class="com.maddyhome.idea.vim.action.change.RedoAction" text="Redo"/>
|
||||||
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
|
<action id="VimUndo" class="com.maddyhome.idea.vim.action.change.UndoAction" text="Undo"/>
|
||||||
|
|
||||||
|
<!-- Internal -->
|
||||||
|
<action id="VimInternalAddInlays" class="com.maddyhome.idea.vim.action.internal.AddInlaysAction" text="Add test inlays | IdeaVim internal" internal="true"/>
|
||||||
|
|
||||||
<!-- Keys -->
|
<!-- Keys -->
|
||||||
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Vim Shortcuts"/>
|
<action id="VimShortcutKeyAction" class="com.maddyhome.idea.vim.action.VimShortcutKeyAction" text="Shortcuts"/>
|
||||||
|
<action id="VimOperatorAction" class="com.maddyhome.idea.vim.action.change.OperatorAction" text="Operator"/>
|
||||||
|
|
||||||
|
<!-- Visual Selection of last Search Pattern (gn) -->
|
||||||
|
<action id="VimVisualSelectNextSearch" class="com.maddyhome.idea.vim.action.motion.gn.VisualSelectNextSearch" text="Visual Select Next Search"/>
|
||||||
|
<action id="VimVisualSelectPreviousSearch" class="com.maddyhome.idea.vim.action.motion.gn.VisualSelectPreviousSearch" text="Visual Select Previous Search"/>
|
||||||
|
<action id="VimGnNextTextObject" class="com.maddyhome.idea.vim.action.motion.gn.GnNextTextObject" text="Gn Next Text Object"/>
|
||||||
|
<action id="VimGnPreviousTextObject" class="com.maddyhome.idea.vim.action.motion.gn.GnPreviousTextObject" text="Gn Previous Text Object"/>
|
||||||
|
|
||||||
|
<action id="VimCtrlDownAction" class="com.maddyhome.idea.vim.action.motion.scroll.CtrlDownAction" text="Ctrl down"/>
|
||||||
|
<action id="VimCtrlUpAction" class="com.maddyhome.idea.vim.action.motion.scroll.CtrlUpAction" text="Ctrl up"/>
|
||||||
</actions>
|
</actions>
|
||||||
</idea-plugin>
|
</idea-plugin>
|
||||||
|
|||||||
@@ -1,8 +1,27 @@
|
|||||||
|
#
|
||||||
|
# IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
# Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
#
|
||||||
|
|
||||||
notexcmd=Not an editor command: {0}
|
notexcmd=Not an editor command: {0}
|
||||||
intbadcmd=Internal error - invalid command: {0}
|
intbadcmd=Internal error - invalid command: {0}
|
||||||
e_backslash=E10: \\ should be followed by /, ? or &
|
e_backslash=E10: \\ should be followed by /, ? or &
|
||||||
e_badrange=Unexpected character ''{0}'' in range
|
e_badrange=Unexpected character ''{0}'' in range
|
||||||
e_norange=No range allowed
|
e_norange=No range allowed
|
||||||
|
e_rangereq=Range required
|
||||||
e_argreq=Argument required
|
e_argreq=Argument required
|
||||||
e_noprev=E34: No previous command
|
e_noprev=E34: No previous command
|
||||||
e_nopresub=E33: No previous substitute regular expression
|
e_nopresub=E33: No previous substitute regular expression
|
||||||
@@ -48,3 +67,4 @@ E385=E385: search hit BOTTOM without match for: {0}
|
|||||||
e_patnotf2=Pattern not found: {0}
|
e_patnotf2=Pattern not found: {0}
|
||||||
unkopt=Unknown option: {0}
|
unkopt=Unknown option: {0}
|
||||||
e_invarg=Invalid argument: {0}
|
e_invarg=Invalid argument: {0}
|
||||||
|
E774=E774: 'operatorfunc' is empty
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,15 +16,4 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.common;
|
rootProject.name = 'IdeaVIM'
|
||||||
|
|
||||||
import com.intellij.openapi.editor.LogicalPosition;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class CharacterPosition extends LogicalPosition {
|
|
||||||
public CharacterPosition(int line, int col) {
|
|
||||||
super(line, col);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,8 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
|
import com.intellij.codeInsight.lookup.LookupManager;
|
||||||
|
import com.intellij.codeInsight.template.TemplateManager;
|
||||||
|
import com.intellij.codeInsight.template.TemplateManagerListener;
|
||||||
|
import com.intellij.find.FindManager;
|
||||||
|
import com.intellij.find.FindModelListener;
|
||||||
|
import com.intellij.ide.bookmarks.BookmarksListener;
|
||||||
import com.intellij.openapi.Disposable;
|
import com.intellij.openapi.Disposable;
|
||||||
import com.intellij.openapi.actionSystem.AnAction;
|
import com.intellij.openapi.actionSystem.AnAction;
|
||||||
import com.intellij.openapi.actionSystem.ShortcutSet;
|
import com.intellij.openapi.actionSystem.ShortcutSet;
|
||||||
|
import com.intellij.openapi.actionSystem.ex.AnActionListener;
|
||||||
import com.intellij.openapi.editor.Document;
|
import com.intellij.openapi.editor.Document;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.EditorFactory;
|
import com.intellij.openapi.editor.EditorFactory;
|
||||||
@@ -12,13 +37,17 @@ import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
|||||||
import com.intellij.openapi.editor.event.*;
|
import com.intellij.openapi.editor.event.*;
|
||||||
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
|
import com.intellij.openapi.fileEditor.FileEditorManagerListener;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.project.ProjectManager;
|
import com.intellij.openapi.util.Disposer;
|
||||||
import com.intellij.openapi.project.ProjectManagerListener;
|
|
||||||
import com.intellij.util.messages.MessageBusConnection;
|
import com.intellij.util.messages.MessageBusConnection;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
import java.awt.event.MouseListener;
|
||||||
|
import java.beans.PropertyChangeListener;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
@@ -27,6 +56,7 @@ public class EventFacade {
|
|||||||
@NotNull private static final EventFacade ourInstance = new EventFacade();
|
@NotNull private static final EventFacade ourInstance = new EventFacade();
|
||||||
|
|
||||||
@Nullable private TypedActionHandler myOriginalTypedActionHandler;
|
@Nullable private TypedActionHandler myOriginalTypedActionHandler;
|
||||||
|
private Map<Project, MessageBusConnection> connections = new HashMap<>();
|
||||||
|
|
||||||
private EventFacade() {
|
private EventFacade() {
|
||||||
}
|
}
|
||||||
@@ -36,19 +66,19 @@ public class EventFacade {
|
|||||||
return ourInstance;
|
return ourInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addProjectManagerListener(@NotNull ProjectManagerListener listener) {
|
public void setupTypedActionHandler(@NotNull VimTypedActionHandler handler) {
|
||||||
ProjectManager.getInstance().addProjectManagerListener(listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setupTypedActionHandler(@NotNull TypedActionHandler handler) {
|
|
||||||
final TypedAction typedAction = getTypedAction();
|
final TypedAction typedAction = getTypedAction();
|
||||||
myOriginalTypedActionHandler = typedAction.getHandler();
|
final TypedActionHandler rawHandler = typedAction.getRawHandler();
|
||||||
typedAction.setupHandler(handler);
|
if (!(rawHandler instanceof VimTypedActionHandler)) {
|
||||||
|
// Actually this if should always be true, but just as protection
|
||||||
|
myOriginalTypedActionHandler = rawHandler;
|
||||||
|
typedAction.setupRawHandler(handler);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void restoreTypedActionHandler() {
|
public void restoreTypedActionHandler() {
|
||||||
if (myOriginalTypedActionHandler != null) {
|
if (myOriginalTypedActionHandler != null) {
|
||||||
getTypedAction().setupHandler(myOriginalTypedActionHandler);
|
getTypedAction().setupRawHandler(myOriginalTypedActionHandler);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,15 +87,40 @@ public class EventFacade {
|
|||||||
action.registerCustomShortcutSet(shortcutSet, component);
|
action.registerCustomShortcutSet(shortcutSet, component);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerCustomShortcutSet(@NotNull AnAction action, @NotNull ShortcutSet shortcutSet,
|
||||||
|
@Nullable JComponent component, @NotNull Disposable disposable) {
|
||||||
|
action.registerCustomShortcutSet(shortcutSet, component, disposable);
|
||||||
|
}
|
||||||
|
|
||||||
public void unregisterCustomShortcutSet(@NotNull AnAction action, @Nullable JComponent component) {
|
public void unregisterCustomShortcutSet(@NotNull AnAction action, @Nullable JComponent component) {
|
||||||
action.unregisterCustomShortcutSet(component);
|
action.unregisterCustomShortcutSet(component);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addFileEditorManagerListener(@NotNull Project project, @NotNull FileEditorManagerListener listener) {
|
public void connectFileEditorManagerListener(@NotNull Project project, @NotNull FileEditorManagerListener listener) {
|
||||||
final MessageBusConnection connection = project.getMessageBus().connect();
|
final MessageBusConnection connection = getConnection(project);
|
||||||
connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, listener);
|
connection.subscribe(FileEditorManagerListener.FILE_EDITOR_MANAGER, listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void connectAnActionListener(@NotNull Project project, @NotNull AnActionListener listener) {
|
||||||
|
final MessageBusConnection connection = getConnection(project);
|
||||||
|
connection.subscribe(AnActionListener.TOPIC, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connectTemplateStartedListener(@NotNull Project project, @NotNull TemplateManagerListener listener) {
|
||||||
|
final MessageBusConnection connection = getConnection(project);
|
||||||
|
connection.subscribe(TemplateManager.TEMPLATE_STARTED_TOPIC, listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connectBookmarkListener(@NotNull Project project, @NotNull BookmarksListener bookmarksListener) {
|
||||||
|
final MessageBusConnection connection = getConnection(project);
|
||||||
|
connection.subscribe(BookmarksListener.TOPIC, bookmarksListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connectFindModelListener(@NotNull Project project, @NotNull FindModelListener findModelListener) {
|
||||||
|
final MessageBusConnection connection = getConnection(project);
|
||||||
|
connection.subscribe(FindManager.FIND_MODEL_TOPIC, findModelListener);
|
||||||
|
}
|
||||||
|
|
||||||
public void addDocumentListener(@NotNull Document document, @NotNull DocumentListener listener) {
|
public void addDocumentListener(@NotNull Document document, @NotNull DocumentListener listener) {
|
||||||
document.addDocumentListener(listener);
|
document.addDocumentListener(listener);
|
||||||
}
|
}
|
||||||
@@ -78,6 +133,12 @@ public class EventFacade {
|
|||||||
EditorFactory.getInstance().addEditorFactoryListener(listener, parentDisposable);
|
EditorFactory.getInstance().addEditorFactoryListener(listener, parentDisposable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void removeEditorFactoryListener(@NotNull EditorFactoryListener listener) {
|
||||||
|
// Listener is removed not only if application is disposed
|
||||||
|
//noinspection deprecation
|
||||||
|
EditorFactory.getInstance().removeEditorFactoryListener(listener);
|
||||||
|
}
|
||||||
|
|
||||||
public void addEditorMouseListener(@NotNull Editor editor, @NotNull EditorMouseListener listener) {
|
public void addEditorMouseListener(@NotNull Editor editor, @NotNull EditorMouseListener listener) {
|
||||||
editor.addEditorMouseListener(listener);
|
editor.addEditorMouseListener(listener);
|
||||||
}
|
}
|
||||||
@@ -86,6 +147,14 @@ public class EventFacade {
|
|||||||
editor.removeEditorMouseListener(listener);
|
editor.removeEditorMouseListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void addComponentMouseListener(@NotNull Component component, @NotNull MouseListener mouseListener) {
|
||||||
|
component.addMouseListener(mouseListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeComponentMouseListener(@NotNull Component component, @NotNull MouseListener mouseListener) {
|
||||||
|
component.removeMouseListener(mouseListener);
|
||||||
|
}
|
||||||
|
|
||||||
public void addEditorMouseMotionListener(@NotNull Editor editor, @NotNull EditorMouseMotionListener listener) {
|
public void addEditorMouseMotionListener(@NotNull Editor editor, @NotNull EditorMouseMotionListener listener) {
|
||||||
editor.addEditorMouseMotionListener(listener);
|
editor.addEditorMouseMotionListener(listener);
|
||||||
}
|
}
|
||||||
@@ -102,6 +171,31 @@ public class EventFacade {
|
|||||||
editor.getSelectionModel().removeSelectionListener(listener);
|
editor.getSelectionModel().removeSelectionListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerLookupListener(@NotNull Project project, @NotNull PropertyChangeListener propertyChangeListener) {
|
||||||
|
LookupManager.getInstance(project).addPropertyChangeListener(propertyChangeListener, project);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void removeLookupListener(@NotNull Project project, @NotNull PropertyChangeListener propertyChangeListener) {
|
||||||
|
LookupManager.getInstance(project).removePropertyChangeListener(propertyChangeListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void disableBusConnection() {
|
||||||
|
connections.values().forEach(MessageBusConnection::disconnect);
|
||||||
|
connections.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private MessageBusConnection getConnection(Project project) {
|
||||||
|
if (!connections.containsKey(project)) {
|
||||||
|
final MessageBusConnection connection = project.getMessageBus().connect();
|
||||||
|
connections.put(project, connection);
|
||||||
|
Disposer.register(project, () -> {
|
||||||
|
connection.disconnect();
|
||||||
|
connections.remove(project);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return connections.get(project);
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private TypedAction getTypedAction() {
|
private TypedAction getTypedAction() {
|
||||||
return EditorActionManager.getInstance().getTypedAction();
|
return EditorActionManager.getInstance().getTypedAction();
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -18,31 +18,28 @@
|
|||||||
|
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.ActionManager;
|
import com.intellij.ide.IdeEventQueue;
|
||||||
import com.intellij.openapi.actionSystem.AnAction;
|
import com.intellij.openapi.actionSystem.*;
|
||||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
|
||||||
import com.intellij.openapi.application.Application;
|
import com.intellij.openapi.application.Application;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
|
import com.intellij.openapi.application.ModalityState;
|
||||||
import com.intellij.openapi.command.CommandProcessor;
|
import com.intellij.openapi.command.CommandProcessor;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
import com.maddyhome.idea.vim.action.MotionEditorAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.action.TextObjectAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.*;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
|
||||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||||
import com.maddyhome.idea.vim.helper.*;
|
import com.maddyhome.idea.vim.helper.*;
|
||||||
import com.maddyhome.idea.vim.key.*;
|
import com.maddyhome.idea.vim.key.*;
|
||||||
import com.maddyhome.idea.vim.option.Options;
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -91,6 +88,28 @@ public class KeyHandler {
|
|||||||
return origHandler;
|
return origHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute an action
|
||||||
|
*
|
||||||
|
* @param action The action to execute
|
||||||
|
* @param context The context to run it in
|
||||||
|
*/
|
||||||
|
public static boolean executeAction(@NotNull AnAction action, @NotNull DataContext context) {
|
||||||
|
// Hopefully all the arguments are sufficient. So far they all seem to work OK.
|
||||||
|
// We don't have a specific InputEvent so that is null
|
||||||
|
// What is "place"? Leave it the empty string for now.
|
||||||
|
// Is the template presentation sufficient?
|
||||||
|
// What are the modifiers? Is zero OK?
|
||||||
|
final AnActionEvent event =
|
||||||
|
new AnActionEvent(null, context, ActionPlaces.ACTION_SEARCH, action.getTemplatePresentation(), ActionManager.getInstance(), 0);
|
||||||
|
action.update(event);
|
||||||
|
if (event.getPresentation().isEnabled()) {
|
||||||
|
action.actionPerformed(event);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the main key handler for the Vim plugin. Every keystroke not handled directly by Idea is sent here for
|
* This is the main key handler for the Vim plugin. Every keystroke not handled directly by Idea is sent here for
|
||||||
* processing.
|
* processing.
|
||||||
@@ -103,12 +122,36 @@ public class KeyHandler {
|
|||||||
handleKey(editor, key, context, true);
|
handleKey(editor, key, context, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void handleKey(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
|
/**
|
||||||
|
* Invoked before acquiring a write lock and actually handling the keystroke.
|
||||||
|
* <p>
|
||||||
|
* Drafts an optional {@link ActionPlan} that will be used as a base for zero-latency rendering in editor.
|
||||||
|
*
|
||||||
|
* @param editor The editor the key was typed into
|
||||||
|
* @param key The keystroke typed by the user
|
||||||
|
* @param context The data context
|
||||||
|
* @param plan The current action plan
|
||||||
|
*/
|
||||||
|
public void beforeHandleKey(@NotNull Editor editor,
|
||||||
|
@NotNull KeyStroke key,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull ActionPlan plan) {
|
||||||
|
|
||||||
|
final CommandState.Mode mode = CommandState.getInstance(editor).getMode();
|
||||||
|
|
||||||
|
if (mode == CommandState.Mode.INSERT || mode == CommandState.Mode.REPLACE) {
|
||||||
|
VimPlugin.getChange().beforeProcessKey(editor, context, key, plan);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void handleKey(@NotNull Editor editor,
|
||||||
|
@NotNull KeyStroke key,
|
||||||
|
@NotNull DataContext context,
|
||||||
boolean allowKeyMappings) {
|
boolean allowKeyMappings) {
|
||||||
VimPlugin.clearError();
|
VimPlugin.clearError();
|
||||||
// All the editor actions should be performed with top level editor!!!
|
// All the editor actions should be performed with top level editor!!!
|
||||||
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
|
// Be careful: all the EditorActionHandler implementation should correctly process InjectedEditors
|
||||||
editor = InjectedLanguageUtil.getTopLevelEditor(editor);
|
editor = HelperKt.getTopLevelEditor(editor);
|
||||||
final CommandState editorState = CommandState.getInstance(editor);
|
final CommandState editorState = CommandState.getInstance(editor);
|
||||||
|
|
||||||
// If this is a "regular" character keystroke, get the character
|
// If this is a "regular" character keystroke, get the character
|
||||||
@@ -147,7 +190,7 @@ public class KeyHandler {
|
|||||||
|
|
||||||
// Ask the key/action tree if this is an appropriate key at this point in the command and if so,
|
// Ask the key/action tree if this is an appropriate key at this point in the command and if so,
|
||||||
// return the node matching this keystroke
|
// return the node matching this keystroke
|
||||||
final Node node = editorState.getCurrentNode().getChild(key);
|
final Node node = editorState.getCurrentNode().getChildOrArgument(key);
|
||||||
|
|
||||||
if (handleDigraph(editor, key, context, node)) {
|
if (handleDigraph(editor, key, context, node)) {
|
||||||
return;
|
return;
|
||||||
@@ -159,7 +202,7 @@ public class KeyHandler {
|
|||||||
}
|
}
|
||||||
// If this is a command node the user has entered a valid key sequence of a known command
|
// If this is a command node the user has entered a valid key sequence of a known command
|
||||||
else if (node instanceof CommandNode) {
|
else if (node instanceof CommandNode) {
|
||||||
handleCommandNode(editor, context, (CommandNode)node);
|
handleCommandNode(editor, (CommandNode)node);
|
||||||
}
|
}
|
||||||
// If this is an argument node then the last keystroke was not part of the current command but should
|
// If this is an argument node then the last keystroke was not part of the current command but should
|
||||||
// be the first keystroke of the argument of the current command
|
// be the first keystroke of the argument of the current command
|
||||||
@@ -167,7 +210,7 @@ public class KeyHandler {
|
|||||||
shouldRecord = handleArgumentNode(editor, key, context, editorState, (ArgumentNode)node);
|
shouldRecord = handleArgumentNode(editor, key, context, editorState, (ArgumentNode)node);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (lastWasBS && lastChar != 0 && Options.getInstance().isSet("digraph")) {
|
if (lastWasBS && lastChar != 0 && OptionsManager.INSTANCE.getDigraph().isSet()) {
|
||||||
char dig = VimPlugin.getDigraph().getDigraph(lastChar, key.getKeyChar());
|
char dig = VimPlugin.getDigraph().getDigraph(lastChar, key.getKeyChar());
|
||||||
key = KeyStroke.getKeyStroke(dig);
|
key = KeyStroke.getKeyStroke(dig);
|
||||||
}
|
}
|
||||||
@@ -178,6 +221,11 @@ public class KeyHandler {
|
|||||||
shouldRecord = false;
|
shouldRecord = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (editorState.getMode() == CommandState.Mode.SELECT) {
|
||||||
|
if (!VimPlugin.getChange().processKeyInSelectMode(editor, context, key)) {
|
||||||
|
shouldRecord = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if (editorState.getMappingMode() == MappingMode.CMD_LINE) {
|
else if (editorState.getMappingMode() == MappingMode.CMD_LINE) {
|
||||||
if (!VimPlugin.getProcess().processExKey(editor, key)) {
|
if (!VimPlugin.getProcess().processExKey(editor, key)) {
|
||||||
shouldRecord = false;
|
shouldRecord = false;
|
||||||
@@ -188,7 +236,8 @@ public class KeyHandler {
|
|||||||
state = State.BAD_COMMAND;
|
state = State.BAD_COMMAND;
|
||||||
}
|
}
|
||||||
|
|
||||||
lastChar = key.getKeyChar();
|
lastChar = lastWasBS && lastChar != 0 ? 0 : key.getKeyChar();
|
||||||
|
lastWasBS = false;
|
||||||
partialReset(editor);
|
partialReset(editor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -216,69 +265,6 @@ public class KeyHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleKeyMapping(@NotNull final Editor editor, @NotNull KeyStroke key,
|
|
||||||
@NotNull final DataContext context) {
|
|
||||||
final CommandState commandState = CommandState.getInstance(editor);
|
|
||||||
commandState.stopMappingTimer();
|
|
||||||
|
|
||||||
final List<KeyStroke> mappingKeys = commandState.getMappingKeys();
|
|
||||||
final List<KeyStroke> fromKeys = new ArrayList<KeyStroke>(mappingKeys);
|
|
||||||
fromKeys.add(key);
|
|
||||||
|
|
||||||
final MappingMode mappingMode = commandState.getMappingMode();
|
|
||||||
if (MappingMode.NVO.contains(mappingMode) && (state != State.NEW_COMMAND || currentArg != Argument.Type.NONE)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
final KeyMapping mapping = VimPlugin.getKey().getKeyMapping(mappingMode);
|
|
||||||
final MappingInfo mappingInfo = mapping.get(fromKeys);
|
|
||||||
|
|
||||||
if (mapping.isPrefix(fromKeys)) {
|
|
||||||
mappingKeys.add(key);
|
|
||||||
commandState.startMappingTimer(new ActionListener() {
|
|
||||||
@Override
|
|
||||||
public void actionPerformed(ActionEvent actionEvent) {
|
|
||||||
mappingKeys.clear();
|
|
||||||
for (KeyStroke keyStroke : fromKeys) {
|
|
||||||
handleKey(editor, keyStroke, new EditorDataContext(editor), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else if (mappingInfo != null) {
|
|
||||||
mappingKeys.clear();
|
|
||||||
final Application application = ApplicationManager.getApplication();
|
|
||||||
final Runnable handleMappedKeys = new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
final boolean fromIsPrefix = isPrefix(mappingInfo.getFromKeys(), mappingInfo.getToKeys());
|
|
||||||
boolean first = true;
|
|
||||||
for (KeyStroke keyStroke : mappingInfo.getToKeys()) {
|
|
||||||
final boolean recursive = mappingInfo.isRecursive() && !(first && fromIsPrefix);
|
|
||||||
handleKey(editor, keyStroke, new EditorDataContext(editor), recursive);
|
|
||||||
first = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
if (application.isUnitTestMode()) {
|
|
||||||
handleMappedKeys.run();
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
application.invokeLater(handleMappedKeys);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final List<KeyStroke> unhandledKeys = new ArrayList<KeyStroke>(mappingKeys);
|
|
||||||
mappingKeys.clear();
|
|
||||||
for (KeyStroke keyStroke : unhandledKeys) {
|
|
||||||
handleKey(editor, keyStroke, context, false);
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static <T> boolean isPrefix(@NotNull List<T> list1, @NotNull List<T> list2) {
|
private static <T> boolean isPrefix(@NotNull List<T> list1, @NotNull List<T> list2) {
|
||||||
if (list1.size() > list2.size()) {
|
if (list1.size() > list2.size()) {
|
||||||
return false;
|
return false;
|
||||||
@@ -296,12 +282,8 @@ public class KeyHandler {
|
|||||||
RegisterGroup register = VimPlugin.getRegister();
|
RegisterGroup register = VimPlugin.getRegister();
|
||||||
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
||||||
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||||
CommandProcessor.getInstance().executeCommand(editor.getProject(), new Runnable() {
|
CommandProcessor.getInstance().executeCommand(editor.getProject(),
|
||||||
@Override
|
() -> KeyHandler.executeAction("EditorEscape", context), "", null);
|
||||||
public void run() {
|
|
||||||
KeyHandler.executeAction("EditorEscape", context);
|
|
||||||
}
|
|
||||||
}, "", null);
|
|
||||||
}
|
}
|
||||||
VimPlugin.indicateError();
|
VimPlugin.indicateError();
|
||||||
}
|
}
|
||||||
@@ -309,24 +291,115 @@ public class KeyHandler {
|
|||||||
reset(editor);
|
reset(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isDeleteCommandCount(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
private boolean handleKeyMapping(@NotNull final Editor editor,
|
||||||
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
|
@NotNull final KeyStroke key,
|
||||||
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg != Argument.Type.DIGRAPH &&
|
@NotNull final DataContext context) {
|
||||||
key.getKeyCode() == KeyEvent.VK_DELETE && count != 0;
|
final CommandState commandState = CommandState.getInstance(editor);
|
||||||
|
commandState.stopMappingTimer();
|
||||||
|
|
||||||
|
final MappingMode mappingMode = commandState.getMappingMode();
|
||||||
|
if (MappingMode.NVO.contains(mappingMode) && (state != State.NEW_COMMAND || currentArg != Argument.Type.NONE)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
final List<KeyStroke> mappingKeys = commandState.getMappingKeys();
|
||||||
|
final List<KeyStroke> fromKeys = new ArrayList<>(mappingKeys);
|
||||||
|
fromKeys.add(key);
|
||||||
|
|
||||||
|
final KeyMapping mapping = VimPlugin.getKey().getKeyMapping(mappingMode);
|
||||||
|
final MappingInfo currentMappingInfo = mapping.get(fromKeys);
|
||||||
|
final MappingInfo prevMappingInfo = mapping.get(mappingKeys);
|
||||||
|
final MappingInfo mappingInfo = currentMappingInfo != null ? currentMappingInfo : prevMappingInfo;
|
||||||
|
|
||||||
|
final Application application = ApplicationManager.getApplication();
|
||||||
|
|
||||||
|
if (mapping.isPrefix(fromKeys)) {
|
||||||
|
mappingKeys.add(key);
|
||||||
|
if (!application.isUnitTestMode() && OptionsManager.INSTANCE.getTimeout().isSet()) {
|
||||||
|
commandState.startMappingTimer(actionEvent -> application.invokeLater(() -> {
|
||||||
|
mappingKeys.clear();
|
||||||
|
if (editor.isDisposed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (KeyStroke keyStroke : fromKeys) {
|
||||||
|
handleKey(editor, keyStroke, new EditorDataContext(editor), false);
|
||||||
|
}
|
||||||
|
}, ModalityState.stateForComponent(editor.getComponent())));
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else if (mappingInfo != null) {
|
||||||
|
mappingKeys.clear();
|
||||||
|
final Runnable handleMappedKeys = () -> {
|
||||||
|
if (editor.isDisposed()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
final List<KeyStroke> toKeys = mappingInfo.getToKeys();
|
||||||
|
final VimExtensionHandler extensionHandler = mappingInfo.getExtensionHandler();
|
||||||
|
final EditorDataContext currentContext = new EditorDataContext(editor);
|
||||||
|
if (toKeys != null) {
|
||||||
|
final boolean fromIsPrefix = isPrefix(mappingInfo.getFromKeys(), toKeys);
|
||||||
|
boolean first = true;
|
||||||
|
for (KeyStroke keyStroke : toKeys) {
|
||||||
|
final boolean recursive = mappingInfo.isRecursive() && !(first && fromIsPrefix);
|
||||||
|
handleKey(editor, keyStroke, currentContext, recursive);
|
||||||
|
first = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (extensionHandler != null) {
|
||||||
|
final CommandProcessor processor = CommandProcessor.getInstance();
|
||||||
|
processor.executeCommand(editor.getProject(), () -> extensionHandler.execute(editor, context),
|
||||||
|
"Vim " + extensionHandler.getClass().getSimpleName(), null);
|
||||||
|
}
|
||||||
|
|
||||||
|
// NB: mappingInfo MUST be non-null here, so if equal
|
||||||
|
// then prevMappingInfo is also non-null; this also
|
||||||
|
// means that the prev mapping was a prefix, but the
|
||||||
|
// next key typed (`key`) was not part of that
|
||||||
|
if (prevMappingInfo == mappingInfo) {
|
||||||
|
// post to end of queue so it's handled AFTER
|
||||||
|
// an <Plug> mapping is invoked (since that
|
||||||
|
// will also get posted)
|
||||||
|
Runnable handleRemainingKey = () -> handleKey(editor, key, currentContext);
|
||||||
|
|
||||||
|
if (application.isUnitTestMode()) {
|
||||||
|
handleRemainingKey.run();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
application.invokeLater(handleRemainingKey);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
if (application.isUnitTestMode()) {
|
||||||
|
handleMappedKeys.run();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
application.invokeLater(handleMappedKeys);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
final List<KeyStroke> unhandledKeys = new ArrayList<>(mappingKeys);
|
||||||
|
mappingKeys.clear();
|
||||||
|
for (KeyStroke keyStroke : unhandledKeys) {
|
||||||
|
handleKey(editor, keyStroke, context, false);
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isCommandCount(@NotNull CommandState editorState, char chKey) {
|
private boolean isDeleteCommandCount(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
||||||
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
|
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
|
||||||
state == State.NEW_COMMAND && currentArg != Argument.Type.CHARACTER && currentArg != Argument.Type.DIGRAPH &&
|
state == State.NEW_COMMAND &&
|
||||||
Character.isDigit(chKey) &&
|
currentArg != Argument.Type.CHARACTER &&
|
||||||
(count != 0 || chKey != '0');
|
currentArg != Argument.Type.DIGRAPH &&
|
||||||
|
key.getKeyCode() == KeyEvent.VK_DELETE &&
|
||||||
|
count != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEditorReset(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
private boolean isEditorReset(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
||||||
return (editorState.getMode() == CommandState.Mode.COMMAND || state == State.COMMAND) &&
|
return (editorState.getMode() == CommandState.Mode.COMMAND || state == State.COMMAND) &&
|
||||||
(key.getKeyCode() == KeyEvent.VK_ESCAPE ||
|
StringHelper.isCloseKeyStroke(key);
|
||||||
(key.getKeyCode() == KeyEvent.VK_C && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0) ||
|
|
||||||
(key.getKeyCode() == '[' && (key.getModifiers() & KeyEvent.CTRL_MASK) != 0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleCharArgument(@NotNull KeyStroke key, char chKey) {
|
private void handleCharArgument(@NotNull KeyStroke key, char chKey) {
|
||||||
@@ -357,7 +430,18 @@ public class KeyHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleDigraph(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
|
private boolean isCommandCount(@NotNull CommandState editorState, char chKey) {
|
||||||
|
return (editorState.getMode() == CommandState.Mode.COMMAND || editorState.getMode() == CommandState.Mode.VISUAL) &&
|
||||||
|
state == State.NEW_COMMAND &&
|
||||||
|
currentArg != Argument.Type.CHARACTER &&
|
||||||
|
currentArg != Argument.Type.DIGRAPH &&
|
||||||
|
Character.isDigit(chKey) &&
|
||||||
|
(count != 0 || chKey != '0');
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean handleDigraph(@NotNull Editor editor,
|
||||||
|
@NotNull KeyStroke key,
|
||||||
|
@NotNull DataContext context,
|
||||||
@Nullable Node node) {
|
@Nullable Node node) {
|
||||||
if (digraph == null && !(node instanceof CommandNode) && DigraphSequence.isDigraphStart(key)) {
|
if (digraph == null && !(node instanceof CommandNode) && DigraphSequence.isDigraphStart(key)) {
|
||||||
digraph = new DigraphSequence();
|
digraph = new DigraphSequence();
|
||||||
@@ -386,7 +470,9 @@ public class KeyHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void executeCommand(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
|
private void executeCommand(@NotNull Editor editor,
|
||||||
|
@NotNull KeyStroke key,
|
||||||
|
@NotNull DataContext context,
|
||||||
@NotNull CommandState editorState) {
|
@NotNull CommandState editorState) {
|
||||||
// Let's go through the command stack and merge it all into one command. At this time there should never
|
// Let's go through the command stack and merge it all into one command. At this time there should never
|
||||||
// be more than two commands on the stack - one is the actual command and the other would be a motion
|
// be more than two commands on the stack - one is the actual command and the other would be a motion
|
||||||
@@ -421,30 +507,94 @@ public class KeyHandler {
|
|||||||
// Save off the command we are about to execute
|
// Save off the command we are about to execute
|
||||||
editorState.setCommand(cmd);
|
editorState.setCommand(cmd);
|
||||||
|
|
||||||
lastWasBS = ((cmd.getFlags() & Command.FLAG_IS_BACKSPACE) != 0);
|
if (lastChar != 0 && !lastWasBS) {
|
||||||
|
lastWasBS = key.equals(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0));
|
||||||
Project project = editor.getProject();
|
|
||||||
if (cmd.getType().isRead() || project == null || EditorHelper.canEdit(project, editor)) {
|
|
||||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
|
||||||
Runnable action = new ActionRunner(editor, context, cmd, key);
|
|
||||||
String name = cmd.getAction().getTemplatePresentation().getText();
|
|
||||||
name = name != null ? "Vim " + name : "";
|
|
||||||
if (cmd.getType().isWrite()) {
|
|
||||||
RunnableHelper.runWriteCommand(project, action, name, action);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
RunnableHelper.runReadCommand(project, action, name, action);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
lastChar = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
Project project = editor.getProject();
|
||||||
|
final Command.Type type = cmd.getType();
|
||||||
|
if (type.isWrite() && !editor.getDocument().isWritable()) {
|
||||||
VimPlugin.indicateError();
|
VimPlugin.indicateError();
|
||||||
reset(editor);
|
reset(editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!cmd.getFlags().contains(CommandFlags.FLAG_TYPEAHEAD_SELF_MANAGE)) {
|
||||||
|
IdeEventQueue.getInstance().flushDelayedKeyEvents();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||||
|
Runnable action = new ActionRunner(editor, context, cmd, key);
|
||||||
|
String name = cmd.getAction().getTemplatePresentation().getText();
|
||||||
|
name = name != null ? "Vim " + name : "";
|
||||||
|
if (type.isWrite()) {
|
||||||
|
RunnableHelper.runWriteCommand(project, action, name, action);
|
||||||
|
}
|
||||||
|
else if (type.isRead()) {
|
||||||
|
RunnableHelper.runReadCommand(project, action, name, action);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
CommandProcessor.getInstance().executeCommand(project, action, name, action);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean handleArgumentNode(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull DataContext context,
|
private void handleCommandNode(@NotNull Editor editor, @NotNull CommandNode node) {
|
||||||
@NotNull CommandState editorState, @NotNull ArgumentNode node) {
|
// If all does well we are ready to process this command
|
||||||
|
state = State.READY;
|
||||||
|
// Did we just get the completed sequence for a motion command argument?
|
||||||
|
if (currentArg == Argument.Type.MOTION) {
|
||||||
|
// We have been expecting a motion argument - is this one?
|
||||||
|
if (node.getCmdType() == Command.Type.MOTION) {
|
||||||
|
if (!(node.getAction() instanceof MotionEditorAction) && !(node.getAction() instanceof TextObjectAction)) {
|
||||||
|
throw new RuntimeException("MOTION cmd type can be used only with MotionEditorAction or TextObjectAction - " +
|
||||||
|
node.getAction().getClass().getName());
|
||||||
|
}
|
||||||
|
// Create the motion command and add it to the stack
|
||||||
|
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
|
cmd.setKeys(keys);
|
||||||
|
currentCmd.push(cmd);
|
||||||
|
}
|
||||||
|
else if (node.getCmdType() == Command.Type.RESET) {
|
||||||
|
currentCmd.clear();
|
||||||
|
Command cmd = new Command(1, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
|
cmd.setKeys(keys);
|
||||||
|
currentCmd.push(cmd);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Oops - this wasn't a motion command. The user goofed and typed something else
|
||||||
|
state = State.BAD_COMMAND;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (currentArg == Argument.Type.EX_STRING && node.getFlags().contains(CommandFlags.FLAG_COMPLETE_EX)) {
|
||||||
|
String text = VimPlugin.getProcess().endSearchCommand(editor);
|
||||||
|
Argument arg = new Argument(text);
|
||||||
|
Command cmd = currentCmd.peek();
|
||||||
|
cmd.setArgument(arg);
|
||||||
|
CommandState.getInstance(editor).popState();
|
||||||
|
}
|
||||||
|
// The user entered a valid command that doesn't take any arguments
|
||||||
|
else {
|
||||||
|
// Create the command and add it to the stack
|
||||||
|
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
|
cmd.setKeys(keys);
|
||||||
|
currentCmd.push(cmd);
|
||||||
|
|
||||||
|
// This is a sanity check that the command has a valid action. This should only fail if the
|
||||||
|
// programmer made a typo or forgot to add the action to the plugin.xml file
|
||||||
|
if (cmd.getAction() == null) {
|
||||||
|
state = State.ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean handleArgumentNode(@NotNull Editor editor,
|
||||||
|
@NotNull KeyStroke key,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull CommandState editorState,
|
||||||
|
@NotNull ArgumentNode node) {
|
||||||
// Create a new command based on what the user has typed so far, excluding this keystroke.
|
// Create a new command based on what the user has typed so far, excluding this keystroke.
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
||||||
cmd.setKeys(keys);
|
cmd.setKeys(keys);
|
||||||
@@ -461,7 +611,7 @@ public class KeyHandler {
|
|||||||
currentArg = node.getArgType();
|
currentArg = node.getArgType();
|
||||||
// Is the current command an operator? If so set the state to only accept "operator pending"
|
// Is the current command an operator? If so set the state to only accept "operator pending"
|
||||||
// commands
|
// commands
|
||||||
if ((node.getFlags() & Command.FLAG_OP_PEND) != 0) {
|
if (node.getFlags().contains(CommandFlags.FLAG_OP_PEND)) {
|
||||||
editorState.pushState(editorState.getMode(), editorState.getSubMode(), MappingMode.OP_PENDING);
|
editorState.pushState(editorState.getMode(), editorState.getSubMode(), MappingMode.OP_PENDING);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -483,55 +633,25 @@ public class KeyHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleCommandNode(@NotNull Editor editor, @NotNull DataContext context, @NotNull CommandNode node) {
|
/**
|
||||||
// If all does well we are ready to process this command
|
* Execute an action by name
|
||||||
state = State.READY;
|
*
|
||||||
// Did we just get the completed sequence for a motion command argument?
|
* @param name The name of the action to execute
|
||||||
if (currentArg == Argument.Type.MOTION) {
|
* @param context The context to run it in
|
||||||
// We have been expecting a motion argument - is this one?
|
*/
|
||||||
if (node.getCmdType() == Command.Type.MOTION) {
|
public static boolean executeAction(@NotNull String name, @NotNull DataContext context) {
|
||||||
// Create the motion command and add it to the stack
|
ActionManager aMgr = ActionManager.getInstance();
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
AnAction action = aMgr.getAction(name);
|
||||||
cmd.setKeys(keys);
|
return action != null && executeAction(action, context);
|
||||||
currentCmd.push(cmd);
|
|
||||||
}
|
|
||||||
else if (node.getCmdType() == Command.Type.RESET) {
|
|
||||||
currentCmd.clear();
|
|
||||||
Command cmd = new Command(1, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
|
||||||
cmd.setKeys(keys);
|
|
||||||
currentCmd.push(cmd);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
// Oops - this wasn't a motion command. The user goofed and typed something else
|
|
||||||
state = State.BAD_COMMAND;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (currentArg == Argument.Type.EX_STRING && (node.getFlags() & Command.FLAG_COMPLETE_EX) != 0) {
|
|
||||||
String text = VimPlugin.getProcess().endSearchCommand(editor, context);
|
|
||||||
Argument arg = new Argument(text);
|
|
||||||
Command cmd = currentCmd.peek();
|
|
||||||
cmd.setArgument(arg);
|
|
||||||
CommandState.getInstance(editor).popState();
|
|
||||||
}
|
|
||||||
// The user entered a valid command that doesn't take any arguments
|
|
||||||
else {
|
|
||||||
// Create the command and add it to the stack
|
|
||||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
|
||||||
cmd.setKeys(keys);
|
|
||||||
currentCmd.push(cmd);
|
|
||||||
|
|
||||||
// This is a sanity check that the command has a valid action. This should only fail if the
|
|
||||||
// programmer made a typo or forgot to add the action to the plugin.xml file
|
|
||||||
if (cmd.getAction() == null) {
|
|
||||||
state = State.ERROR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void handleBranchNode(@NotNull Editor editor, @NotNull DataContext context, @NotNull CommandState editorState,
|
private void handleBranchNode(@NotNull Editor editor,
|
||||||
char key, @NotNull BranchNode node) {
|
@NotNull DataContext context,
|
||||||
|
@NotNull CommandState editorState,
|
||||||
|
char key,
|
||||||
|
@NotNull BranchNode node) {
|
||||||
// Flag that we aren't allowing any more count digits (unless it's OK)
|
// Flag that we aren't allowing any more count digits (unless it's OK)
|
||||||
if ((node.getFlags() & Command.FLAG_ALLOW_MID_COUNT) == 0) {
|
if (!node.getFlags().contains(CommandFlags.FLAG_ALLOW_MID_COUNT)) {
|
||||||
state = State.COMMAND;
|
state = State.COMMAND;
|
||||||
}
|
}
|
||||||
editorState.setCurrentNode(node);
|
editorState.setCurrentNode(node);
|
||||||
@@ -543,7 +663,7 @@ public class KeyHandler {
|
|||||||
state = State.BAD_COMMAND;
|
state = State.BAD_COMMAND;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (editorState.isRecording() && (arg.getFlags() & Command.FLAG_NO_ARG_RECORDING) != 0) {
|
if (editorState.isRecording() && arg.getFlags().contains(CommandFlags.FLAG_NO_ARG_RECORDING)) {
|
||||||
handleKey(editor, KeyStroke.getKeyStroke(' '), context);
|
handleKey(editor, KeyStroke.getKeyStroke(' '), context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,40 +676,6 @@ public class KeyHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute an action by name
|
|
||||||
*
|
|
||||||
* @param name The name of the action to execute
|
|
||||||
* @param context The context to run it in
|
|
||||||
*/
|
|
||||||
public static boolean executeAction(@NotNull String name, @NotNull DataContext context) {
|
|
||||||
ActionManager aMgr = ActionManager.getInstance();
|
|
||||||
AnAction action = aMgr.getAction(name);
|
|
||||||
return action != null && executeAction(action, context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Execute an action
|
|
||||||
*
|
|
||||||
* @param action The action to execute
|
|
||||||
* @param context The context to run it in
|
|
||||||
*/
|
|
||||||
public static boolean executeAction(@NotNull AnAction action, @NotNull DataContext context) {
|
|
||||||
// Hopefully all the arguments are sufficient. So far they all seem to work OK.
|
|
||||||
// We don't have a specific InputEvent so that is null
|
|
||||||
// What is "place"? Leave it the empty string for now.
|
|
||||||
// Is the template presentation sufficient?
|
|
||||||
// What are the modifiers? Is zero OK?
|
|
||||||
final AnActionEvent event = new AnActionEvent(null, context, "", action.getTemplatePresentation(),
|
|
||||||
ActionManager.getInstance(), 0);
|
|
||||||
action.update(event);
|
|
||||||
if (event.getPresentation().isEnabled()) {
|
|
||||||
action.actionPerformed(event);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Partially resets the state of this handler. Resets the command count, clears the key list, resets the key tree
|
* Partially resets the state of this handler. Resets the command count, clears the key list, resets the key tree
|
||||||
* node to the root for the current mode we are in.
|
* node to the root for the current mode we are in.
|
||||||
@@ -598,7 +684,7 @@ public class KeyHandler {
|
|||||||
*/
|
*/
|
||||||
private void partialReset(@Nullable Editor editor) {
|
private void partialReset(@Nullable Editor editor) {
|
||||||
count = 0;
|
count = 0;
|
||||||
keys = new ArrayList<KeyStroke>();
|
keys = new ArrayList<>();
|
||||||
CommandState editorState = CommandState.getInstance(editor);
|
CommandState editorState = CommandState.getInstance(editor);
|
||||||
editorState.stopMappingTimer();
|
editorState.stopMappingTimer();
|
||||||
editorState.getMappingKeys().clear();
|
editorState.getMappingKeys().clear();
|
||||||
@@ -644,6 +730,7 @@ public class KeyHandler {
|
|||||||
this.key = key;
|
this.key = key;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
CommandState editorState = CommandState.getInstance(editor);
|
CommandState editorState = CommandState.getInstance(editor);
|
||||||
boolean wasRecording = editorState.isRecording();
|
boolean wasRecording = editorState.isRecording();
|
||||||
@@ -666,7 +753,7 @@ public class KeyHandler {
|
|||||||
// mode commands. An exception is if this command should leave us in the temporary mode such as
|
// mode commands. An exception is if this command should leave us in the temporary mode such as
|
||||||
// "select register"
|
// "select register"
|
||||||
if (editorState.getSubMode() == CommandState.SubMode.SINGLE_COMMAND &&
|
if (editorState.getSubMode() == CommandState.SubMode.SINGLE_COMMAND &&
|
||||||
(cmd.getFlags() & Command.FLAG_EXPECT_MORE) == 0) {
|
(!cmd.getFlags().contains(CommandFlags.FLAG_EXPECT_MORE))) {
|
||||||
editorState.popState();
|
editorState.popState();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -683,18 +770,14 @@ public class KeyHandler {
|
|||||||
private final KeyStroke key;
|
private final KeyStroke key;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static enum State {
|
private enum State {
|
||||||
NEW_COMMAND,
|
NEW_COMMAND, COMMAND, READY, ERROR, BAD_COMMAND
|
||||||
COMMAND,
|
|
||||||
READY,
|
|
||||||
ERROR,
|
|
||||||
BAD_COMMAND
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private int count;
|
private int count;
|
||||||
private List<KeyStroke> keys;
|
private List<KeyStroke> keys;
|
||||||
private State state;
|
private State state;
|
||||||
@NotNull private final Stack<Command> currentCmd = new Stack<Command>();
|
@NotNull private final Stack<Command> currentCmd = new Stack<>();
|
||||||
@NotNull private Argument.Type currentArg;
|
@NotNull private Argument.Type currentArg;
|
||||||
private TypedActionHandler origHandler;
|
private TypedActionHandler origHandler;
|
||||||
@Nullable private DigraphSequence digraph = null;
|
@Nullable private DigraphSequence digraph = null;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,746 +19,68 @@ package com.maddyhome.idea.vim;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.AnAction;
|
import com.intellij.openapi.actionSystem.AnAction;
|
||||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandActionBase;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.group.KeyGroup;
|
import com.maddyhome.idea.vim.group.KeyGroup;
|
||||||
import com.maddyhome.idea.vim.key.Shortcut;
|
import com.maddyhome.idea.vim.key.Shortcut;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
|
||||||
public class RegisterActions {
|
class RegisterActions {
|
||||||
/**
|
/**
|
||||||
* Register all the key/action mappings for the plugin.
|
* Register all the key/action mappings for the plugin.
|
||||||
*/
|
*/
|
||||||
public static void registerActions() {
|
static void registerActions() {
|
||||||
registerVimCommandActions();
|
registerVimCommandActions();
|
||||||
|
registerSystemMappings();
|
||||||
registerInsertModeActions();
|
|
||||||
registerNormalModeActions();
|
|
||||||
registerNVOModesActions();
|
|
||||||
registerCommandLineActions();
|
|
||||||
registerVariousModesActions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerVimCommandActions() {
|
private static void registerVimCommandActions() {
|
||||||
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
||||||
for (String actionId : manager.getPluginActions(VimPlugin.getPluginId())) {
|
for (String actionId : manager.getPluginActions(VimPlugin.getPluginId())) {
|
||||||
final AnAction action = manager.getAction(actionId);
|
final AnAction action = manager.getAction(actionId);
|
||||||
if (action instanceof VimCommandAction) {
|
if (action instanceof VimCommandActionBase) {
|
||||||
VimPlugin.getKey().registerCommandAction((VimCommandAction)action, actionId);
|
VimPlugin.getKey().registerCommandAction((VimCommandActionBase)action, actionId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void registerVariousModesActions() {
|
private static void registerSystemMappings() {
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
final KeyGroup parser = VimPlugin.getKey();
|
||||||
parser.registerAction(MappingMode.NV, "VimVisualToggleLineMode", Command.Type.OTHER_READONLY, Command.FLAG_MOT_LINEWISE,
|
|
||||||
new Shortcut('V'));
|
|
||||||
parser.registerAction(MappingMode.NV, "VimVisualToggleBlockMode", Command.Type.OTHER_READONLY,
|
|
||||||
Command.FLAG_MOT_BLOCKWISE,
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK))}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.NV, "VimMotionMark", Command.Type.OTHER_READONLY, new Shortcut('m'),
|
|
||||||
Argument.Type.CHARACTER);
|
|
||||||
parser.registerAction(MappingMode.NV, "VimGotoDeclaration", Command.Type.OTHER_READONLY, Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut[]{new Shortcut("gD"), new Shortcut("gd"),
|
|
||||||
// TODO: <C-]> is a tag command similar to gD, the tag stack is not implemented
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_CLOSE_BRACKET, KeyEvent.CTRL_MASK)),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.NV, "VimFileGetLocationInfo", Command.Type.OTHER_READONLY, new Shortcut(
|
|
||||||
new KeyStroke[]{KeyStroke.getKeyStroke('g'),
|
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_G, KeyEvent.CTRL_MASK)})
|
|
||||||
);
|
|
||||||
// TODO - add zC
|
|
||||||
// TODO - add zO
|
|
||||||
parser.registerAction(MappingMode.NV, "CollapseAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zM"));
|
parser.registerAction(MappingMode.NV, "CollapseAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zM"));
|
||||||
parser.registerAction(MappingMode.NV, "CollapseRegion", Command.Type.OTHER_READONLY, new Shortcut("zc"));
|
parser.registerAction(MappingMode.NV, "CollapseRegion", Command.Type.OTHER_READONLY, new Shortcut("zc"));
|
||||||
|
parser.registerAction(MappingMode.NV, "CollapseRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zC"));
|
||||||
parser.registerAction(MappingMode.NV, "ExpandAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zR"));
|
parser.registerAction(MappingMode.NV, "ExpandAllRegions", Command.Type.OTHER_READONLY, new Shortcut("zR"));
|
||||||
parser.registerAction(MappingMode.NV, "ExpandRegion", Command.Type.OTHER_READONLY, new Shortcut("zo"));
|
parser.registerAction(MappingMode.NV, "ExpandRegion", Command.Type.OTHER_READONLY, new Shortcut("zo"));
|
||||||
parser.registerAction(MappingMode.NV, "VimToggleRecording",
|
parser.registerAction(MappingMode.NV, "ExpandRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zO"));
|
||||||
Command.Type.OTHER_READONLY,
|
|
||||||
Command.FLAG_NO_ARG_RECORDING,
|
|
||||||
new Shortcut('q'), Argument.Type.CHARACTER);
|
|
||||||
|
|
||||||
// Text Object Actions for Visual and Operator Pending Modes
|
parser.registerAction(MappingMode.I, "EditorBackSpace", Command.Type.INSERT, EnumSet.noneOf(CommandFlags.class),
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionGotoFileMark", Command.Type.MOTION,
|
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK)),
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP, new Shortcut('`'),
|
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0))});
|
||||||
Argument.Type.CHARACTER);
|
parser.registerAction(MappingMode.I, "EditorDelete", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_SAVE_STROKE),
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionGotoFileMarkLine", Command.Type.MOTION,
|
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0))});
|
||||||
Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP, new Shortcut('\''),
|
parser.registerAction(MappingMode.I, "EditorDown", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES),
|
||||||
Argument.Type.CHARACTER);
|
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionGotoFileMark", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0))});
|
||||||
new Shortcut("g`"), Argument.Type.CHARACTER);
|
parser.registerAction(MappingMode.I, "EditorTab", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_SAVE_STROKE),
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionGotoFileMarkLine", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE,
|
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_MASK)),
|
||||||
new Shortcut("g'"), Argument.Type.CHARACTER);
|
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0))});
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionTextOuterWord", Command.Type.MOTION,
|
parser.registerAction(MappingMode.I, "EditorUp", Command.Type.INSERT, EnumSet.of(CommandFlags.FLAG_CLEAR_STROKES),
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE, new Shortcut("aw"));
|
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionTextOuterBigWord", Command.Type.MOTION,
|
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0))});
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE, new Shortcut("aW"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionTextInnerWord", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE, new Shortcut("iw"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionTextInnerBigWord", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE, new Shortcut("iW"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerParagraph", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_LINEWISE | Command.FLAG_TEXT_BLOCK, new Shortcut("ip"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterParagraph", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_LINEWISE | Command.FLAG_TEXT_BLOCK, new Shortcut("ap"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerSentence",
|
|
||||||
Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut("is"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterSentence", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut("as"));
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockAngle", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("i<"), new Shortcut("i>")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockBrace", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("iB"), new Shortcut("i{"), new Shortcut("i}")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockBracket", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("i["), new Shortcut("i]")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockParen", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("ib"), new Shortcut("i("), new Shortcut("i)")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockDoubleQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("i\""),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockSingleQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("i'"),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionInnerBlockBackQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("i`"),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockAngle",
|
|
||||||
Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut[]{
|
|
||||||
new Shortcut("a<"),
|
|
||||||
new Shortcut("a>")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockBrace", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("aB"), new Shortcut("a{"), new Shortcut("a}")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockBracket", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("a["), new Shortcut("a]")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockParen", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("ab"), new Shortcut("a("), new Shortcut("a)")}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockDoubleQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("a\""),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockSingleQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK,
|
|
||||||
new Shortcut[]{new Shortcut("a'"),}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.VO, "VimMotionOuterBlockBackQuote", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_CHARACTERWISE | Command.FLAG_MOT_INCLUSIVE | Command.FLAG_TEXT_BLOCK, new Shortcut[]{
|
|
||||||
new Shortcut("a`"),
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NO, "VimResetMode", Command.Type.RESET, new Shortcut(new KeyStroke[]{
|
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SLASH, KeyEvent.CTRL_MASK),
|
|
||||||
KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK)
|
|
||||||
}));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void registerCommandLineActions() {
|
parser.registerAction(MappingMode.N, "QuickJavaDoc", Command.Type.OTHER_READONLY, new Shortcut('K'));
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.C, "VimProcessExEntry", Command.Type.OTHER_READ_WRITE, Command.FLAG_COMPLETE_EX,
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke((char)0x0a)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke((char)0x0d))});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
// Digraph shortcuts are handled directly by KeyHandler#handleKey, so they don't have an action. But we still need to
|
||||||
* Register normal, visual, operator pending modes actions.
|
// register the shortcuts or the editor will swallow them. Technically, the shortcuts will be registered as part of
|
||||||
*/
|
// other commands, but it's best to be explicit
|
||||||
private static void registerNVOModesActions() {
|
parser.registerShortcutWithoutAction(new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_K, KeyEvent.CTRL_MASK)));
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
parser.registerShortcutWithoutAction(new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_MASK)));
|
||||||
parser.registerAction(MappingMode.NVO, "VimCopySelectRegister", Command.Type.SELECT_REGISTER, Command.FLAG_EXPECT_MORE,
|
parser.registerShortcutWithoutAction(new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.CTRL_MASK)));
|
||||||
new Shortcut('"'), Argument.Type.CHARACTER);
|
parser.registerShortcutWithoutAction(new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)));
|
||||||
|
|
||||||
// Motion Actions
|
|
||||||
// TODO - add ['
|
|
||||||
// TODO - add [`
|
|
||||||
// TODO - add ]'
|
|
||||||
// TODO - add ]`
|
|
||||||
// TODO - add zj
|
|
||||||
// TODO - add zk
|
|
||||||
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionNextTab", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("gt"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionPreviousTab", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("gT"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionCamelEndLeft", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("]b"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionCamelEndRight", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("]w"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionCamelLeft", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
|
||||||
new Shortcut("[b"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionCamelRight", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
|
||||||
new Shortcut("[w"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionColumn", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
|
||||||
new Shortcut('|'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionDown", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE, new Shortcut[]{
|
|
||||||
new Shortcut('j'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK)),
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionDown", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut("gj"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('g'), KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionDownFirstNonSpace", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE, new Shortcut[]{
|
|
||||||
new Shortcut('+'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionDownLess1FirstNonSpace", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE,
|
|
||||||
new Shortcut('_'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionFirstColumn", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('0'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionFirstScreenColumn", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut("g0"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('g'), KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionFirstNonSpace", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('^')
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionFirstScreenNonSpace", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut("g^")
|
|
||||||
});
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionFirstScreenLine", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut[]{
|
|
||||||
new Shortcut('H')
|
|
||||||
});
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionGotoLineFirst", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut[]{
|
|
||||||
new Shortcut("gg"),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionGotoLineLast", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('G'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionGotoLineLastEnd", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLastColumn", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('$'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLastScreenColumn", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut("g$"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('g'), KeyStroke.getKeyStroke(KeyEvent.VK_END, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLastMatchChar", Command.Type.MOTION,
|
|
||||||
new Shortcut(';'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLastMatchCharReverse", Command.Type.MOTION,
|
|
||||||
new Shortcut(','));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLastNonSpace", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("g_"));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionLastScreenLine", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('L'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLeft", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('h'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLeftMatchChar", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_ALLOW_DIGRAPH,
|
|
||||||
new Shortcut('F'), Argument.Type.DIGRAPH);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLeftTillMatchChar", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_ALLOW_DIGRAPH,
|
|
||||||
new Shortcut('T'), Argument.Type.DIGRAPH);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionLeftWrap", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMiddleColumn", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("gm"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMiddleScreenLine", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('M'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionNthCharacter", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("go"));
|
|
||||||
// This represents two commands and one is linewise and the other is inclusive - the handler will fix it
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionPercentOrMatch", Command.Type.MOTION, Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('%'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionRight", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('l'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionRightMatchChar", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_INCLUSIVE | Command.FLAG_ALLOW_DIGRAPH,
|
|
||||||
new Shortcut('f'), Argument.Type.DIGRAPH);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionRightTillMatchChar", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_INCLUSIVE | Command.FLAG_ALLOW_DIGRAPH,
|
|
||||||
new Shortcut('t'), Argument.Type.DIGRAPH);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionRightWrap", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
|
||||||
new Shortcut(' '));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollFirstScreenLine", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("zt")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollFirstScreenColumn", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("zs")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollFirstScreenLineStart", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('z'), KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollFirstScreenLinePageStart", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("z+")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollHalfPageDown", Command.Type.OTHER_READONLY, Command.FLAG_IGNORE_SCROLL_JUMP,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollHalfPageUp", Command.Type.OTHER_READONLY, Command.FLAG_IGNORE_SCROLL_JUMP,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLastScreenLine", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("zb")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLastScreenColumn", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("ze")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLastScreenLineStart", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("z-")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLastScreenLinePageStart", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("z^")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLineDown", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollLineUp", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollMiddleScreenLine", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("zz")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollMiddleScreenLineStart", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut("z.")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollColumnLeft", Command.Type.OTHER_READONLY, Command.FLAG_IGNORE_SIDE_SCROLL_JUMP,
|
|
||||||
new Shortcut[]{
|
|
||||||
new Shortcut("zl"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('z'), KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollColumnRight", Command.Type.OTHER_READONLY, Command.FLAG_IGNORE_SIDE_SCROLL_JUMP,
|
|
||||||
new Shortcut[]{
|
|
||||||
new Shortcut("zh"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('z'), KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollPageDown", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionScrollPageUp", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_B, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUp", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE, new Shortcut[]{
|
|
||||||
new Shortcut('k'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_P, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUp", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut("gk"),
|
|
||||||
new Shortcut(new KeyStroke[]{KeyStroke.getKeyStroke('g'), KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)})
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUpFirstNonSpace", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE,
|
|
||||||
new Shortcut('-'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionWordEndLeft", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("ge"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionWordEndRight", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut('e'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionWordLeft", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('b'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionWordRight", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('w'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionBigWordEndLeft", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut("gE"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionBigWordEndRight", Command.Type.MOTION, Command.FLAG_MOT_INCLUSIVE,
|
|
||||||
new Shortcut('E'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionBigWordLeft", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('B'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionBigWordRight", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE, new Shortcut[]{
|
|
||||||
new Shortcut('W'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSentenceStartPrevious", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('('));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSentenceStartNext", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut(')'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSentenceEndPrevious", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("g("));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSentenceEndNext", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("g)"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionParagraphPrevious", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('{'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimMotionParagraphNext", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('}'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUnmatchedBraceOpen", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[{"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUnmatchedBraceClose", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("]}"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUnmatchedParenOpen", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[("));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionUnmatchedParenClose", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("])"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSectionBackwardEnd", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[]"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSectionBackwardStart", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[["));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSectionForwardEnd", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("]]"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionSectionForwardStart", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("]["));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMethodBackwardEnd", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[M"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMethodBackwardStart", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("[m"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMethodForwardEnd", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("]M"));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimMotionMethodForwardStart", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("]m"));
|
|
||||||
|
|
||||||
// Misc Actions
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimSearchFwdEntry", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SEARCH_FWD | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('/'), Argument.Type.EX_STRING);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimSearchRevEntry", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SEARCH_REV | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('?'), Argument.Type.EX_STRING);
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimSearchAgainNext", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('n'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimSearchAgainPrevious", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('N'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimExEntry", Command.Type.OTHER_READ_WRITE,
|
|
||||||
new Shortcut(':'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimSearchWholeWordForward", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('*'));
|
|
||||||
parser.registerAction(MappingMode.NVO, "VimSearchWholeWordBackward", Command.Type.MOTION,
|
|
||||||
Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('#'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimSearchWordForward", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("g*"));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.NVO, "VimSearchWordBackward", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut("g#"));
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void registerNormalModeActions() {
|
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
|
||||||
// Copy/Paste Actions
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextBeforeCursor", Command.Type.PASTE,
|
|
||||||
new Shortcut('P'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextAfterCursor", Command.Type.PASTE,
|
|
||||||
new Shortcut('p'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextBeforeCursorMoveCursor", Command.Type.PASTE,
|
|
||||||
new Shortcut("gP"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextAfterCursorMoveCursor", Command.Type.PASTE,
|
|
||||||
new Shortcut("gp"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextBeforeCursorNoIndent", Command.Type.PASTE, new Shortcut[]{
|
|
||||||
new Shortcut("[P"),
|
|
||||||
new Shortcut("]P")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyPutTextAfterCursorNoIndent", Command.Type.PASTE, new Shortcut[]{
|
|
||||||
new Shortcut("[p"),
|
|
||||||
new Shortcut("]p")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyYankLine", Command.Type.COPY,
|
|
||||||
new Shortcut('Y'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyYankLine", Command.Type.COPY, Command.FLAG_ALLOW_MID_COUNT,
|
|
||||||
new Shortcut("yy"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimCopyYankMotion", Command.Type.COPY, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut('y'), Argument.Type.MOTION);
|
|
||||||
|
|
||||||
// Insert/Replace/Change Actions
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeCaseLowerMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut("gu"), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeCaseToggleCharacter", Command.Type.CHANGE,
|
|
||||||
new Shortcut('~'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeCaseToggleMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut("g~"), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeCaseUpperMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut("gU"), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeCharacter", Command.Type.CHANGE, Command.FLAG_ALLOW_DIGRAPH,
|
|
||||||
new Shortcut('r'), Argument.Type.DIGRAPH);
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.N, "VimChangeCharacters", Command.Type.CHANGE, Command.FLAG_NO_REPEAT | Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('s'));
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.N, "VimChangeEndOfLine", Command.Type.CHANGE, Command.FLAG_NO_REPEAT | Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('C'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeLine", Command.Type.CHANGE,
|
|
||||||
Command.FLAG_NO_REPEAT | Command.FLAG_ALLOW_MID_COUNT | Command.FLAG_MULTIKEY_UNDO, new Shortcut[]{
|
|
||||||
new Shortcut("cc"),
|
|
||||||
new Shortcut('S')
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeNumberInc", Command.Type.CHANGE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeNumberDec", Command.Type.CHANGE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND | Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('c'), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimChangeReplace", Command.Type.CHANGE, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('R'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteCharacter", Command.Type.DELETE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteCharacterLeft", Command.Type.DELETE,
|
|
||||||
new Shortcut('X'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteCharacterRight", Command.Type.DELETE,
|
|
||||||
new Shortcut('x'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteEndOfLine", Command.Type.DELETE,
|
|
||||||
new Shortcut('D'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteJoinLines", Command.Type.DELETE,
|
|
||||||
new Shortcut("gJ"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteJoinLinesSpaces", Command.Type.DELETE,
|
|
||||||
new Shortcut('J'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteLine", Command.Type.DELETE, Command.FLAG_ALLOW_MID_COUNT,
|
|
||||||
new Shortcut("dd"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimDeleteMotion", Command.Type.DELETE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut('d'), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimFilterCountLines", Command.Type.CHANGE,
|
|
||||||
new Shortcut("!!"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimFilterMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut('!'), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertAfterCursor", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('a'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertAfterLineEnd", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('A'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertAtPreviousInsert", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut("gi"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertBeforeFirstNonBlank", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('I'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertLineStart", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut("gI"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertNewLineAbove", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('O'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimInsertNewLineBelow", Command.Type.INSERT, Command.FLAG_MULTIKEY_UNDO,
|
|
||||||
new Shortcut('o'));
|
|
||||||
// Motion Actions
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.N, "VimMotionGotoMark", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('`'), Argument.Type.CHARACTER);
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.N, "VimMotionGotoMarkLine", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE | Command.FLAG_SAVE_JUMP,
|
|
||||||
new Shortcut('\''), Argument.Type.CHARACTER);
|
|
||||||
parser.registerAction(MappingMode.N, "VimMotionGotoMark", Command.Type.MOTION, Command.FLAG_MOT_EXCLUSIVE,
|
|
||||||
new Shortcut("g`"), Argument.Type.CHARACTER);
|
|
||||||
parser.registerAction(MappingMode.N, "VimMotionGotoMarkLine", Command.Type.MOTION, Command.FLAG_MOT_LINEWISE,
|
|
||||||
new Shortcut("g'"), Argument.Type.CHARACTER);
|
|
||||||
// Misc Actions
|
|
||||||
parser.registerAction(MappingMode.N, "VimLastSearchReplace", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut('&'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimLastGlobalSearchReplace", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut("g&"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimRepeatChange", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut('.'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimRepeatExCommand", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut("@:"));
|
|
||||||
parser.registerAction(MappingMode.N, "QuickJavaDoc", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut('K'));
|
|
||||||
parser.registerAction(MappingMode.N, "VimRedo", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.N, "VimUndo", Command.Type.OTHER_WRITABLE, new Shortcut[]{
|
|
||||||
new Shortcut('u'),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UNDO, 0))
|
|
||||||
});
|
|
||||||
|
|
||||||
// File Actions
|
|
||||||
parser.registerAction(MappingMode.N, "VimFileSaveClose", Command.Type.OTHER_WRITABLE, new Shortcut[]{
|
|
||||||
new Shortcut("ZQ"),
|
|
||||||
new Shortcut("ZZ")
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.N, "VimFilePrevious", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_6, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_CIRCUMFLEX, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
|
|
||||||
// Shift Actions
|
|
||||||
// TODO - add =
|
|
||||||
// TODO - == will ignore count and only auto-indent 1 lines
|
|
||||||
parser.registerAction(MappingMode.N, "VimAutoIndentLines", Command.Type.CHANGE,
|
|
||||||
new Shortcut("=="));
|
|
||||||
parser.registerAction(MappingMode.N, "VimShiftLeftLines", Command.Type.CHANGE,
|
|
||||||
new Shortcut("<<"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimShiftLeftMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut('<'), Argument.Type.MOTION);
|
|
||||||
parser.registerAction(MappingMode.N, "VimShiftRightLines", Command.Type.CHANGE,
|
|
||||||
new Shortcut(">>"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimShiftRightMotion", Command.Type.CHANGE, Command.FLAG_OP_PEND,
|
|
||||||
new Shortcut('>'), Argument.Type.MOTION);
|
|
||||||
|
|
||||||
// Jump Actions
|
|
||||||
|
|
||||||
parser.registerAction(MappingMode.N, "VimMotionJumpNext", Command.Type.OTHER_READONLY, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.N, "VimMotionJumpPrevious", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut[] {
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK)),
|
|
||||||
// TODO: <C-T> is a tag command similar to <C-O>, the tag stack is not implemented
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
|
|
||||||
parser.registerAction(MappingMode.N, "VimFileGetAscii", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut("ga"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimFileGetHex", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut("g8"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimFileGetFileInfo", Command.Type.OTHER_READONLY,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_G, KeyEvent.CTRL_MASK)));
|
|
||||||
|
|
||||||
// Macro Actions
|
|
||||||
parser.registerAction(MappingMode.N, "VimPlaybackLastRegister", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut("@@"));
|
|
||||||
parser.registerAction(MappingMode.N, "VimPlaybackRegister", Command.Type.OTHER_WRITABLE,
|
|
||||||
new Shortcut('@'), Argument.Type.CHARACTER);
|
|
||||||
// TODO - support for :map macros
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void registerInsertModeActions() {
|
|
||||||
final KeyGroup parser = VimPlugin.getKey();
|
|
||||||
// Other insert actions
|
|
||||||
parser
|
|
||||||
.registerAction(MappingMode.I, "EditorBackSpace", Command.Type.INSERT, Command.FLAG_IS_BACKSPACE,
|
|
||||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_H, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_BACK_SPACE, 0))}
|
|
||||||
);
|
|
||||||
parser.registerAction(MappingMode.I, "EditorDelete", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0)));
|
|
||||||
parser.registerAction(MappingMode.I, "EditorDown", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorTab", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_I, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_TAB, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "EditorUp", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertCharacterAboveCursor", Command.Type.INSERT,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_Y, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertCharacterBelowCursor", Command.Type.INSERT,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_E, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertDeleteInsertedText", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_U, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertDeletePreviousWord", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_W, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertEnter", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_M, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertPreviousInsert", Command.Type.INSERT,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_A, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertPreviousInsertExit", Command.Type.INSERT, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK | KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_2, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_AT, KeyEvent.CTRL_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertRegister", Command.Type.INSERT,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_R, KeyEvent.CTRL_MASK)),
|
|
||||||
Argument.Type.CHARACTER);
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertReplaceToggle", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_INSERT, 0)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimInsertSingleCommand", Command.Type.INSERT,
|
|
||||||
Command.FLAG_CLEAR_STROKES | Command.FLAG_EXPECT_MORE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_O, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionFirstColumn", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, 0)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionGotoLineFirst", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_HOME, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionGotoLineLastEnd", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionLastColumn", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_END, 0)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionLeft", Command.Type.INSERT, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionRight", Command.Type.INSERT, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, 0))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionScrollPageUp", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_UP, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_UP, KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_UP, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionScrollPageDown", Command.Type.INSERT, Command.FLAG_CLEAR_STROKES, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_PAGE_DOWN, 0)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_DOWN, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionWordLeft", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_LEFT, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimMotionWordRight", Command.Type.INSERT, Command.FLAG_SAVE_STROKE, new Shortcut[]{
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, KeyEvent.CTRL_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, KeyEvent.SHIFT_MASK)),
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_KP_RIGHT, KeyEvent.SHIFT_MASK))
|
|
||||||
});
|
|
||||||
parser.registerAction(MappingMode.I, "VimShiftLeftLines", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_D, KeyEvent.CTRL_MASK)));
|
|
||||||
parser.registerAction(MappingMode.I, "VimShiftRightLines", Command.Type.INSERT, Command.FLAG_SAVE_STROKE,
|
|
||||||
new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
56
src/com/maddyhome/idea/vim/VimLocalConfig.kt
Normal file
56
src/com/maddyhome/idea/vim/VimLocalConfig.kt
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim
|
||||||
|
|
||||||
|
import com.intellij.configurationStore.APP_CONFIG
|
||||||
|
import com.intellij.openapi.components.PersistentStateComponent
|
||||||
|
import com.intellij.openapi.components.RoamingType
|
||||||
|
import com.intellij.openapi.components.State
|
||||||
|
import com.intellij.openapi.components.Storage
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin.STATE_VERSION
|
||||||
|
import org.jdom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alex Plate
|
||||||
|
*/
|
||||||
|
|
||||||
|
@State(name = "VimLocalSettings",
|
||||||
|
storages = [Storage("$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED)])
|
||||||
|
class VimLocalConfig : PersistentStateComponent<Element> {
|
||||||
|
override fun getState(): Element {
|
||||||
|
val element = Element("ideavim-local")
|
||||||
|
|
||||||
|
val state = Element("state")
|
||||||
|
state.setAttribute("version", STATE_VERSION.toString())
|
||||||
|
element.addContent(state)
|
||||||
|
|
||||||
|
VimPlugin.getMark().saveData(element)
|
||||||
|
VimPlugin.getRegister().saveData(element)
|
||||||
|
VimPlugin.getSearch().saveData(element)
|
||||||
|
VimPlugin.getHistory().saveData(element)
|
||||||
|
return element
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun loadState(state: Element) {
|
||||||
|
VimPlugin.getMark().readData(state)
|
||||||
|
VimPlugin.getRegister().readData(state)
|
||||||
|
VimPlugin.getSearch().readData(state)
|
||||||
|
VimPlugin.getHistory().readData(state)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -17,17 +17,19 @@
|
|||||||
*/
|
*/
|
||||||
package com.maddyhome.idea.vim;
|
package com.maddyhome.idea.vim;
|
||||||
|
|
||||||
import com.intellij.notification.*;
|
import com.intellij.ide.plugins.IdeaPluginDescriptor;
|
||||||
|
import com.intellij.ide.plugins.PluginManager;
|
||||||
|
import com.intellij.ide.util.PropertiesComponent;
|
||||||
|
import com.intellij.notification.Notification;
|
||||||
|
import com.intellij.notification.NotificationDisplayType;
|
||||||
|
import com.intellij.notification.NotificationListener;
|
||||||
|
import com.intellij.notification.Notifications;
|
||||||
|
import com.intellij.openapi.Disposable;
|
||||||
|
import com.intellij.openapi.application.ApplicationInfo;
|
||||||
import com.intellij.openapi.application.ApplicationManager;
|
import com.intellij.openapi.application.ApplicationManager;
|
||||||
import com.intellij.openapi.application.ex.ApplicationEx;
|
import com.intellij.openapi.application.PermanentInstallationID;
|
||||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
import com.intellij.openapi.components.*;
|
||||||
import com.intellij.openapi.components.ApplicationComponent;
|
|
||||||
import com.intellij.openapi.components.PersistentStateComponent;
|
|
||||||
import com.intellij.openapi.components.State;
|
|
||||||
import com.intellij.openapi.components.Storage;
|
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorActionManager;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.TypedAction;
|
|
||||||
import com.intellij.openapi.extensions.PluginId;
|
import com.intellij.openapi.extensions.PluginId;
|
||||||
import com.intellij.openapi.keymap.Keymap;
|
import com.intellij.openapi.keymap.Keymap;
|
||||||
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
|
import com.intellij.openapi.keymap.ex.KeymapManagerEx;
|
||||||
@@ -35,25 +37,35 @@ import com.intellij.openapi.keymap.impl.DefaultKeymap;
|
|||||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
import com.intellij.openapi.options.ShowSettingsUtil;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import com.intellij.openapi.project.ProjectManager;
|
import com.intellij.openapi.project.ProjectManager;
|
||||||
import com.intellij.openapi.project.ProjectManagerAdapter;
|
|
||||||
import com.intellij.openapi.ui.Messages;
|
import com.intellij.openapi.ui.Messages;
|
||||||
|
import com.intellij.openapi.util.JDOMUtil;
|
||||||
import com.intellij.openapi.util.SystemInfo;
|
import com.intellij.openapi.util.SystemInfo;
|
||||||
|
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||||
import com.intellij.openapi.wm.StatusBar;
|
import com.intellij.openapi.wm.StatusBar;
|
||||||
import com.intellij.openapi.wm.WindowManager;
|
import com.intellij.openapi.wm.WindowManager;
|
||||||
|
import com.intellij.util.io.HttpRequests;
|
||||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||||
import com.maddyhome.idea.vim.ex.vimscript.VimScriptParser;
|
import com.maddyhome.idea.vim.ex.vimscript.VimScriptParser;
|
||||||
import com.maddyhome.idea.vim.group.*;
|
import com.maddyhome.idea.vim.group.*;
|
||||||
|
import com.maddyhome.idea.vim.group.copy.PutGroup;
|
||||||
|
import com.maddyhome.idea.vim.group.copy.YankGroup;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VisualMotionGroup;
|
||||||
import com.maddyhome.idea.vim.helper.DocumentManager;
|
import com.maddyhome.idea.vim.helper.DocumentManager;
|
||||||
import com.maddyhome.idea.vim.helper.MacKeyRepeat;
|
import com.maddyhome.idea.vim.helper.MacKeyRepeat;
|
||||||
import com.maddyhome.idea.vim.option.Options;
|
import com.maddyhome.idea.vim.listener.VimListenerManager;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
||||||
import org.jdom.Element;
|
import org.jdom.Element;
|
||||||
|
import org.jdom.JDOMException;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.event.HyperlinkEvent;
|
import javax.swing.event.HyperlinkEvent;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
import java.util.concurrent.TimeUnit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This plugin attempts to emulate the key binding and general functionality of Vim and gVim. See the supplied
|
* This plugin attempts to emulate the key binding and general functionality of Vim and gVim. See the supplied
|
||||||
@@ -62,21 +74,15 @@ import java.io.File;
|
|||||||
* <p/>
|
* <p/>
|
||||||
* This is an application level plugin meaning that all open projects will share a common instance of the plugin.
|
* This is an application level plugin meaning that all open projects will share a common instance of the plugin.
|
||||||
* Registers and marks are shared across open projects so you can copy and paste between files of different projects.
|
* Registers and marks are shared across open projects so you can copy and paste between files of different projects.
|
||||||
*
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
*/
|
||||||
@State(
|
@State(name = "VimSettings", storages = {@Storage("$APP_CONFIG$/vim_settings.xml")})
|
||||||
name = "VimSettings",
|
public class VimPlugin implements BaseComponent, PersistentStateComponent<Element>, Disposable {
|
||||||
storages = {@Storage(
|
|
||||||
id = "main",
|
|
||||||
file = "$APP_CONFIG$/vim_settings.xml")})
|
|
||||||
public class VimPlugin implements ApplicationComponent, PersistentStateComponent<Element> {
|
|
||||||
private static final String IDEAVIM_COMPONENT_NAME = "VimPlugin";
|
private static final String IDEAVIM_COMPONENT_NAME = "VimPlugin";
|
||||||
private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM";
|
private static final String IDEAVIM_PLUGIN_ID = "IdeaVIM";
|
||||||
public static final String IDEAVIM_NOTIFICATION_ID = "ideavim";
|
private static final String IDEAVIM_STATISTICS_TIMESTAMP_KEY = "ideavim.statistics.timestamp";
|
||||||
public static final String IDEAVIM_STICKY_NOTIFICATION_ID = "ideavim-sticky";
|
public static final int STATE_VERSION = 5;
|
||||||
public static final String IDEAVIM_NOTIFICATION_TITLE = "IdeaVim";
|
|
||||||
public static final int STATE_VERSION = 4;
|
private static long lastBeepTimeMillis;
|
||||||
|
|
||||||
private boolean error = false;
|
private boolean error = false;
|
||||||
|
|
||||||
@@ -85,12 +91,13 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
|
|
||||||
// It is enabled by default to avoid any special configuration after plugin installation
|
// It is enabled by default to avoid any special configuration after plugin installation
|
||||||
private boolean enabled = true;
|
private boolean enabled = true;
|
||||||
|
private boolean initialized = false;
|
||||||
|
|
||||||
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
||||||
|
|
||||||
@NotNull private final MotionGroup motion;
|
@NotNull private final MotionGroup motion;
|
||||||
@NotNull private final ChangeGroup change;
|
@NotNull private final ChangeGroup change;
|
||||||
@NotNull private final CopyGroup copy;
|
@NotNull private final CommandGroup command;
|
||||||
@NotNull private final MarkGroup mark;
|
@NotNull private final MarkGroup mark;
|
||||||
@NotNull private final RegisterGroup register;
|
@NotNull private final RegisterGroup register;
|
||||||
@NotNull private final FileGroup file;
|
@NotNull private final FileGroup file;
|
||||||
@@ -102,11 +109,16 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
@NotNull private final KeyGroup key;
|
@NotNull private final KeyGroup key;
|
||||||
@NotNull private final WindowGroup window;
|
@NotNull private final WindowGroup window;
|
||||||
@NotNull private final EditorGroup editor;
|
@NotNull private final EditorGroup editor;
|
||||||
|
@NotNull private final VisualMotionGroup visualMotion;
|
||||||
|
@NotNull private final YankGroup yank;
|
||||||
|
@NotNull private final PutGroup put;
|
||||||
|
|
||||||
|
@NotNull private final VimState state;
|
||||||
|
|
||||||
public VimPlugin() {
|
public VimPlugin() {
|
||||||
motion = new MotionGroup();
|
motion = new MotionGroup();
|
||||||
change = new ChangeGroup();
|
change = new ChangeGroup();
|
||||||
copy = new CopyGroup();
|
command = new CommandGroup();
|
||||||
mark = new MarkGroup();
|
mark = new MarkGroup();
|
||||||
register = new RegisterGroup();
|
register = new RegisterGroup();
|
||||||
file = new FileGroup();
|
file = new FileGroup();
|
||||||
@@ -118,6 +130,11 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
key = new KeyGroup();
|
key = new KeyGroup();
|
||||||
window = new WindowGroup();
|
window = new WindowGroup();
|
||||||
editor = new EditorGroup();
|
editor = new EditorGroup();
|
||||||
|
visualMotion = new VisualMotionGroup();
|
||||||
|
yank = new YankGroup();
|
||||||
|
put = new PutGroup();
|
||||||
|
|
||||||
|
state = new VimState();
|
||||||
|
|
||||||
LOG.debug("VimPlugin ctr");
|
LOG.debug("VimPlugin ctr");
|
||||||
}
|
}
|
||||||
@@ -132,87 +149,81 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
public void initComponent() {
|
public void initComponent() {
|
||||||
LOG.debug("initComponent");
|
LOG.debug("initComponent");
|
||||||
|
|
||||||
Notifications.Bus.register(IDEAVIM_STICKY_NOTIFICATION_ID, NotificationDisplayType.STICKY_BALLOON);
|
if (isEnabled()) initializePlugin();
|
||||||
|
|
||||||
ApplicationManager.getApplication().invokeLater(new Runnable() {
|
|
||||||
public void run() {
|
|
||||||
updateState();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
final TypedAction typedAction = EditorActionManager.getInstance().getTypedAction();
|
|
||||||
EventFacade.getInstance().setupTypedActionHandler(new VimTypedActionHandler(typedAction.getHandler()));
|
|
||||||
|
|
||||||
// Register vim actions in command mode
|
|
||||||
RegisterActions.registerActions();
|
|
||||||
|
|
||||||
// Add some listeners so we can handle special events
|
|
||||||
setupListeners();
|
|
||||||
|
|
||||||
// Register ex handlers
|
|
||||||
CommandParser.getInstance().registerHandlers();
|
|
||||||
|
|
||||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
|
||||||
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
|
|
||||||
if (ideaVimRc != null) {
|
|
||||||
VimScriptParser.executeFile(ideaVimRc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
LOG.debug("done");
|
LOG.debug("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void disposeComponent() {
|
public void dispose() {
|
||||||
LOG.debug("disposeComponent");
|
LOG.debug("disposeComponent");
|
||||||
turnOffPlugin();
|
turnOffPlugin();
|
||||||
EventFacade.getInstance().restoreTypedActionHandler();
|
|
||||||
LOG.debug("done");
|
LOG.debug("done");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
/**
|
||||||
public Element getState() {
|
* @return NotificationService as applicationService if project is null and projectService otherwise
|
||||||
LOG.debug("Saving state");
|
*/
|
||||||
|
@NotNull
|
||||||
final Element element = new Element("ideavim");
|
public static NotificationService getNotifications(@Nullable Project project) {
|
||||||
// Save whether the plugin is enabled or not
|
if (project == null) {
|
||||||
final Element state = new Element("state");
|
return ServiceManager.getService(NotificationService.class);
|
||||||
state.setAttribute("version", Integer.toString(STATE_VERSION));
|
} else {
|
||||||
state.setAttribute("enabled", Boolean.toString(enabled));
|
return ServiceManager.getService(project, NotificationService.class);
|
||||||
element.addContent(state);
|
}
|
||||||
|
|
||||||
mark.saveData(element);
|
|
||||||
register.saveData(element);
|
|
||||||
search.saveData(element);
|
|
||||||
history.saveData(element);
|
|
||||||
key.saveData(element);
|
|
||||||
editor.saveData(element);
|
|
||||||
|
|
||||||
return element;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@NotNull
|
||||||
public void loadState(@NotNull final Element element) {
|
public static VimState getVimState() {
|
||||||
LOG.debug("Loading state");
|
return getInstance().state;
|
||||||
|
}
|
||||||
|
|
||||||
// Restore whether the plugin is enabled or not
|
/**
|
||||||
Element state = element.getChild("state");
|
* Reports statistics about installed IdeaVim and enabled Vim emulation.
|
||||||
if (state != null) {
|
* <p>
|
||||||
try {
|
* See https://github.com/go-lang-plugin-org/go-lang-idea-plugin/commit/5182ab4a1d01ad37f6786268a2fe5e908575a217
|
||||||
previousStateVersion = Integer.valueOf(state.getAttributeValue("version"));
|
*/
|
||||||
}
|
public static void statisticReport() {
|
||||||
catch (NumberFormatException ignored) {
|
final PropertiesComponent propertiesComponent = PropertiesComponent.getInstance();
|
||||||
}
|
final long lastUpdate = propertiesComponent.getOrInitLong(IDEAVIM_STATISTICS_TIMESTAMP_KEY, 0);
|
||||||
enabled = Boolean.valueOf(state.getAttributeValue("enabled"));
|
final boolean outOfDate =
|
||||||
previousKeyMap = state.getAttributeValue("keymap");
|
lastUpdate == 0 || System.currentTimeMillis() - lastUpdate > TimeUnit.DAYS.toMillis(1);
|
||||||
|
if (outOfDate && isEnabled()) {
|
||||||
|
ApplicationManager.getApplication().executeOnPooledThread(() -> {
|
||||||
|
try {
|
||||||
|
final String buildNumber = ApplicationInfo.getInstance().getBuild().asString();
|
||||||
|
final String version = URLEncoder.encode(getVersion(), CharsetToolkit.UTF8);
|
||||||
|
final String os =
|
||||||
|
URLEncoder.encode(SystemInfo.OS_NAME + " " + SystemInfo.OS_VERSION, CharsetToolkit.UTF8);
|
||||||
|
final String uid = PermanentInstallationID.get();
|
||||||
|
final String url = "https://plugins.jetbrains.com/plugins/list" +
|
||||||
|
"?pluginId=" + IDEAVIM_PLUGIN_ID +
|
||||||
|
"&build=" +
|
||||||
|
buildNumber +
|
||||||
|
"&pluginVersion=" +
|
||||||
|
version +
|
||||||
|
"&os=" +
|
||||||
|
os +
|
||||||
|
"&uuid=" +
|
||||||
|
uid;
|
||||||
|
PropertiesComponent.getInstance()
|
||||||
|
.setValue(IDEAVIM_STATISTICS_TIMESTAMP_KEY, String.valueOf(System.currentTimeMillis()));
|
||||||
|
HttpRequests.request(url).connect(request -> {
|
||||||
|
LOG.info("Sending statistics: " + url);
|
||||||
|
try {
|
||||||
|
JDOMUtil.load(request.getInputStream());
|
||||||
|
}
|
||||||
|
catch (JDOMException e) {
|
||||||
|
LOG.warn(e);
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (IOException e) {
|
||||||
|
LOG.warn(e);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
mark.readData(element);
|
|
||||||
register.readData(element);
|
|
||||||
search.readData(element);
|
|
||||||
history.readData(element);
|
|
||||||
key.readData(element);
|
|
||||||
editor.readData(element);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -226,8 +237,8 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static CopyGroup getCopy() {
|
public static CommandGroup getCommand() {
|
||||||
return getInstance().copy;
|
return getInstance().command;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@@ -285,11 +296,88 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
return getInstance().editor;
|
return getInstance().editor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static VisualMotionGroup getVisualMotion() {
|
||||||
|
return getInstance().visualMotion;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static YankGroup getYank() {
|
||||||
|
return getInstance().yank;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static PutGroup getPut() {
|
||||||
|
return getInstance().put;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
private static NotificationService getNotifications() {
|
||||||
|
return getNotifications(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Element getState() {
|
||||||
|
LOG.debug("Saving state");
|
||||||
|
|
||||||
|
final Element element = new Element("ideavim");
|
||||||
|
// Save whether the plugin is enabled or not
|
||||||
|
final Element state = new Element("state");
|
||||||
|
state.setAttribute("version", Integer.toString(STATE_VERSION));
|
||||||
|
state.setAttribute("enabled", Boolean.toString(enabled));
|
||||||
|
element.addContent(state);
|
||||||
|
|
||||||
|
key.saveData(element);
|
||||||
|
editor.saveData(element);
|
||||||
|
this.state.saveData(element);
|
||||||
|
|
||||||
|
return element;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void initializePlugin() {
|
||||||
|
if (initialized) return;
|
||||||
|
initialized = true;
|
||||||
|
|
||||||
|
Notifications.Bus.register(NotificationService.IDEAVIM_STICKY_NOTIFICATION_ID, NotificationDisplayType.STICKY_BALLOON);
|
||||||
|
|
||||||
|
ApplicationManager.getApplication().invokeLater(this::updateState);
|
||||||
|
|
||||||
|
VimListenerManager.GlobalListeners.enable();
|
||||||
|
|
||||||
|
// Register vim actions in command mode
|
||||||
|
RegisterActions.registerActions();
|
||||||
|
|
||||||
|
// Add some listeners so we can handle special events
|
||||||
|
DocumentManager.getInstance().addDocumentListener(MarkGroup.MarkUpdater.INSTANCE);
|
||||||
|
DocumentManager.getInstance().addDocumentListener(SearchGroup.DocumentSearchListener.INSTANCE);
|
||||||
|
|
||||||
|
// Register ex handlers
|
||||||
|
CommandParser.getInstance().registerHandlers();
|
||||||
|
|
||||||
|
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
|
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
|
||||||
|
if (ideaVimRc != null) {
|
||||||
|
VimScriptParser.executeFile(ideaVimRc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static PluginId getPluginId() {
|
public static PluginId getPluginId() {
|
||||||
return PluginId.getId(IDEAVIM_PLUGIN_ID);
|
return PluginId.getId(IDEAVIM_PLUGIN_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
public static String getVersion() {
|
||||||
|
if (!ApplicationManager.getApplication().isInternal()) {
|
||||||
|
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(getPluginId());
|
||||||
|
return plugin != null ? plugin.getVersion() : "SNAPSHOT";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return "INTERNAL";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isEnabled() {
|
public static boolean isEnabled() {
|
||||||
return getInstance().enabled;
|
return getInstance().enabled;
|
||||||
}
|
}
|
||||||
@@ -317,8 +405,13 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
if (ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
getInstance().error = true;
|
getInstance().error = true;
|
||||||
}
|
}
|
||||||
else if (!Options.getInstance().isSet("visualbell")) {
|
else if (!OptionsManager.INSTANCE.getVisualbell().isSet()) {
|
||||||
Toolkit.getDefaultToolkit().beep();
|
// Vim only allows a beep once every half second - :help 'visualbell'
|
||||||
|
final long currentTimeMillis = System.currentTimeMillis();
|
||||||
|
if (currentTimeMillis - lastBeepTimeMillis > 500) {
|
||||||
|
Toolkit.getDefaultToolkit().beep();
|
||||||
|
lastBeepTimeMillis = currentTimeMillis;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -354,35 +447,32 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void turnOnPlugin() {
|
private void turnOnPlugin() {
|
||||||
|
initializePlugin();
|
||||||
KeyHandler.getInstance().fullReset(null);
|
KeyHandler.getInstance().fullReset(null);
|
||||||
|
|
||||||
getEditor().turnOn();
|
getEditor().turnOn();
|
||||||
getMotion().turnOn();
|
getSearch().turnOn();
|
||||||
|
VimListenerManager.INSTANCE.turnOn();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void turnOffPlugin() {
|
private void turnOffPlugin() {
|
||||||
KeyHandler.getInstance().fullReset(null);
|
KeyHandler.getInstance().fullReset(null);
|
||||||
|
|
||||||
getEditor().turnOff();
|
getEditor().turnOff();
|
||||||
getMotion().turnOff();
|
getSearch().turnOff();
|
||||||
|
VimListenerManager.INSTANCE.turnOff();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateState() {
|
private void updateState() {
|
||||||
if (isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
if (isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||||
boolean requiresRestart = false;
|
|
||||||
if (SystemInfo.isMac) {
|
if (SystemInfo.isMac) {
|
||||||
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
||||||
final Boolean enabled = keyRepeat.isEnabled();
|
final Boolean enabled = keyRepeat.isEnabled();
|
||||||
final Boolean isKeyRepeat = editor.isKeyRepeat();
|
final Boolean isKeyRepeat = editor.isKeyRepeat();
|
||||||
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
||||||
if (Messages.showYesNoDialog("Do you want to enable repeating keys in Mac OS X on press and hold " +
|
if (VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) {
|
||||||
"(requires restart)?\n\n" +
|
|
||||||
"(You can do it manually by running 'defaults write -g " +
|
|
||||||
"ApplePressAndHoldEnabled 0' in the console).", IDEAVIM_NOTIFICATION_TITLE,
|
|
||||||
Messages.getQuestionIcon()) == Messages.YES) {
|
|
||||||
editor.setKeyRepeat(true);
|
editor.setKeyRepeat(true);
|
||||||
keyRepeat.setEnabled(true);
|
keyRepeat.setEnabled(true);
|
||||||
requiresRestart = true;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
editor.setKeyRepeat(false);
|
editor.setKeyRepeat(false);
|
||||||
@@ -399,58 +489,45 @@ public class VimPlugin implements ApplicationComponent, PersistentStateComponent
|
|||||||
keymap = manager.getKeymap(DefaultKeymap.getInstance().getDefaultKeymapName());
|
keymap = manager.getKeymap(DefaultKeymap.getInstance().getDefaultKeymapName());
|
||||||
}
|
}
|
||||||
assert keymap != null : "Default keymap not found";
|
assert keymap != null : "Default keymap not found";
|
||||||
new Notification(
|
VimPlugin.getNotifications().specialKeymap(keymap, new NotificationListener.Adapter() {
|
||||||
VimPlugin.IDEAVIM_STICKY_NOTIFICATION_ID,
|
@Override
|
||||||
VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
|
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
||||||
String.format("IdeaVim plugin doesn't use the special \"Vim\" keymap any longer. " +
|
ShowSettingsUtil.getInstance().editConfigurable((Project)null, new VimEmulationConfigurable());
|
||||||
"Switching to \"%s\" keymap.<br/><br/>" +
|
}
|
||||||
"Now it is possible to set up:<br/>" +
|
});
|
||||||
"<ul>" +
|
|
||||||
"<li>Vim keys in your ~/.ideavimrc file using key mapping commands</li>" +
|
|
||||||
"<li>IDE action shortcuts in \"File | Settings | Keymap\"</li>" +
|
|
||||||
"<li>Vim or IDE handlers for conflicting shortcuts in <a href='#settings'>Vim Emulation</a> settings</li>" +
|
|
||||||
"</ul>", keymap.getPresentableName()),
|
|
||||||
NotificationType.INFORMATION,
|
|
||||||
new NotificationListener.Adapter() {
|
|
||||||
@Override
|
|
||||||
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
|
||||||
ShowSettingsUtil.getInstance().editConfigurable((Project)null, new VimEmulationConfigurable());
|
|
||||||
}
|
|
||||||
}).notify(null);
|
|
||||||
manager.setActiveKeymap(keymap);
|
manager.setActiveKeymap(keymap);
|
||||||
}
|
}
|
||||||
if (previousStateVersion > 0 && previousStateVersion < 4) {
|
if (previousStateVersion > 0 && previousStateVersion < 4) {
|
||||||
new Notification(
|
VimPlugin.getNotifications().noVimrcAsDefault();
|
||||||
VimPlugin.IDEAVIM_STICKY_NOTIFICATION_ID,
|
|
||||||
VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
|
|
||||||
"The ~/.vimrc file is no longer read by default, use ~/.ideavimrc instead. You can read it from your " +
|
|
||||||
"~/.ideavimrc using this command:<br/><br/>" +
|
|
||||||
"<code>source ~/.vimrc</code>",
|
|
||||||
NotificationType.INFORMATION).notify(null);
|
|
||||||
}
|
|
||||||
if (requiresRestart) {
|
|
||||||
final ApplicationEx app = ApplicationManagerEx.getApplicationEx();
|
|
||||||
app.restart();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* This sets up some listeners so we can handle various events that occur
|
public void loadState(@NotNull final Element element) {
|
||||||
*/
|
LOG.debug("Loading state");
|
||||||
private void setupListeners() {
|
|
||||||
final EventFacade eventFacade = EventFacade.getInstance();
|
|
||||||
|
|
||||||
DocumentManager.getInstance().addDocumentListener(new MarkGroup.MarkUpdater());
|
// Restore whether the plugin is enabled or not
|
||||||
DocumentManager.getInstance().addDocumentListener(new SearchGroup.DocumentSearchListener());
|
Element state = element.getChild("state");
|
||||||
|
if (state != null) {
|
||||||
eventFacade.addProjectManagerListener(new ProjectManagerAdapter() {
|
try {
|
||||||
@Override
|
previousStateVersion = Integer.parseInt(state.getAttributeValue("version"));
|
||||||
public void projectOpened(@NotNull final Project project) {
|
|
||||||
eventFacade.addFileEditorManagerListener(project, new MotionGroup.MotionEditorChange());
|
|
||||||
eventFacade.addFileEditorManagerListener(project, new FileGroup.SelectionCheck());
|
|
||||||
eventFacade.addFileEditorManagerListener(project, new SearchGroup.EditorSelectionCheck());
|
|
||||||
}
|
}
|
||||||
});
|
catch (NumberFormatException ignored) {
|
||||||
|
}
|
||||||
|
enabled = Boolean.parseBoolean(state.getAttributeValue("enabled"));
|
||||||
|
previousKeyMap = state.getAttributeValue("keymap");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (previousStateVersion > 0 && previousStateVersion < 5) {
|
||||||
|
// Migrate settings from 4 to 5 version
|
||||||
|
mark.readData(element);
|
||||||
|
register.readData(element);
|
||||||
|
search.readData(element);
|
||||||
|
history.readData(element);
|
||||||
|
}
|
||||||
|
key.readData(element);
|
||||||
|
editor.readData(element);
|
||||||
|
this.state.readData(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
34
src/com/maddyhome/idea/vim/VimProjectComponent.kt
Normal file
34
src/com/maddyhome/idea/vim/VimProjectComponent.kt
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim
|
||||||
|
|
||||||
|
import com.intellij.openapi.components.ProjectComponent
|
||||||
|
import com.intellij.openapi.project.Project
|
||||||
|
import com.maddyhome.idea.vim.listener.VimListenerManager
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alex Plate
|
||||||
|
*/
|
||||||
|
class VimProjectComponent(private val project: Project) : ProjectComponent {
|
||||||
|
override fun projectOpened() {
|
||||||
|
if (!VimPlugin.isEnabled()) return
|
||||||
|
// Project listeners are self-disposable, so there is no need to unregister them on project close
|
||||||
|
VimListenerManager.ProjectListeners.add(project)
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/com/maddyhome/idea/vim/VimState.kt
Normal file
43
src/com/maddyhome/idea/vim/VimState.kt
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
package com.maddyhome.idea.vim
|
||||||
|
|
||||||
|
import org.jdom.Element
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Alex Plate
|
||||||
|
*/
|
||||||
|
class VimState {
|
||||||
|
var isIdeaJoinNotified = false
|
||||||
|
var isIdeaPutNotified = false
|
||||||
|
var isTemplateInSelectModeNotified = false
|
||||||
|
|
||||||
|
fun readData(element: Element) {
|
||||||
|
val notifications: Element? = element.getChild("notifications")
|
||||||
|
|
||||||
|
notifications?.getChild("idea-join")?.getAttributeValue("enabled")?.let {
|
||||||
|
isIdeaJoinNotified = it.toBoolean()
|
||||||
|
}
|
||||||
|
notifications?.getChild("idea-put")?.getAttributeValue("enabled")?.let {
|
||||||
|
isIdeaPutNotified = it.toBoolean()
|
||||||
|
}
|
||||||
|
notifications?.getChild("template-selectmode")?.getAttributeValue("enabled")?.let {
|
||||||
|
isIdeaPutNotified = it.toBoolean()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun saveData(element: Element) {
|
||||||
|
val notifications = Element("notifications")
|
||||||
|
element.addContent(notifications)
|
||||||
|
|
||||||
|
val ideaJoin = Element("idea-join")
|
||||||
|
ideaJoin.setAttribute("enabled", isIdeaJoinNotified.toString())
|
||||||
|
notifications.addContent(ideaJoin)
|
||||||
|
|
||||||
|
val ideaPut = Element("idea-put")
|
||||||
|
ideaPut.setAttribute("enabled", isIdeaPutNotified.toString())
|
||||||
|
notifications.addContent(ideaPut)
|
||||||
|
|
||||||
|
val templateKeyModel = Element("template-selectmode")
|
||||||
|
templateKeyModel.setAttribute("enabled", isTemplateInSelectModeNotified.toString())
|
||||||
|
notifications.addContent(templateKeyModel)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,47 +23,60 @@ import com.intellij.codeInsight.lookup.LookupManager;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||||
|
import com.intellij.openapi.editor.actionSystem.TypedActionHandlerEx;
|
||||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||||
|
import com.maddyhome.idea.vim.listener.SelectionVimListenerSuppressor;
|
||||||
|
import com.maddyhome.idea.vim.listener.VimListenerSuppressor;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.awt.event.KeyEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Accepts all regular keystrokes and passes them on to the Vim key handler.
|
* Accepts all regular keystrokes and passes them on to the Vim key handler.
|
||||||
*
|
*
|
||||||
* IDE shortcut keys used by Vim commands are handled by {@link com.maddyhome.idea.vim.action.VimShortcutKeyAction}.
|
* IDE shortcut keys used by Vim commands are handled by {@link com.maddyhome.idea.vim.action.VimShortcutKeyAction}.
|
||||||
*/
|
*/
|
||||||
public class VimTypedActionHandler implements TypedActionHandler {
|
public class VimTypedActionHandler implements TypedActionHandlerEx {
|
||||||
private static final Logger logger = Logger.getInstance(VimTypedActionHandler.class.getName());
|
private static final Logger logger = Logger.getInstance(VimTypedActionHandler.class.getName());
|
||||||
|
|
||||||
private final TypedActionHandler origHandler;
|
|
||||||
@NotNull private final KeyHandler handler;
|
@NotNull private final KeyHandler handler;
|
||||||
|
|
||||||
public VimTypedActionHandler(TypedActionHandler origHandler) {
|
public VimTypedActionHandler(TypedActionHandler origHandler) {
|
||||||
this.origHandler = origHandler;
|
|
||||||
handler = KeyHandler.getInstance();
|
handler = KeyHandler.getInstance();
|
||||||
handler.setOriginalHandler(origHandler);
|
handler.setOriginalHandler(origHandler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext context) {
|
public void beforeExecute(@NotNull Editor editor, char charTyped, @NotNull DataContext context, @NotNull ActionPlan plan) {
|
||||||
if (isEnabled(editor)) {
|
if (isEnabled(editor)) {
|
||||||
// Run key handler outside of the key typed command for creating our own undoable commands
|
handler.beforeHandleKey(editor, KeyStroke.getKeyStroke(charTyped), context, plan);
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
|
||||||
}
|
|
||||||
catch (Throwable e) {
|
|
||||||
logger.error(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
origHandler.execute(editor, charTyped, context);
|
TypedActionHandler originalHandler = handler.getOriginalHandler();
|
||||||
|
if (originalHandler instanceof TypedActionHandlerEx) {
|
||||||
|
((TypedActionHandlerEx)originalHandler).beforeExecute(editor, charTyped, context, plan);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void execute(@NotNull final Editor editor, final char charTyped, @NotNull final DataContext context) {
|
||||||
|
if (isEnabled(editor) && charTyped != KeyEvent.CHAR_UNDEFINED) {
|
||||||
|
try {
|
||||||
|
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
||||||
|
}
|
||||||
|
catch (Throwable e) {
|
||||||
|
logger.error(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
try (final VimListenerSuppressor ignored = SelectionVimListenerSuppressor.INSTANCE.lock()) {
|
||||||
|
TypedActionHandler origHandler = handler.getOriginalHandler();
|
||||||
|
origHandler.execute(editor, charTyped, context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,25 +20,46 @@ package com.maddyhome.idea.vim.action;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*
|
import java.util.List;
|
||||||
*/
|
import java.util.Set;
|
||||||
public class ExEntryAction extends EditorAction {
|
|
||||||
public ExEntryAction() {
|
|
||||||
super(new Handler());
|
public class ExEntryAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.NVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
VimPlugin.getProcess().startExCommand(editor, context, cmd);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet(":");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_READ_WRITE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
VimPlugin.getProcess().startExCommand(editor, context, cmd);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,21 +20,46 @@ package com.maddyhome.idea.vim.action;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
|
||||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.helper.HelperKt;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*
|
import java.util.List;
|
||||||
*/
|
import java.util.Set;
|
||||||
public class ResetModeAction extends EditorAction {
|
|
||||||
public ResetModeAction() {
|
|
||||||
super(new EditorActionHandler() {
|
public class ResetModeAction extends VimCommandAction {
|
||||||
public void execute(@NotNull Editor editor, @NotNull DataContext context) {
|
@NotNull
|
||||||
KeyHandler.getInstance().fullReset(InjectedLanguageUtil.getTopLevelEditor(editor));
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
KeyHandler.getInstance().fullReset(HelperKt.getTopLevelEditor(editor));
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("<C-\\><C-N>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.RESET;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,80 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2014 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action;
|
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorActionHandler;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
|
||||||
import com.maddyhome.idea.vim.helper.StringHelper;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
|
|
||||||
import javax.swing.*;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Action that represents a Vim command.
|
|
||||||
*
|
|
||||||
* Actions should be registered in resources/META-INF/plugin.xml and in package-info.java
|
|
||||||
* inside {@link com.maddyhome.idea.vim.action}.
|
|
||||||
*
|
|
||||||
* @author vlan
|
|
||||||
*/
|
|
||||||
public abstract class VimCommandAction extends EditorAction {
|
|
||||||
protected VimCommandAction(EditorActionHandler defaultHandler) {
|
|
||||||
super(defaultHandler);
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public abstract Set<MappingMode> getMappingModes();
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public abstract Set<List<KeyStroke>> getKeyStrokesSet();
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public abstract Command.Type getType();
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
public Argument.Type getArgumentType() {
|
|
||||||
return Argument.Type.NONE;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns various binary flags for the command.
|
|
||||||
*
|
|
||||||
* These legacy flags will be refactored in future releases.
|
|
||||||
*
|
|
||||||
* @see {@link Command}.
|
|
||||||
*/
|
|
||||||
public int getFlags() {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
|
||||||
protected static Set<List<KeyStroke>> parseKeysSet(@NotNull String... keyStrings) {
|
|
||||||
final ImmutableSet.Builder<List<KeyStroke>> builder = ImmutableSet.builder();
|
|
||||||
for (String keyString : keyStrings) {
|
|
||||||
builder.add(StringHelper.parseKeys(keyString));
|
|
||||||
}
|
|
||||||
return builder.build();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
136
src/com/maddyhome/idea/vim/action/VimCommands.kt
Normal file
136
src/com/maddyhome/idea/vim/action/VimCommands.kt
Normal file
@@ -0,0 +1,136 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action
|
||||||
|
|
||||||
|
import com.google.common.collect.ImmutableSet
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext
|
||||||
|
import com.intellij.openapi.editor.Caret
|
||||||
|
import com.intellij.openapi.editor.Editor
|
||||||
|
import com.intellij.openapi.editor.actionSystem.EditorAction
|
||||||
|
import com.maddyhome.idea.vim.command.Argument
|
||||||
|
import com.maddyhome.idea.vim.command.Command
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode
|
||||||
|
import com.maddyhome.idea.vim.common.TextRange
|
||||||
|
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase
|
||||||
|
import com.maddyhome.idea.vim.handler.MotionActionHandler
|
||||||
|
import com.maddyhome.idea.vim.handler.TextObjectActionHandler
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||||
|
import com.maddyhome.idea.vim.helper.StringHelper
|
||||||
|
import com.maddyhome.idea.vim.helper.noneOfEnum
|
||||||
|
import java.util.*
|
||||||
|
import javax.swing.KeyStroke
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Structure of commands
|
||||||
|
*
|
||||||
|
* VimCommandActionBase
|
||||||
|
* (Can't be used directly)
|
||||||
|
* |
|
||||||
|
* -------------------------------------------------------------------------------------
|
||||||
|
* | | |
|
||||||
|
* MotionEditorAction TextObjectAction VimCommandAction
|
||||||
|
* (accepts MotionActionHandler) (accepts TextObjectActionHandler) (accepts VimActionHandler)
|
||||||
|
*
|
||||||
|
* See also EditorActionHandlerBase.kt for handlers structure
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Action that represents a Vim command.
|
||||||
|
*
|
||||||
|
* Actions should be registered in resources/META-INF/plugin.xml and in package-info.java
|
||||||
|
* inside [com.maddyhome.idea.vim.action].
|
||||||
|
*
|
||||||
|
* @author vlan
|
||||||
|
*/
|
||||||
|
sealed class VimCommandActionBase : EditorAction(null) {
|
||||||
|
|
||||||
|
init {
|
||||||
|
@Suppress("LeakingThis")
|
||||||
|
setupHandler(makeActionHandler())
|
||||||
|
}
|
||||||
|
|
||||||
|
protected abstract fun makeActionHandler(): EditorActionHandlerBase
|
||||||
|
|
||||||
|
abstract val mappingModes: Set<MappingMode>
|
||||||
|
|
||||||
|
abstract val keyStrokesSet: Set<List<KeyStroke>>
|
||||||
|
|
||||||
|
abstract val type: Command.Type
|
||||||
|
|
||||||
|
open val argumentType: Argument.Type = Argument.Type.NONE
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns various binary flags for the command.
|
||||||
|
*
|
||||||
|
* These legacy flags will be refactored in future releases.
|
||||||
|
*
|
||||||
|
* @see com.maddyhome.idea.vim.command.Command
|
||||||
|
*/
|
||||||
|
open val flags: EnumSet<CommandFlags> = noneOfEnum()
|
||||||
|
|
||||||
|
protected companion object {
|
||||||
|
@JvmStatic
|
||||||
|
fun parseKeysSet(vararg keyStrings: String): Set<List<KeyStroke>> {
|
||||||
|
val builder = ImmutableSet.builder<List<KeyStroke>>()
|
||||||
|
for (keyString in keyStrings) {
|
||||||
|
builder.add(StringHelper.parseKeys(keyString))
|
||||||
|
}
|
||||||
|
return builder.build()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class VimCommandAction : VimCommandActionBase() {
|
||||||
|
abstract override fun makeActionHandler(): VimActionHandler
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class TextObjectAction : VimCommandActionBase() {
|
||||||
|
abstract override fun makeActionHandler(): TextObjectActionHandler
|
||||||
|
|
||||||
|
fun getRange(editor: Editor, caret: Caret, context: DataContext, count: Int, rawCount: Int, argument: Argument?): TextRange? {
|
||||||
|
val actionHandler = handler as? TextObjectActionHandler
|
||||||
|
?: throw RuntimeException("TextObjectAction works only with TextObjectActionHandler")
|
||||||
|
|
||||||
|
return actionHandler.getRange(editor, caret, context, count, rawCount, argument)
|
||||||
|
}
|
||||||
|
|
||||||
|
final override val type: Command.Type = Command.Type.MOTION
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract class MotionEditorAction : VimCommandActionBase() {
|
||||||
|
abstract override fun makeActionHandler(): MotionActionHandler
|
||||||
|
|
||||||
|
fun getOffset(editor: Editor,
|
||||||
|
caret: Caret,
|
||||||
|
context: DataContext,
|
||||||
|
count: Int,
|
||||||
|
rawCount: Int,
|
||||||
|
argument: Argument?): Int {
|
||||||
|
val actionHandler = handler as? MotionActionHandler
|
||||||
|
?: throw RuntimeException("MotionAction works only with MotionHandler")
|
||||||
|
|
||||||
|
return when (actionHandler) {
|
||||||
|
is MotionActionHandler.SingleExecution -> actionHandler.getOffset(editor, context, count, rawCount, argument)
|
||||||
|
is MotionActionHandler.ForEachCaret -> actionHandler.getOffset(editor, caret, context, count, rawCount, argument)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
final override val type: Command.Type = Command.Type.MOTION
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -22,6 +22,7 @@ import com.intellij.openapi.actionSystem.AnActionEvent;
|
|||||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||||
import com.intellij.openapi.project.DumbAware;
|
import com.intellij.openapi.project.DumbAware;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This class is used to handle the Vim Plugin enabled/disabled toggle. This is most likely used as a menu option
|
* This class is used to handle the Vim Plugin enabled/disabled toggle. This is most likely used as a menu option
|
||||||
@@ -34,7 +35,8 @@ public class VimPluginToggleAction extends ToggleAction implements DumbAware {
|
|||||||
* @param event The event that triggered the action
|
* @param event The event that triggered the action
|
||||||
* @return true if the toggle is on, false if off
|
* @return true if the toggle is on, false if off
|
||||||
*/
|
*/
|
||||||
public boolean isSelected(AnActionEvent event) {
|
@Override
|
||||||
|
public boolean isSelected(@NotNull AnActionEvent event) {
|
||||||
return VimPlugin.isEnabled();
|
return VimPlugin.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,7 +46,8 @@ public class VimPluginToggleAction extends ToggleAction implements DumbAware {
|
|||||||
* @param event The event that triggered the action
|
* @param event The event that triggered the action
|
||||||
* @param b The new state - true is on, false is off
|
* @param b The new state - true is on, false is off
|
||||||
*/
|
*/
|
||||||
public void setSelected(AnActionEvent event, boolean b) {
|
@Override
|
||||||
|
public void setSelected(@NotNull AnActionEvent event, boolean b) {
|
||||||
VimPlugin.setEnabled(b);
|
VimPlugin.setEnabled(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,29 +20,29 @@ package com.maddyhome.idea.vim.action;
|
|||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
import com.intellij.codeInsight.lookup.LookupManager;
|
import com.intellij.codeInsight.lookup.LookupManager;
|
||||||
import com.intellij.notification.Notification;
|
|
||||||
import com.intellij.notification.NotificationListener;
|
|
||||||
import com.intellij.notification.NotificationType;
|
|
||||||
import com.intellij.openapi.actionSystem.*;
|
import com.intellij.openapi.actionSystem.*;
|
||||||
import com.intellij.openapi.diagnostic.Logger;
|
import com.intellij.openapi.diagnostic.Logger;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.keymap.KeymapUtil;
|
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||||
import com.intellij.openapi.options.ShowSettingsUtil;
|
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||||
import com.intellij.openapi.project.DumbAware;
|
import com.intellij.openapi.project.DumbAware;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
|
import com.intellij.openapi.util.Key;
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.command.CommandState;
|
||||||
import com.maddyhome.idea.vim.helper.EditorData;
|
import com.maddyhome.idea.vim.helper.CommandStateHelper;
|
||||||
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
import com.maddyhome.idea.vim.helper.EditorDataContext;
|
||||||
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import com.maddyhome.idea.vim.key.ShortcutOwner;
|
import com.maddyhome.idea.vim.key.ShortcutOwner;
|
||||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable;
|
import com.maddyhome.idea.vim.option.ListOption;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
|
import one.util.streamex.StreamEx;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.event.HyperlinkEvent;
|
|
||||||
import java.awt.event.InputEvent;
|
import java.awt.event.InputEvent;
|
||||||
import java.awt.event.KeyEvent;
|
import java.awt.event.KeyEvent;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -54,7 +54,7 @@ import static java.awt.event.KeyEvent.*;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Handles Vim keys that are treated as action shortcuts by the IDE.
|
* Handles Vim keys that are treated as action shortcuts by the IDE.
|
||||||
*
|
* <p>
|
||||||
* These keys are not passed to {@link com.maddyhome.idea.vim.VimTypedActionHandler} and should be handled by actions.
|
* These keys are not passed to {@link com.maddyhome.idea.vim.VimTypedActionHandler} and should be handled by actions.
|
||||||
*/
|
*/
|
||||||
public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||||
@@ -86,6 +86,7 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
|||||||
.build();
|
.build();
|
||||||
|
|
||||||
private static final Logger ourLogger = Logger.getInstance(VimShortcutKeyAction.class.getName());
|
private static final Logger ourLogger = Logger.getInstance(VimShortcutKeyAction.class.getName());
|
||||||
|
private static AnAction ourInstance = null;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||||
@@ -94,21 +95,15 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
|||||||
if (editor != null && keyStroke != null) {
|
if (editor != null && keyStroke != null) {
|
||||||
final ShortcutOwner owner = VimPlugin.getKey().getSavedShortcutConflicts().get(keyStroke);
|
final ShortcutOwner owner = VimPlugin.getKey().getSavedShortcutConflicts().get(keyStroke);
|
||||||
if (owner == ShortcutOwner.UNDEFINED) {
|
if (owner == ShortcutOwner.UNDEFINED) {
|
||||||
notifyAboutShortcutConflict(keyStroke);
|
VimPlugin.getNotifications(editor.getProject()).notifyAboutShortcutConflict(keyStroke);
|
||||||
|
}
|
||||||
|
// Should we use HelperKt.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
|
||||||
|
try {
|
||||||
|
KeyHandler.getInstance().handleKey(editor, keyStroke, new EditorDataContext(editor));
|
||||||
|
}
|
||||||
|
catch (Throwable throwable) {
|
||||||
|
ourLogger.error(throwable);
|
||||||
}
|
}
|
||||||
// Should we use InjectedLanguageUtil.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
|
|
||||||
// Run key handler later to restore input events sequence due to VimTypedActionHandler
|
|
||||||
SwingUtilities.invokeLater(new Runnable() {
|
|
||||||
@Override
|
|
||||||
public void run() {
|
|
||||||
try {
|
|
||||||
KeyHandler.getInstance().handleKey(editor, keyStroke, new EditorDataContext(editor));
|
|
||||||
}
|
|
||||||
catch (Throwable throwable) {
|
|
||||||
ourLogger.error(throwable);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,85 +114,102 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public static AnAction getInstance() {
|
public static AnAction getInstance() {
|
||||||
return ActionManager.getInstance().getAction(ACTION_ID);
|
if (ourInstance == null) {
|
||||||
}
|
final AnAction originalAction = ActionManager.getInstance().getAction(ACTION_ID);
|
||||||
|
ourInstance = EmptyAction.wrap(originalAction);
|
||||||
private void notifyAboutShortcutConflict(@NotNull final KeyStroke keyStroke) {
|
}
|
||||||
VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.VIM);
|
return ourInstance;
|
||||||
final String message = String.format(
|
|
||||||
"Using the <b>%s</b> shortcut for Vim emulation.<br/>" +
|
|
||||||
"You can redefine it as an <a href='#ide'>IDE shortcut</a> or " +
|
|
||||||
"configure its handler in <a href='#settings'>Vim Emulation</a> settings.",
|
|
||||||
KeymapUtil.getShortcutText(new KeyboardShortcut(keyStroke, null)));
|
|
||||||
final NotificationListener listener = new NotificationListener.Adapter() {
|
|
||||||
@Override
|
|
||||||
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
|
|
||||||
final String description = e.getDescription();
|
|
||||||
if ("#ide".equals(description)) {
|
|
||||||
VimPlugin.getKey().getSavedShortcutConflicts().put(keyStroke, ShortcutOwner.IDE);
|
|
||||||
notification.expire();
|
|
||||||
}
|
|
||||||
else if ("#settings".equals(description)) {
|
|
||||||
ShowSettingsUtil.getInstance().editConfigurable((Project)null, new VimEmulationConfigurable());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
final Notification notification = new Notification(VimPlugin.IDEAVIM_NOTIFICATION_ID,
|
|
||||||
VimPlugin.IDEAVIM_NOTIFICATION_TITLE,
|
|
||||||
message,
|
|
||||||
NotificationType.INFORMATION,
|
|
||||||
listener);
|
|
||||||
notification.notify(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEnabled(@NotNull AnActionEvent e) {
|
private boolean isEnabled(@NotNull AnActionEvent e) {
|
||||||
if (VimPlugin.isEnabled()) {
|
if (!VimPlugin.isEnabled()) return false;
|
||||||
final Editor editor = getEditor(e);
|
|
||||||
final KeyStroke keyStroke = getKeyStroke(e);
|
final Editor editor = getEditor(e);
|
||||||
if (editor != null && keyStroke != null) {
|
final KeyStroke keyStroke = getKeyStroke(e);
|
||||||
final int keyCode = keyStroke.getKeyCode();
|
if (editor != null && keyStroke != null) {
|
||||||
if (LookupManager.getActiveLookup(editor) != null) {
|
// Workaround for smart step into
|
||||||
return isExitInsertMode(keyStroke);
|
final Key<?> SMART_STEP_INPLACE_DATA = Key.findKeyByName("SMART_STEP_INPLACE_DATA");
|
||||||
|
if (SMART_STEP_INPLACE_DATA != null && editor.getUserData(SMART_STEP_INPLACE_DATA) != null) return false;
|
||||||
|
|
||||||
|
final int keyCode = keyStroke.getKeyCode();
|
||||||
|
if (LookupManager.getActiveLookup(editor) != null && !passCommandToVimWithLookup(keyStroke)) {
|
||||||
|
return isEnabledForLookup(keyStroke);
|
||||||
|
}
|
||||||
|
if (keyCode == VK_ESCAPE) {
|
||||||
|
return isEnabledForEscape(editor);
|
||||||
|
}
|
||||||
|
if (CommandStateHelper.inInsertMode(editor)) {
|
||||||
|
// XXX: <Tab> won't be recorded in macros
|
||||||
|
if (keyCode == VK_TAB) {
|
||||||
|
VimPlugin.getChange().tabAction = true;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
if (CommandState.inInsertMode(editor)) {
|
// Debug watch, Python console, etc.
|
||||||
// XXX: <Tab> won't be recorded in macros
|
if (NON_FILE_EDITOR_KEYS.contains(keyStroke) && !EditorHelper.isFileEditor(editor)) {
|
||||||
if (keyCode == VK_TAB) {
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// Debug watch, Python console, etc.
|
|
||||||
if (NON_FILE_EDITOR_KEYS.contains(keyStroke) && !EditorData.isFileEditor(editor)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (VIM_ONLY_EDITOR_KEYS.contains(keyStroke)) {
|
}
|
||||||
return true;
|
if (VIM_ONLY_EDITOR_KEYS.contains(keyStroke)) {
|
||||||
}
|
return true;
|
||||||
final Map<KeyStroke, ShortcutOwner> savedShortcutConflicts = VimPlugin.getKey().getSavedShortcutConflicts();
|
}
|
||||||
final ShortcutOwner owner = savedShortcutConflicts.get(keyStroke);
|
final Map<KeyStroke, ShortcutOwner> savedShortcutConflicts = VimPlugin.getKey().getSavedShortcutConflicts();
|
||||||
if (owner == ShortcutOwner.VIM) {
|
final ShortcutOwner owner = savedShortcutConflicts.get(keyStroke);
|
||||||
return true;
|
if (owner == ShortcutOwner.VIM) {
|
||||||
}
|
return true;
|
||||||
else if (owner == ShortcutOwner.IDE) {
|
}
|
||||||
return !isShortcutConflict(keyStroke);
|
else if (owner == ShortcutOwner.IDE) {
|
||||||
}
|
return !isShortcutConflict(keyStroke);
|
||||||
else {
|
}
|
||||||
if (isShortcutConflict(keyStroke)) {
|
else {
|
||||||
savedShortcutConflicts.put(keyStroke, ShortcutOwner.UNDEFINED);
|
if (isShortcutConflict(keyStroke)) {
|
||||||
}
|
savedShortcutConflicts.put(keyStroke, ShortcutOwner.UNDEFINED);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isExitInsertMode(@NotNull KeyStroke keyStroke) {
|
private boolean passCommandToVimWithLookup(@NotNull KeyStroke keyStroke) {
|
||||||
|
final ListOption popupActions = OptionsManager.INSTANCE.getLookupActions();
|
||||||
|
final List<String> values = popupActions.values();
|
||||||
|
if (values == null) return false;
|
||||||
|
|
||||||
|
return values.stream().anyMatch(actionId -> {
|
||||||
|
final AnAction action = ActionManager.getInstance().getAction(actionId);
|
||||||
|
if (!(action instanceof VimCommandAction)) return false;
|
||||||
|
return ((VimCommandAction)action).getKeyStrokesSet().stream()
|
||||||
|
.anyMatch(ks -> !ks.isEmpty() && ks.get(0).equals(keyStroke));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isEnabledForEscape(@NotNull Editor editor) {
|
||||||
|
final CommandState.Mode mode = CommandState.getInstance(editor).getMode();
|
||||||
|
return isPrimaryEditor(editor) || (EditorHelper.isFileEditor(editor) && mode != CommandState.Mode.COMMAND);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Checks if the editor is a primary editor in the main editing area.
|
||||||
|
*/
|
||||||
|
private boolean isPrimaryEditor(@NotNull Editor editor) {
|
||||||
|
final Project project = editor.getProject();
|
||||||
|
if (project == null) return false;
|
||||||
|
final FileEditorManagerEx fileEditorManager = FileEditorManagerEx.getInstanceEx(project);
|
||||||
|
return StreamEx.of(fileEditorManager.getAllEditors())
|
||||||
|
.anyMatch(fileEditor -> editor.equals(EditorUtil.getEditorEx(fileEditor)));
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isEnabledForLookup(@NotNull KeyStroke keyStroke) {
|
||||||
for (List<KeyStroke> keys : InsertExitModeAction.getInstance().getKeyStrokesSet()) {
|
for (List<KeyStroke> keys : InsertExitModeAction.getInstance().getKeyStrokesSet()) {
|
||||||
// XXX: Currently we cannot handle <C-\><C-N> because of the importance of <C-N> for the IDE on Linux
|
// XXX: Currently we cannot handle <C-\><C-N> because of the importance of <C-N> for the IDE on Linux
|
||||||
if (keys.size() == 1 && keyStroke.equals(keys.get(0))) {
|
if (keys.size() == 1 && keyStroke.equals(keys.get(0))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//noinspection RedundantIfStatement
|
||||||
|
if (keyStroke.equals(KeyStroke.getKeyStroke(VK_BACK_SPACE, 0))) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -207,7 +219,7 @@ public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
private static List<KeyStroke> getKeyStrokes(int keyCode, @NotNull int... modifiers) {
|
private static List<KeyStroke> getKeyStrokes(int keyCode, @NotNull int... modifiers) {
|
||||||
final List<KeyStroke> keyStrokes = new ArrayList<KeyStroke>();
|
final List<KeyStroke> keyStrokes = new ArrayList<>();
|
||||||
for (int modifier : modifiers) {
|
for (int modifier : modifiers) {
|
||||||
keyStrokes.add(KeyStroke.getKeyStroke(keyCode, modifier));
|
keyStrokes.add(KeyStroke.getKeyStroke(keyCode, modifier));
|
||||||
}
|
}
|
||||||
|
|||||||
108
src/com/maddyhome/idea/vim/action/change/OperatorAction.java
Normal file
108
src/com/maddyhome/idea/vim/action/change/OperatorAction.java
Normal file
@@ -0,0 +1,108 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action.change;
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.*;
|
||||||
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
|
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.helper.MessageHelper;
|
||||||
|
import com.maddyhome.idea.vim.key.OperatorFunction;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author vlan
|
||||||
|
*/
|
||||||
|
final public class OperatorAction extends VimCommandAction {
|
||||||
|
@Contract(" -> new")
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
final OperatorFunction operatorFunction = VimPlugin.getKey().getOperatorFunction();
|
||||||
|
if (operatorFunction != null) {
|
||||||
|
final Argument argument = cmd.getArgument();
|
||||||
|
if (argument != null) {
|
||||||
|
final Command motion = argument.getMotion();
|
||||||
|
if (motion != null) {
|
||||||
|
final TextRange range = MotionGroup
|
||||||
|
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(),
|
||||||
|
cmd.getRawCount(), argument, true);
|
||||||
|
if (range != null) {
|
||||||
|
VimPlugin.getMark().setChangeMarks(editor, range);
|
||||||
|
final SelectionType selectionType = SelectionType.fromCommandFlags(motion.getFlags());
|
||||||
|
KeyHandler.getInstance().reset(editor);
|
||||||
|
return operatorFunction.apply(editor, context, selectionType);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
VimPlugin.showMessage(MessageHelper.message("E774"));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("g@");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,22 +20,45 @@ package com.maddyhome.idea.vim.action.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.UndoRedoHelper;
|
import com.maddyhome.idea.vim.helper.UndoRedoHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class RedoAction extends EditorAction {
|
import java.util.Set;
|
||||||
public RedoAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class RedoAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
return UndoRedoHelper.redo(context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("<C-R>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
return UndoRedoHelper.INSTANCE.redo(context);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,61 +20,88 @@ package com.maddyhome.idea.vim.action.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.KeyHandler;
|
import com.maddyhome.idea.vim.KeyHandler;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.command.CommandState;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class RepeatChangeAction extends EditorAction {
|
import java.util.Set;
|
||||||
public RepeatChangeAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class RepeatChangeAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
@Override
|
||||||
CommandState state = CommandState.getInstance(editor);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
Command cmd = state.getLastChangeCommand();
|
return parseKeysSet(".");
|
||||||
if (cmd != null) {
|
}
|
||||||
if (command.getRawCount() > 0) {
|
|
||||||
cmd.setCount(command.getCount());
|
@NotNull
|
||||||
Argument arg = cmd.getArgument();
|
@Override
|
||||||
if (arg != null) {
|
public Command.Type getType() {
|
||||||
Command mot = arg.getMotion();
|
return Command.Type.OTHER_WRITABLE;
|
||||||
if (mot != null) {
|
}
|
||||||
mot.setCount(0);
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||||
|
CommandState state = CommandState.getInstance(editor);
|
||||||
|
Command cmd = state.getLastChangeCommand();
|
||||||
|
|
||||||
|
if (cmd != null) {
|
||||||
|
if (command.getRawCount() > 0) {
|
||||||
|
cmd.setCount(command.getCount());
|
||||||
|
Argument arg = cmd.getArgument();
|
||||||
|
if (arg != null) {
|
||||||
|
Command mot = arg.getMotion();
|
||||||
|
if (mot != null) {
|
||||||
|
mot.setCount(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
Command save = state.getCommand();
|
||||||
Command save = state.getCommand();
|
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
||||||
state.setCommand(cmd);
|
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
||||||
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
|
||||||
char reg = VimPlugin.getRegister().getCurrentRegister();
|
|
||||||
VimPlugin.getRegister().selectRegister(state.getLastChangeRegister());
|
|
||||||
try {
|
|
||||||
KeyHandler.executeAction(cmd.getAction(), context);
|
|
||||||
}
|
|
||||||
catch (Exception e) {
|
|
||||||
// oops
|
|
||||||
}
|
|
||||||
state.popState();
|
|
||||||
if (save != null) {
|
|
||||||
state.setCommand(save);
|
|
||||||
}
|
|
||||||
state.saveLastChangeCommand(cmd);
|
|
||||||
VimPlugin.getRegister().selectRegister(reg);
|
|
||||||
|
|
||||||
return true;
|
state.setCommand(cmd);
|
||||||
|
state.pushState(CommandState.Mode.REPEAT, CommandState.SubMode.NONE, MappingMode.NORMAL);
|
||||||
|
char reg = VimPlugin.getRegister().getCurrentRegister();
|
||||||
|
VimPlugin.getRegister().selectRegister(state.getLastChangeRegister());
|
||||||
|
try {
|
||||||
|
KeyHandler.executeAction(cmd.getAction(), context);
|
||||||
|
}
|
||||||
|
catch (Exception e) {
|
||||||
|
// oops
|
||||||
|
}
|
||||||
|
state.popState();
|
||||||
|
if (save != null) {
|
||||||
|
state.setCommand(save);
|
||||||
|
}
|
||||||
|
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar);
|
||||||
|
state.saveLastChangeCommand(cmd);
|
||||||
|
VimPlugin.getRegister().selectRegister(reg);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
};
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,29 +20,52 @@ package com.maddyhome.idea.vim.action.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.CommandParser;
|
import com.maddyhome.idea.vim.ex.CommandParser;
|
||||||
import com.maddyhome.idea.vim.ex.ExException;
|
import com.maddyhome.idea.vim.ex.ExException;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class RepeatExCommandAction extends EditorAction {
|
import java.util.Set;
|
||||||
public RepeatExCommandAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class RepeatExCommandAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
@Override
|
||||||
int count = command.getCount();
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
try {
|
return parseKeysSet("@:");
|
||||||
return CommandParser.getInstance().processLastCommand(editor, context, count);
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_WRITABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command command) {
|
||||||
|
int count = command.getCount();
|
||||||
|
try {
|
||||||
|
return CommandParser.getInstance().processLastCommand(editor, context, count);
|
||||||
|
}
|
||||||
|
catch (ExException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (ExException e) {
|
};
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,22 +20,45 @@ package com.maddyhome.idea.vim.action.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.UndoRedoHelper;
|
import com.maddyhome.idea.vim.helper.UndoRedoHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class UndoAction extends EditorAction {
|
import java.util.Set;
|
||||||
public UndoAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class UndoAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
return UndoRedoHelper.undo(context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("u", "<Undo>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
return UndoRedoHelper.INSTANCE.undo(context);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,56 +19,68 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class AutoIndentLinesVisualAction extends VimCommandAction {
|
final public class AutoIndentLinesVisualAction extends VimCommandAction {
|
||||||
public AutoIndentLinesVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
@Override
|
|
||||||
protected boolean execute(@NotNull Editor editor,
|
|
||||||
@NotNull DataContext context,
|
|
||||||
@NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
VimPlugin.getChange().autoIndentLines(context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("=");
|
return parseKeysSet("=");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_FORCE_LINEWISE | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,27 +19,72 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeCaseLowerMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeCaseLowerMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeCaseLowerMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null &&
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount, CharacterHelper.CASE_LOWER,
|
return parseKeysSet("gu");
|
||||||
argument);
|
}
|
||||||
}
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange()
|
||||||
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_LOWER, argument);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,55 +19,71 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.psi.impl.source.tree.injected.InjectedLanguageUtil;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
|
import com.maddyhome.idea.vim.helper.HelperKt;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeCaseLowerVisualAction extends VimCommandAction {
|
final public class ChangeCaseLowerVisualAction extends VimCommandAction {
|
||||||
public ChangeCaseLowerVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final Editor topLevelEditor = InjectedLanguageUtil.getTopLevelEditor(editor);
|
|
||||||
return VimPlugin.getChange().changeCaseRange(topLevelEditor, range, CharacterHelper.CASE_LOWER);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final Editor topLevelEditor = HelperKt.getTopLevelEditor(editor);
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(topLevelEditor, caret, range.toVimTextRange(false), CharacterHelper.CASE_LOWER);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("u");
|
return parseKeysSet("u");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,55 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class ChangeCaseToggleCharacterAction extends EditorAction {
|
import java.util.Set;
|
||||||
public ChangeCaseToggleCharacterAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class ChangeCaseToggleCharacterAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().changeCaseToggleCharacter(editor, count);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("~");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,26 +19,72 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeCaseToggleMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeCaseToggleMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeCaseToggleMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null && VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount,
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
CharacterHelper.CASE_TOGGLE, argument);
|
return parseKeysSet("g~");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange()
|
||||||
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_TOGGLE, argument);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,53 +19,69 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeCaseToggleVisualAction extends VimCommandAction {
|
final public class ChangeCaseToggleVisualAction extends VimCommandAction {
|
||||||
public ChangeCaseToggleVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return VimPlugin.getChange().changeCaseRange(editor, range, CharacterHelper.CASE_TOGGLE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("~");
|
return parseKeysSet("~");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,26 +19,72 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeCaseUpperMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeCaseUpperMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeCaseUpperMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null && VimPlugin.getChange().changeCaseMotion(editor, context, count, rawCount,
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
CharacterHelper.CASE_UPPER, argument);
|
return parseKeysSet("gU");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange()
|
||||||
|
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_UPPER, argument);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,53 +19,69 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeCaseUpperVisualAction extends VimCommandAction {
|
final public class ChangeCaseUpperVisualAction extends VimCommandAction {
|
||||||
public ChangeCaseUpperVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return VimPlugin.getChange().changeCaseRange(editor, range, CharacterHelper.CASE_UPPER);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("U");
|
return parseKeysSet("U");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,69 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeCharacterAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeCharacterAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeCharacterAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null && VimPlugin.getChange().changeCharacter(editor, count, argument.getCharacter());
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("r");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.DIGRAPH;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.getCharacter());
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,63 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeCharactersAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeCharactersAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeCharactersAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().changeCharacters(editor, context, count);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("s");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeCharacters(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,63 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeEndOfLineAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeEndOfLineAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeEndOfLineAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().changeEndOfLine(editor, context, count);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("C");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeEndOfLine(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,26 +20,56 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.LineRange;
|
import com.maddyhome.idea.vim.ex.LineRange;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class ChangeLastGlobalSearchReplaceAction extends EditorAction {
|
import java.util.Set;
|
||||||
public ChangeLastGlobalSearchReplaceAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class ChangeLastGlobalSearchReplaceAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return VimPlugin.getSearch().searchAndReplace(editor, range, "s", "//~/&");
|
return parseKeysSet("g&");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_WRITABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
final LineRange range = new LineRange(0, EditorHelper.getLineCount(editor) - 1);
|
||||||
|
return VimPlugin.getSearch()
|
||||||
|
.searchAndReplace(editor, editor.getCaretModel().getPrimaryCaret(), range, "s", "//~/&");
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,27 +19,63 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.ex.LineRange;
|
import com.maddyhome.idea.vim.ex.LineRange;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class ChangeLastSearchReplaceAction extends EditorAction {
|
import java.util.Set;
|
||||||
public ChangeLastSearchReplaceAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class ChangeLastSearchReplaceAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
int line = editor.getCaretModel().getLogicalPosition().line;
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
LineRange range = new LineRange(line, line);
|
return parseKeysSet("&");
|
||||||
return VimPlugin.getSearch().searchAndReplace(editor, range, "s", "//~/");
|
}
|
||||||
}
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.OTHER_WRITABLE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
boolean result = true;
|
||||||
|
for (Caret caret : editor.getCaretModel().getAllCarets()) {
|
||||||
|
final int line = caret.getLogicalPosition().line;
|
||||||
|
if (!VimPlugin.getSearch().searchAndReplace(editor, caret, new LineRange(line, line), "s", "//~/")) {
|
||||||
|
result = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,63 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeLineAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeLineAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeLineAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().changeLine(editor, context, count);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("cc", "S");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_NO_REPEAT, CommandFlags.FLAG_ALLOW_MID_COUNT, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeLine(editor, caret, count, context);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,70 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null && VimPlugin.getChange().changeMotion(editor, context, count, rawCount, argument);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("c");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND, CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2014 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
|
||||||
import com.intellij.openapi.editor.Editor;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class ChangeNumberDecAction extends EditorAction {
|
|
||||||
public ChangeNumberDecAction() {
|
|
||||||
super(new Handler());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeNumber(editor, -count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
/*
|
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
|
||||||
* Copyright (C) 2003-2014 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 <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.change.change;
|
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
|
||||||
import com.intellij.openapi.editor.Editor;
|
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*/
|
|
||||||
public class ChangeNumberIncAction extends EditorAction {
|
|
||||||
public ChangeNumberIncAction() {
|
|
||||||
super(new Handler());
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
|
||||||
return VimPlugin.getChange().changeNumber(editor, count);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,23 +20,61 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class ChangeReplaceAction extends EditorAction {
|
import java.util.List;
|
||||||
public ChangeReplaceAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class ChangeReplaceAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().changeReplace(editor, context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("R");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().changeReplace(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,54 +19,68 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeVisualAction extends VimCommandAction {
|
final public class ChangeVisualAction extends VimCommandAction {
|
||||||
public ChangeVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final SelectionType type = range.isMultiple() ? SelectionType.BLOCK_WISE : SelectionType.CHARACTER_WISE;
|
|
||||||
return VimPlugin.getChange().changeRange(editor, context, range, type);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, range.toVimTextRange(false), range.getType(), context);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("c", "s");
|
return parseKeysSet("c", "s");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MULTIKEY_UNDO | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,60 +19,77 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeVisualCharacterAction extends VimCommandAction {
|
final public class ChangeVisualCharacterAction extends VimCommandAction {
|
||||||
public ChangeVisualCharacterAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final Argument argument = cmd.getArgument();
|
|
||||||
return argument != null && VimPlugin.getChange().changeCharacterRange(editor, range, argument.getCharacter());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final Argument argument = cmd.getArgument();
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange().changeCharacterRange(editor, range.toVimTextRange(false), argument.getCharacter());
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("r");
|
return parseKeysSet("r");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public Command.Type getType() {
|
||||||
return Command.Type.CHANGE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Argument.Type getArgumentType() {
|
final public Argument.Type getArgumentType() {
|
||||||
return Argument.Type.DIGRAPH;
|
return Argument.Type.DIGRAPH;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public int getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.FLAG_ALLOW_DIGRAPH | Command.FLAG_EXIT_VISUAL;
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,56 +19,74 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeVisualLinesAction extends VimCommandAction {
|
final public class ChangeVisualLinesAction extends VimCommandAction {
|
||||||
public ChangeVisualLinesAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().changeRange(editor, context, lineRange, SelectionType.LINE_WISE);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final TextRange textRange = range.toVimTextRange(true);
|
||||||
|
|
||||||
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("R", "S");
|
return parseKeysSet("R", "S");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_MULTIKEY_UNDO | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,69 +19,86 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ChangeVisualLinesEndAction extends VimCommandAction {
|
final public class ChangeVisualLinesEndAction extends VimCommandAction {
|
||||||
public ChangeVisualLinesEndAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
@Override
|
||||||
@NotNull TextRange range) {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
if (range.isMultiple()) {
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
final int[] starts = range.getStartOffsets();
|
@Override
|
||||||
final int[] ends = range.getEndOffsets();
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
TextRange vimTextRange = range.toVimTextRange(true);
|
||||||
|
if (range.getType() == SelectionType.BLOCK_WISE && vimTextRange.isMultiple()) {
|
||||||
|
final int[] starts = vimTextRange.getStartOffsets();
|
||||||
|
final int[] ends = vimTextRange.getEndOffsets();
|
||||||
for (int i = 0; i < starts.length; i++) {
|
for (int i = 0; i < starts.length; i++) {
|
||||||
if (ends[i] > starts[i]) {
|
if (ends[i] > starts[i]) {
|
||||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final TextRange blockRange = new TextRange(starts, ends);
|
final TextRange blockRange = new TextRange(starts, ends);
|
||||||
return VimPlugin.getChange().changeRange(editor, context, blockRange, SelectionType.BLOCK_WISE);
|
return VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE, context);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
||||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
||||||
return VimPlugin.getChange().changeRange(editor, context, lineRange, SelectionType.LINE_WISE);
|
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("C");
|
return parseKeysSet("C");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_MULTIKEY_UNDO | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,24 +20,47 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class FilterCountLinesAction extends EditorAction {
|
import java.util.Set;
|
||||||
public FilterCountLinesAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class FilterCountLinesAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("!!");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -21,52 +21,91 @@ package com.maddyhome.idea.vim.action.change.change;
|
|||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.LogicalPosition;
|
import com.intellij.openapi.editor.LogicalPosition;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
import com.maddyhome.idea.vim.group.MotionGroup;
|
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class FilterMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public FilterMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class FilterMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
final Argument argument = cmd.getArgument();
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
if (argument == null) {
|
return parseKeysSet("!");
|
||||||
return false;
|
}
|
||||||
}
|
|
||||||
TextRange range = MotionGroup.getMotionRange(editor, context, cmd.getCount(), cmd.getRawCount(), argument, false);
|
|
||||||
if (range == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
LogicalPosition current = editor.getCaretModel().getLogicalPosition();
|
@NotNull
|
||||||
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
|
@Override
|
||||||
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
|
public Command.Type getType() {
|
||||||
if (current.line != start.line) {
|
return Command.Type.CHANGE;
|
||||||
MotionGroup.moveCaret(editor, range.getStartOffset());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
int count;
|
@NotNull
|
||||||
if (start.line < end.line) {
|
@Override
|
||||||
count = end.line - start.line + 1;
|
public Argument.Type getArgumentType() {
|
||||||
}
|
return Argument.Type.MOTION;
|
||||||
else {
|
}
|
||||||
count = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
Command command = new Command(count, null, null, Command.Type.UNDEFINED, 0);
|
@NotNull
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, command);
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
final Argument argument = cmd.getArgument();
|
||||||
|
if (argument == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
TextRange range = MotionGroup
|
||||||
|
.getMotionRange(editor, editor.getCaretModel().getPrimaryCaret(), context, cmd.getCount(), cmd.getRawCount(),
|
||||||
|
argument, false);
|
||||||
|
if (range == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
LogicalPosition current = editor.getCaretModel().getLogicalPosition();
|
||||||
|
LogicalPosition start = editor.offsetToLogicalPosition(range.getStartOffset());
|
||||||
|
LogicalPosition end = editor.offsetToLogicalPosition(range.getEndOffset());
|
||||||
|
if (current.line != start.line) {
|
||||||
|
MotionGroup.moveCaret(editor, editor.getCaretModel().getPrimaryCaret(), range.getStartOffset());
|
||||||
|
}
|
||||||
|
|
||||||
|
int count;
|
||||||
|
if (start.line < end.line) {
|
||||||
|
count = end.line - start.line + 1;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
count = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
Command command = new Command(count, null, null, Command.Type.UNDEFINED, EnumSet.noneOf(CommandFlags.class));
|
||||||
|
VimPlugin.getProcess().startFilterCommand(editor, context, command);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -23,48 +23,58 @@ import com.intellij.openapi.editor.Editor;
|
|||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class FilterVisualLinesAction extends VimCommandAction {
|
final public class FilterVisualLinesAction extends VimCommandAction {
|
||||||
public FilterVisualLinesAction() {
|
@Contract(" -> new")
|
||||||
super(new EditorActionHandlerBase() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
|
||||||
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
|
||||||
VimPlugin.getMotion().resetVisual(editor, true);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VimActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
||||||
|
VimPlugin.getProcess().startFilterCommand(editor, context, cmd);
|
||||||
|
VimPlugin.getVisualMotion().resetVisual(editor);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("!");
|
return parseKeysSet("!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,54 +19,68 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.change;
|
package com.maddyhome.idea.vim.action.change.change;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class ReformatCodeVisualAction extends VimCommandAction {
|
final public class ReformatCodeVisualAction extends VimCommandAction {
|
||||||
public ReformatCodeVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
@Override
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
VimPlugin.getChange().reformatCode(context);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
VimPlugin.getChange().reformatCode(editor, range);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("gq");
|
return parseKeysSet("gq");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.CHANGE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_FORCE_LINEWISE | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,55 +16,58 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.copy;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author vlan
|
|
||||||
*/
|
|
||||||
public class PutVisualTextAction extends VimCommandAction {
|
|
||||||
public PutVisualTextAction() {
|
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return VimPlugin.getCopy().putVisualRange(editor, context, range, cmd.getCount(), true, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class ChangeNumberDecAction extends VimCommandAction {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("p", "P");
|
return parseKeysSet("<C-X>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
public Command.Type getType() {
|
||||||
return Command.Type.PASTE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public int getFlags() {
|
protected VimActionHandler makeActionHandler() {
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeNumber(editor, caret, -count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -16,55 +16,58 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.maddyhome.idea.vim.action.copy;
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
|
||||||
* @author vlan
|
|
||||||
*/
|
|
||||||
public class PutVisualTextMoveCursorAction extends VimCommandAction {
|
|
||||||
public PutVisualTextMoveCursorAction() {
|
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return VimPlugin.getCopy().putVisualRange(editor, context, range, cmd.getCount(), true, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public class ChangeNumberIncAction extends VimCommandAction {
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("gp", "gP");
|
return parseKeysSet("<C-A>");
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
public Command.Type getType() {
|
||||||
return Command.Type.PASTE;
|
return Command.Type.CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public int getFlags() {
|
protected VimActionHandler makeActionHandler() {
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().changeNumber(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
final public class ChangeVisualNumberAvalancheDecAction extends VimCommandAction {
|
||||||
|
@Contract(" -> new")
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.V;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("g<C-X>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
final public class ChangeVisualNumberAvalancheIncAction extends VimCommandAction {
|
||||||
|
@Contract(" -> new")
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.V;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("g<C-A>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
final public class ChangeVisualNumberDecAction extends VimCommandAction {
|
||||||
|
@Contract(" -> new")
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), -cmd.getCount(), false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.V;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("<C-X>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,83 @@
|
|||||||
|
/*
|
||||||
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
|
* Copyright (C) 2003-2019 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 <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package com.maddyhome.idea.vim.action.change.change.number;
|
||||||
|
|
||||||
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
final public class ChangeVisualNumberIncAction extends VimCommandAction {
|
||||||
|
@Contract(" -> new")
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.changeNumberVisualMode(editor, caret, range.toVimTextRange(false), cmd.getCount(), false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.V;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("<C-A>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.CHANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,55 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteCharacterAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteCharacterAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteCharacterAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, 1, false);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("<DEL>");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().deleteCharacter(editor, caret, 1, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,55 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteCharacterLeftAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteCharacterLeftAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteCharacterLeftAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, -count, false);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("X");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().deleteCharacter(editor, caret, -count, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,55 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteCharacterRightAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteCharacterRightAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteCharacterRightAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().deleteCharacter(editor, count, false);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("x");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().deleteCharacter(editor, caret, count, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,55 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteEndOfLineAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteEndOfLineAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteEndOfLineAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().deleteEndOfLine(editor, count);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("D");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().deleteEndOfLine(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,27 +20,65 @@ package com.maddyhome.idea.vim.action.change.delete;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteJoinLinesAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteJoinLinesAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteJoinLinesAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
if (editor.isOneLineMode()) {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return false;
|
return parseKeysSet("gJ");
|
||||||
}
|
}
|
||||||
|
|
||||||
return VimPlugin.getChange().deleteJoinLines(editor, count, false);
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
||||||
|
}
|
||||||
|
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, false)) res.set(false);
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,27 +20,66 @@ package com.maddyhome.idea.vim.action.change.delete;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class DeleteJoinLinesSpacesAction extends EditorAction {
|
import java.util.Set;
|
||||||
public DeleteJoinLinesSpacesAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class DeleteJoinLinesSpacesAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
if (editor.isOneLineMode()) {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return false;
|
return parseKeysSet("J");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
return VimPlugin.getChange().joinViaIdeaByCount(editor, context, count);
|
||||||
|
}
|
||||||
|
VimPlugin.getEditor().notifyIdeaJoin(editor.getProject());
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!VimPlugin.getChange().deleteJoinLines(editor, caret, count, true)) res.set(false);
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
return VimPlugin.getChange().deleteJoinLines(editor, count, true);
|
};
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,52 +19,87 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class DeleteJoinVisualLinesAction extends VimCommandAction {
|
final public class DeleteJoinVisualLinesAction extends VimCommandAction {
|
||||||
public DeleteJoinVisualLinesAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, range, false);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!caret.isValid()) return;
|
||||||
|
final VimSelection range = caretsAndSelections.get(caret);
|
||||||
|
if (range == null) return;
|
||||||
|
|
||||||
|
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), false)) {
|
||||||
|
res.set(false);
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("gJ");
|
return parseKeysSet("gJ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public Command.Type getType() {
|
||||||
return Command.Type.DELETE;
|
return Command.Type.DELETE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public int getFlags() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,52 +19,87 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
|
import com.intellij.openapi.util.Ref;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class DeleteJoinVisualLinesSpacesAction extends VimCommandAction {
|
final public class DeleteJoinVisualLinesSpacesAction extends VimCommandAction {
|
||||||
public DeleteJoinVisualLinesSpacesAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
return !editor.isOneLineMode() && VimPlugin.getChange().deleteJoinRange(editor, range, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.SingleExecution() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean executeForAllCarets(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull Map<Caret, ? extends VimSelection> caretsAndSelections) {
|
||||||
|
if (editor.isOneLineMode()) return false;
|
||||||
|
|
||||||
|
if (OptionsManager.INSTANCE.getIdeajoin().isSet()) {
|
||||||
|
VimPlugin.getChange().joinViaIdeaBySelections(editor, context, caretsAndSelections);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ref<Boolean> res = Ref.create(true);
|
||||||
|
editor.getCaretModel().runForEachCaret(caret -> {
|
||||||
|
if (!caret.isValid()) return;
|
||||||
|
final VimSelection range = caretsAndSelections.get(caret);
|
||||||
|
if (range == null) return;
|
||||||
|
|
||||||
|
if (!VimPlugin.getChange().deleteJoinRange(editor, caret, range.toVimTextRange(true).normalize(), true)) {
|
||||||
|
res.set(false);
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
|
return res.get();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("J");
|
return parseKeysSet("J");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.DELETE;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,67 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class DeleteLineAction extends EditorAction {
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
||||||
|
public class DeleteLineAction extends VimCommandAction {
|
||||||
public DeleteLineAction() {
|
public DeleteLineAction() {
|
||||||
super(new Handler());
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return VimPlugin.getChange().deleteLine(editor, count);
|
public Set<MappingMode> getMappingModes() {
|
||||||
}
|
return MappingMode.N;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("dd");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_ALLOW_MID_COUNT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return VimPlugin.getChange().deleteLine(editor, caret, count);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,24 +19,70 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class DeleteMotionAction extends EditorAction {
|
import java.util.List;
|
||||||
public DeleteMotionAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class DeleteMotionAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
return argument != null && VimPlugin.getChange().deleteMotion(editor, context, count, rawCount, argument, false);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
}
|
return parseKeysSet("d");
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Argument.Type getArgumentType() {
|
||||||
|
return Argument.Type.MOTION;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_OP_PEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
return argument != null &&
|
||||||
|
VimPlugin.getChange().deleteMotion(editor, caret, context, count, rawCount, argument, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,63 +19,69 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class DeleteVisualAction extends VimCommandAction {
|
final public class DeleteVisualAction extends VimCommandAction {
|
||||||
public DeleteVisualAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
|
||||||
if (mode == CommandState.SubMode.VISUAL_LINE) {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.fromSubMode(mode), false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, range, SelectionType.fromSubMode(mode), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
SelectionType selectionType = range.getType();
|
||||||
|
return VimPlugin.getChange().deleteRange(editor, caret, range.toVimTextRange(false), selectionType, false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("d", "x", "<Del>");
|
return parseKeysSet("d", "x", "<Del>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.DELETE;
|
return EnumSet.of(CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,63 +19,77 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.*;
|
||||||
import com.maddyhome.idea.vim.command.CommandState;
|
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class DeleteVisualLinesAction extends VimCommandAction {
|
final public class DeleteVisualLinesAction extends VimCommandAction {
|
||||||
public DeleteVisualLinesAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
|
||||||
@NotNull TextRange range) {
|
|
||||||
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
|
||||||
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, range, SelectionType.fromSubMode(mode), false);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
|
||||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
|
||||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.LINE_WISE, false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
final CommandState.SubMode mode = CommandState.getInstance(editor).getSubMode();
|
||||||
|
final TextRange textRange = range.toVimTextRange(false);
|
||||||
|
if (mode == CommandState.SubMode.VISUAL_BLOCK) {
|
||||||
|
return VimPlugin.getChange()
|
||||||
|
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), textRange,
|
||||||
|
SelectionType.fromSubMode(mode), false);
|
||||||
|
} else {
|
||||||
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, textRange.getStartOffset()),
|
||||||
|
EditorHelper.getLineEndForOffset(editor, textRange.getEndOffset()) + 1);
|
||||||
|
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("X");
|
return parseKeysSet("X");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.DELETE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,69 +19,87 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.delete;
|
package com.maddyhome.idea.vim.action.change.delete;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.command.SelectionType;
|
import com.maddyhome.idea.vim.command.SelectionType;
|
||||||
import com.maddyhome.idea.vim.common.TextRange;
|
import com.maddyhome.idea.vim.common.TextRange;
|
||||||
|
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler;
|
||||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author vlan
|
* @author vlan
|
||||||
*/
|
*/
|
||||||
public class DeleteVisualLinesEndAction extends VimCommandAction {
|
final public class DeleteVisualLinesEndAction extends VimCommandAction {
|
||||||
public DeleteVisualLinesEndAction() {
|
@Contract(" -> new")
|
||||||
super(new VisualOperatorActionHandler() {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd,
|
@Override
|
||||||
@NotNull TextRange range) {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
if (range.isMultiple()) {
|
return new VisualOperatorActionHandler.ForEachCaret() {
|
||||||
final int[] starts = range.getStartOffsets();
|
@Override
|
||||||
final int[] ends = range.getEndOffsets();
|
public boolean executeAction(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
@NotNull Command cmd,
|
||||||
|
@NotNull VimSelection range) {
|
||||||
|
TextRange vimTextRange = range.toVimTextRange(true);
|
||||||
|
if (range.getType() == SelectionType.BLOCK_WISE) {
|
||||||
|
final int[] starts = vimTextRange.getStartOffsets();
|
||||||
|
final int[] ends = vimTextRange.getEndOffsets();
|
||||||
for (int i = 0; i < starts.length; i++) {
|
for (int i = 0; i < starts.length; i++) {
|
||||||
if (ends[i] > starts[i]) {
|
if (ends[i] > starts[i]) {
|
||||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
final TextRange blockRange = new TextRange(starts, ends);
|
final TextRange blockRange = new TextRange(starts, ends);
|
||||||
return VimPlugin.getChange().deleteRange(editor, blockRange, SelectionType.BLOCK_WISE, false);
|
return VimPlugin.getChange()
|
||||||
|
.deleteRange(editor, editor.getCaretModel().getPrimaryCaret(), blockRange, SelectionType.BLOCK_WISE, false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, range.getStartOffset()),
|
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
||||||
EditorHelper.getLineEndForOffset(editor, range.getEndOffset()) + 1);
|
EditorHelper.getLineEndForOffset(editor, vimTextRange.getEndOffset()) + 1);
|
||||||
return VimPlugin.getChange().deleteRange(editor, lineRange, SelectionType.LINE_WISE, false);
|
return VimPlugin.getChange().deleteRange(editor, caret, lineRange, SelectionType.LINE_WISE, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.V;
|
return MappingMode.V;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("D");
|
return parseKeysSet("D");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.DELETE;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.DELETE;
|
return EnumSet.of(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MOT_LINEWISE | Command.FLAG_EXIT_VISUAL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,25 +20,61 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class InsertAfterCursorAction extends EditorAction {
|
import java.util.List;
|
||||||
public InsertAfterCursorAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class InsertAfterCursorAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
VimPlugin.getChange().insertAfterCursor(editor, context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("a");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().insertAfterCursor(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,25 +20,61 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class InsertAfterLineEndAction extends EditorAction {
|
import java.util.List;
|
||||||
public InsertAfterLineEndAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class InsertAfterLineEndAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("A");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().insertAfterLineEnd(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,25 +20,61 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class InsertAtPreviousInsertAction extends EditorAction {
|
import java.util.List;
|
||||||
public InsertAtPreviousInsertAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class InsertAtPreviousInsertAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
VimPlugin.getChange().insertAtPreviousInsert(editor, context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("gi");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().insertAtPreviousInsert(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,46 +24,57 @@ import com.maddyhome.idea.vim.VimPlugin;
|
|||||||
import com.maddyhome.idea.vim.action.VimCommandAction;
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
import com.maddyhome.idea.vim.command.MappingMode;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
|
import org.jetbrains.annotations.Contract;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import java.util.EnumSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
public class InsertBeforeCursorAction extends VimCommandAction {
|
final public class InsertBeforeCursorAction extends VimCommandAction {
|
||||||
public InsertBeforeCursorAction() {
|
@Contract(" -> new")
|
||||||
super(new ChangeEditorActionHandler() {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount,
|
@Override
|
||||||
@Nullable Argument argument) {
|
final protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
final public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
VimPlugin.getChange().insertBeforeCursor(editor, context);
|
VimPlugin.getChange().insertBeforeCursor(editor, context);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<MappingMode> getMappingModes() {
|
final public Set<MappingMode> getMappingModes() {
|
||||||
return MappingMode.N;
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return parseKeysSet("i", "<Insert>");
|
return parseKeysSet("i", "<Insert>");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Contract(pure = true)
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
final public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public Command.Type getType() {
|
final public EnumSet<CommandFlags> getFlags() {
|
||||||
return Command.Type.INSERT;
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getFlags() {
|
|
||||||
return Command.FLAG_MULTIKEY_UNDO;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -20,25 +20,61 @@ package com.maddyhome.idea.vim.action.change.insert;
|
|||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
import com.maddyhome.idea.vim.command.Argument;
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
|
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||||
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.EnumSet;
|
||||||
public class InsertBeforeFirstNonBlankAction extends EditorAction {
|
import java.util.List;
|
||||||
public InsertBeforeFirstNonBlankAction() {
|
import java.util.Set;
|
||||||
super(new Handler());
|
|
||||||
|
|
||||||
|
public class InsertBeforeFirstNonBlankAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.N;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends ChangeEditorActionHandler {
|
@NotNull
|
||||||
public boolean execute(@NotNull Editor editor, @NotNull DataContext context, int count, int rawCount, @Nullable Argument argument) {
|
@Override
|
||||||
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
|
return parseKeysSet("I");
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public EnumSet<CommandFlags> getFlags() {
|
||||||
|
return EnumSet.of(CommandFlags.FLAG_MULTIKEY_UNDO);
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.SingleExecution() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
VimPlugin.getChange().insertBeforeFirstNonBlank(editor, context);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,27 +19,59 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class InsertCharacterAboveCursorAction extends EditorAction {
|
import java.util.Set;
|
||||||
public InsertCharacterAboveCursorAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class InsertCharacterAboveCursorAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.I;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
if (editor.isOneLineMode()) {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return false;
|
return parseKeysSet("<C-Y>");
|
||||||
}
|
}
|
||||||
|
|
||||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, context, -1);
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
if (editor.isOneLineMode()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, -1);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/*
|
/*
|
||||||
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
* IdeaVim - Vim emulator for IDEs based on the IntelliJ platform
|
||||||
* Copyright (C) 2003-2014 The IdeaVim authors
|
* Copyright (C) 2003-2019 The IdeaVim authors
|
||||||
*
|
*
|
||||||
* This program is free software: you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -19,27 +19,59 @@
|
|||||||
package com.maddyhome.idea.vim.action.change.insert;
|
package com.maddyhome.idea.vim.action.change.insert;
|
||||||
|
|
||||||
import com.intellij.openapi.actionSystem.DataContext;
|
import com.intellij.openapi.actionSystem.DataContext;
|
||||||
|
import com.intellij.openapi.editor.Caret;
|
||||||
import com.intellij.openapi.editor.Editor;
|
import com.intellij.openapi.editor.Editor;
|
||||||
import com.intellij.openapi.editor.actionSystem.EditorAction;
|
|
||||||
import com.maddyhome.idea.vim.VimPlugin;
|
import com.maddyhome.idea.vim.VimPlugin;
|
||||||
|
import com.maddyhome.idea.vim.action.VimCommandAction;
|
||||||
|
import com.maddyhome.idea.vim.command.Argument;
|
||||||
import com.maddyhome.idea.vim.command.Command;
|
import com.maddyhome.idea.vim.command.Command;
|
||||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
import com.maddyhome.idea.vim.command.MappingMode;
|
||||||
|
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler;
|
||||||
|
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
/**
|
import javax.swing.*;
|
||||||
*/
|
import java.util.List;
|
||||||
public class InsertCharacterBelowCursorAction extends EditorAction {
|
import java.util.Set;
|
||||||
public InsertCharacterBelowCursorAction() {
|
|
||||||
super(new Handler());
|
|
||||||
|
public class InsertCharacterBelowCursorAction extends VimCommandAction {
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
public Set<MappingMode> getMappingModes() {
|
||||||
|
return MappingMode.I;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class Handler extends EditorActionHandlerBase {
|
@NotNull
|
||||||
protected boolean execute(@NotNull Editor editor, @NotNull DataContext context, @NotNull Command cmd) {
|
@Override
|
||||||
if (editor.isOneLineMode()) {
|
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||||
return false;
|
return parseKeysSet("<C-E>");
|
||||||
}
|
}
|
||||||
|
|
||||||
return VimPlugin.getChange().insertCharacterAroundCursor(editor, context, 1);
|
@NotNull
|
||||||
}
|
@Override
|
||||||
|
public Command.Type getType() {
|
||||||
|
return Command.Type.INSERT;
|
||||||
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
|
@Override
|
||||||
|
protected VimActionHandler makeActionHandler() {
|
||||||
|
return new ChangeEditorActionHandler.ForEachCaret() {
|
||||||
|
@Override
|
||||||
|
public boolean execute(@NotNull Editor editor,
|
||||||
|
@NotNull Caret caret,
|
||||||
|
@NotNull DataContext context,
|
||||||
|
int count,
|
||||||
|
int rawCount,
|
||||||
|
@Nullable Argument argument) {
|
||||||
|
if (editor.isOneLineMode()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return VimPlugin.getChange().insertCharacterAroundCursor(editor, caret, 1);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user