Compare commits
375 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c1ff6e1498 | ||
![]() |
50c04ce71c | ||
![]() |
bc6ff6bc8e | ||
![]() |
93bcf2a7e8 | ||
![]() |
c3b503adff | ||
![]() |
ecdcbdda10 | ||
![]() |
b97c9a5ed0 | ||
![]() |
84a6843a7b | ||
![]() |
17eed7467c | ||
![]() |
310ffc849c | ||
![]() |
3e6756160a | ||
![]() |
563e809a2d | ||
![]() |
86ec3f3bcd | ||
![]() |
b4e0ec282f | ||
![]() |
cbf7dfabcb | ||
![]() |
b8eb55d965 | ||
![]() |
30662a8110 | ||
![]() |
69a273982f | ||
![]() |
eef1b25e9f | ||
![]() |
622de851fe | ||
![]() |
8cecb61d28 | ||
![]() |
77d8d27dfa | ||
![]() |
340f259b17 | ||
![]() |
5cf68a7f06 | ||
![]() |
0ae5abcd0c | ||
![]() |
b6cecb2125 | ||
![]() |
3aa3a9c9a8 | ||
![]() |
2c11ed43e4 | ||
![]() |
be0bee672e | ||
![]() |
b695e3c646 | ||
![]() |
33840dc5cd | ||
![]() |
255f2f59fc | ||
![]() |
d7fca09f0a | ||
![]() |
917b77c8ad | ||
![]() |
a2cd8ec19c | ||
![]() |
6300d39065 | ||
![]() |
2457079724 | ||
![]() |
ba84e723e8 | ||
![]() |
bf75e75d6f | ||
![]() |
c3183a8bd7 | ||
![]() |
7c162fc7ed | ||
![]() |
529c5ac8d7 | ||
![]() |
60e619e45e | ||
![]() |
a89bdcdd3b | ||
![]() |
09fbdf5541 | ||
![]() |
0b517671cb | ||
![]() |
a15dc3ed60 | ||
![]() |
b7d60f4cb5 | ||
![]() |
82a331a940 | ||
![]() |
c31e688f11 | ||
![]() |
0c887027d3 | ||
![]() |
7c7df85d1a | ||
![]() |
a7c025d927 | ||
![]() |
424598b92f | ||
![]() |
dc713c477b | ||
![]() |
7e71edaee2 | ||
![]() |
3f8925cbb0 | ||
![]() |
5f9e24b314 | ||
![]() |
dcd799ad85 | ||
![]() |
ff0d7a4345 | ||
![]() |
d68bad313e | ||
![]() |
bd09917396 | ||
![]() |
eeaa2fe882 | ||
![]() |
32ac0e77fa | ||
![]() |
947a1aa9f5 | ||
![]() |
17a87f80e3 | ||
![]() |
59f4dc8c78 | ||
![]() |
6434a06c08 | ||
![]() |
6133ab509d | ||
![]() |
572a96328a | ||
![]() |
a7ac3bec7f | ||
![]() |
3e78f50a76 | ||
![]() |
a4843e57cb | ||
![]() |
d6d90dda58 | ||
![]() |
c92c5e234c | ||
![]() |
987f06d518 | ||
![]() |
eaf7476785 | ||
![]() |
3b39656280 | ||
![]() |
5c559f921d | ||
![]() |
77f6b3fcb8 | ||
![]() |
f56ed7fd50 | ||
![]() |
a470b579a9 | ||
![]() |
a2eb7d44c0 | ||
![]() |
dfc83a7aea | ||
![]() |
71686e45e3 | ||
![]() |
b0ac35a51b | ||
![]() |
d836320b31 | ||
![]() |
19e7c058c3 | ||
![]() |
f1ae3607e4 | ||
![]() |
d03bfaeb53 | ||
![]() |
33f363cb31 | ||
![]() |
cdb87b6a70 | ||
![]() |
b5497d83a9 | ||
![]() |
802b7c33b6 | ||
![]() |
bb4f81fb84 | ||
![]() |
10a02e98e9 | ||
![]() |
32075ef758 | ||
![]() |
998073ac7f | ||
![]() |
93c7a5bdd2 | ||
![]() |
3fb2ce47e9 | ||
![]() |
61a8217d83 | ||
![]() |
ad5e4341fa | ||
![]() |
5b192795e6 | ||
![]() |
5db9c5d31e | ||
![]() |
ff469a386e | ||
![]() |
3a90cf0e7b | ||
![]() |
07dbad8c70 | ||
![]() |
e8ba919661 | ||
![]() |
390d92b16f | ||
![]() |
d45d56f330 | ||
![]() |
2e7cde3ca5 | ||
![]() |
0594ea0b98 | ||
![]() |
37d09781b4 | ||
![]() |
b0f3a0ea30 | ||
![]() |
8282abf264 | ||
![]() |
4153b58502 | ||
![]() |
b62b940cd4 | ||
![]() |
ca9cf02361 | ||
![]() |
e863ffd949 | ||
![]() |
eb4bb3f238 | ||
![]() |
d3d35bbea1 | ||
![]() |
8eff6d80a2 | ||
![]() |
77c8947ccd | ||
![]() |
48556f6917 | ||
![]() |
2e8dc4234f | ||
![]() |
a6a60b6e71 | ||
![]() |
eba9eaf37a | ||
![]() |
ae31b1c23d | ||
![]() |
535a0532df | ||
![]() |
0579d242f6 | ||
![]() |
b4910ed8f4 | ||
![]() |
2bb1399ae7 | ||
![]() |
062ada96ff | ||
![]() |
bb94238e9c | ||
![]() |
43a40c1f6b | ||
![]() |
639866a9e1 | ||
![]() |
05bbe6b799 | ||
![]() |
e19b1c8bf0 | ||
![]() |
0648d621b5 | ||
![]() |
93c0de9ebb | ||
![]() |
0220b3f3cd | ||
![]() |
1af7f9388d | ||
![]() |
76f0eaebce | ||
![]() |
ae71957236 | ||
![]() |
5004f0280e | ||
![]() |
52967368ff | ||
![]() |
8a63fa42ae | ||
![]() |
05ecb92a88 | ||
![]() |
829619d901 | ||
![]() |
c74b60820b | ||
![]() |
cd741fe7fd | ||
![]() |
3b26cd845a | ||
![]() |
d05cc3cd35 | ||
![]() |
96dff832ba | ||
![]() |
e43339613c | ||
![]() |
e025bc2912 | ||
![]() |
a4be636f9d | ||
![]() |
a2bae6795f | ||
![]() |
28d9bd0c73 | ||
![]() |
8e12c9bef0 | ||
![]() |
88926c3eef | ||
![]() |
8dd774446b | ||
![]() |
46cf112378 | ||
![]() |
5d2520d057 | ||
![]() |
a6ea89162a | ||
![]() |
1039cf661d | ||
![]() |
eaf9f0bbfa | ||
![]() |
9e036176ef | ||
![]() |
31e1edcc72 | ||
![]() |
7d9d8d4a02 | ||
![]() |
71cb43e751 | ||
![]() |
f27e00500e | ||
![]() |
617c0e3813 | ||
![]() |
76634e3eed | ||
![]() |
21c16b26c9 | ||
![]() |
21536fb3ef | ||
![]() |
7c0ee2429d | ||
![]() |
9d6f43cfeb | ||
![]() |
cdcb31cf2f | ||
![]() |
e17f571dba | ||
![]() |
629c48bba0 | ||
![]() |
5078df6caf | ||
![]() |
2c5c4d9714 | ||
![]() |
316cd2c02c | ||
![]() |
e56f08505f | ||
![]() |
58a1f9e275 | ||
![]() |
bfdf54db67 | ||
![]() |
df8598a6f4 | ||
![]() |
4ca9e74249 | ||
![]() |
33caeeaf1d | ||
![]() |
53a8c3ecc8 | ||
![]() |
0ddb7f971d | ||
![]() |
fabe066f94 | ||
![]() |
5672bc0fb2 | ||
![]() |
c77f43e7c7 | ||
![]() |
d47ad34909 | ||
![]() |
96f731e9c9 | ||
![]() |
1b9376a9f5 | ||
![]() |
1425ee0048 | ||
![]() |
3a014b2a13 | ||
![]() |
38c4e6bebc | ||
![]() |
171404bf43 | ||
![]() |
73b1adce1b | ||
![]() |
90f55821e0 | ||
![]() |
fee8009f38 | ||
![]() |
8d698aeacd | ||
![]() |
fbd588444f | ||
![]() |
5735769ee7 | ||
![]() |
150f9190d5 | ||
![]() |
6a1e8a0c22 | ||
![]() |
66fca4a921 | ||
![]() |
9a2accc74b | ||
![]() |
5584b5ec3a | ||
![]() |
3b4121f59a | ||
![]() |
35eb6c2974 | ||
![]() |
e51deac151 | ||
![]() |
c9bb160291 | ||
![]() |
586979644c | ||
![]() |
0d376eaa1d | ||
![]() |
086c3d1a24 | ||
![]() |
91e75561a3 | ||
![]() |
979bf26441 | ||
![]() |
49844ddd9b | ||
![]() |
d095ebb2f3 | ||
![]() |
36f473508a | ||
![]() |
5eb2810352 | ||
![]() |
ee9e3a6673 | ||
![]() |
81a6bd528d | ||
![]() |
0cd32c97c4 | ||
![]() |
9bef55c63e | ||
![]() |
9b8686c25f | ||
![]() |
7130760114 | ||
![]() |
c6390874a2 | ||
![]() |
bf758dcd32 | ||
![]() |
2258ffa5eb | ||
![]() |
20b8e8db8b | ||
![]() |
0738d965fd | ||
![]() |
a3a421410f | ||
![]() |
1921bef0ea | ||
![]() |
70270830dc | ||
![]() |
d57f465e60 | ||
![]() |
03c38e3454 | ||
![]() |
be7d632cba | ||
![]() |
8c0a85abf4 | ||
![]() |
497e8c06f1 | ||
![]() |
c1bf84605c | ||
![]() |
e362f12394 | ||
![]() |
02d201a2f1 | ||
![]() |
48915cc6ad | ||
![]() |
02b065cc2c | ||
![]() |
a255597bc0 | ||
![]() |
29858e8b10 | ||
![]() |
972cfb265b | ||
![]() |
5e8a3afe61 | ||
![]() |
700decb2e0 | ||
![]() |
8368055397 | ||
![]() |
0d0f1f1c0c | ||
![]() |
db68ae5cea | ||
![]() |
0fd7c4aa4f | ||
![]() |
8592e6ef60 | ||
![]() |
e9fb02220a | ||
![]() |
aa54a0cd98 | ||
![]() |
eb724c8753 | ||
![]() |
1bb0caa704 | ||
![]() |
5bf2bc4a7b | ||
![]() |
70fd7ef89d | ||
![]() |
50d8e79571 | ||
![]() |
c236ddd967 | ||
![]() |
b551518911 | ||
![]() |
1be49b06f3 | ||
![]() |
200a9c6318 | ||
![]() |
9f10106d75 | ||
![]() |
6d4ff752a0 | ||
![]() |
29ecae66a9 | ||
![]() |
9c5f50d0a6 | ||
![]() |
8fcc9ac1e2 | ||
![]() |
8d83b3b1e7 | ||
![]() |
155570b6bf | ||
![]() |
831dc35935 | ||
![]() |
b641f1b67c | ||
![]() |
3c4906b8ac | ||
![]() |
a575bc92cc | ||
![]() |
7794e9ccd2 | ||
![]() |
4f5301a7e0 | ||
![]() |
6842936a75 | ||
![]() |
a0bf6599fa | ||
![]() |
c0384949a3 | ||
![]() |
371f4b128e | ||
![]() |
29fc776293 | ||
![]() |
bbdf87190c | ||
![]() |
02a448f284 | ||
![]() |
8665878b04 | ||
![]() |
c23812941b | ||
![]() |
fdac774745 | ||
![]() |
0a38b65ded | ||
![]() |
a7f44c8dd1 | ||
![]() |
2444bd3c2d | ||
![]() |
27f74844cc | ||
![]() |
d041712bd8 | ||
![]() |
ef0f2024c2 | ||
![]() |
bef3b3ba62 | ||
![]() |
037aee7c59 | ||
![]() |
0e3c13099b | ||
![]() |
8e3515bc34 | ||
![]() |
c736de7875 | ||
![]() |
42375d143e | ||
![]() |
7e6d7aed20 | ||
![]() |
ea68d0c28f | ||
![]() |
9cc82aedf2 | ||
![]() |
c52abce656 | ||
![]() |
65d8368ad4 | ||
![]() |
cf2f223ad4 | ||
![]() |
daae1aec6c | ||
![]() |
59bcd24c47 | ||
![]() |
44e224489b | ||
![]() |
8134e0223f | ||
![]() |
482249a05b | ||
![]() |
d0998dc093 | ||
![]() |
848bb01c10 | ||
![]() |
e39eb76aca | ||
![]() |
d6d2a55747 | ||
![]() |
355fa1a622 | ||
![]() |
fb007b8835 | ||
![]() |
256f5fcd0e | ||
![]() |
e698c950a3 | ||
![]() |
d0b9c3c118 | ||
![]() |
24358ca1a9 | ||
![]() |
6a21c94a0c | ||
![]() |
2d39a1e4b8 | ||
![]() |
e97a8da721 | ||
![]() |
665aaa3af9 | ||
![]() |
17fe1da4ed | ||
![]() |
cb6c94b4f9 | ||
![]() |
6fd6765bee | ||
![]() |
66b7019da9 | ||
![]() |
2c11624e32 | ||
![]() |
e44d7e6d49 | ||
![]() |
261911f6de | ||
![]() |
fe714a9003 | ||
![]() |
e8501a658b | ||
![]() |
3fb4830456 | ||
![]() |
39982b507a | ||
![]() |
4bd4f3ac68 | ||
![]() |
8533ef7739 | ||
![]() |
bd6d61c8c7 | ||
![]() |
7045ffbdb8 | ||
![]() |
9e47f4a7c3 | ||
![]() |
c886e49682 | ||
![]() |
8fdec8e816 | ||
![]() |
131387d0ff | ||
![]() |
f4a2b83afc | ||
![]() |
1c02ad6b4c | ||
![]() |
d93890ddcb | ||
![]() |
ca530159bb | ||
![]() |
b76b747235 | ||
![]() |
67896b7d3a | ||
![]() |
3b598a6f45 | ||
![]() |
62466123ff | ||
![]() |
14163a0791 | ||
![]() |
52a8a175a6 | ||
![]() |
0a83b0826a | ||
![]() |
d854cd7024 | ||
![]() |
7ac8d7a43a | ||
![]() |
b012618968 | ||
![]() |
fba59ff347 | ||
![]() |
27d2742386 | ||
![]() |
5ef25cfa6f | ||
![]() |
17e3dfe2bb | ||
![]() |
a334ff33cd | ||
![]() |
b0c1ecfdc5 | ||
![]() |
b4d5dcbf57 | ||
![]() |
3161ba8983 | ||
![]() |
92125b49f0 | ||
![]() |
a6e0fbd5e6 | ||
![]() |
c07d0353f0 |
332
AUTHORS.md
@@ -3,77 +3,281 @@ IdeaVim Authors
|
||||
|
||||
The original author:
|
||||
|
||||
* [Rick Maddy](mailto:rmaddy@maddyhome.com)
|
||||
* [![icon][mail]](mailto:rmaddy@maddyhome.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Rick Maddy
|
||||
|
||||
The current maintainers:
|
||||
|
||||
* [Andrey Vlasovskikh](mailto:andrey.vlasovskikh@gmail.com)
|
||||
* [Alex Plate](mailto:alexpl292@gmail.com)
|
||||
* [![icon][mail]](mailto:andrey.vlasovskikh@gmail.com)
|
||||
[![icon][github]](https://github.com/vlasovskikh)
|
||||
|
||||
Andrey Vlasovskikh
|
||||
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||
[![icon][github]](https://github.com/AlexPl292)
|
||||
|
||||
Alex Plate
|
||||
|
||||
Previous maintainers:
|
||||
|
||||
* [Oleg Shpynov](mailto:oleg.shpynov@jetbrains.com)
|
||||
* [![icon][mail]](mailto:oleg.shpynov@jetbrains.com)
|
||||
[![icon][github]](https://github.com/olegs)
|
||||
|
||||
Oleg Shpynov
|
||||
|
||||
Contributors:
|
||||
|
||||
* [Dmitry Jemerov](mailto:yole@jetbrains.com)
|
||||
* [Marquis Wang](mailto:marquis@marquiswang.com)
|
||||
* [Julien Hoarau](mailto:madgnome@gmail.com)
|
||||
* [Masanobu Imai](mailto:masanobu.imai@gmail.com)
|
||||
* [poxu](mailto:poxvuibr@gmail.com)
|
||||
* [Alexander Zolotov](mailto:alexander.zolotov@jetbrains.com)
|
||||
* [John Lindquist](mailto:johnlindquist@gmail.com)
|
||||
* [Ira Klotzko](mailto:iklotzko@ltech.com)
|
||||
* [Alex Selesse](mailto:alex@selesse.com)
|
||||
* [Dathan Bennett](mailto:dbennett@palantir.com)
|
||||
* [salaam](mailto:kphayen@gmail.com)
|
||||
* [Alexey Shmalko](mailto:rasen.dubi@gmail.com)
|
||||
* [Andrew Brookins](mailto:a.m.brookins@gmail.com)
|
||||
* [Chang Wang](mailto:changwang83@gmail.com)
|
||||
* [Jaime Sanchez](mailto:josejaime.sanchez@gmail.com)
|
||||
* [Thomas B Homburg](mailto:thomas@homburg.dk)
|
||||
* [smartbomb](mailto:smartbomb@server.fake)
|
||||
* [Tuomas Tynkkynen](mailto:tuomas.tynkkynen@iki.fi)
|
||||
* [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)
|
||||
* [Naveen Kumar Molleti](mailto:nerd.naveen@gmail.com)
|
||||
* [![icon][mail]](mailto:yole@jetbrains.com)
|
||||
[![icon][github]](https://github.com/yole)
|
||||
|
||||
Dmitry Jemerov
|
||||
* [![icon][mail]](mailto:marquis@marquiswang.com)
|
||||
[![icon][github]](https://github.com/marquiswang)
|
||||
|
||||
Marquis Wang
|
||||
* [![icon][mail]](mailto:madgnome@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Julien Hoarau
|
||||
* [![icon][mail]](mailto:masanobu.imai@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Masanobu Imai
|
||||
* [![icon][mail]](mailto:poxvuibr@gmail.com)
|
||||
[![icon][github]](https://github.com/poxu)
|
||||
|
||||
poxu
|
||||
* [![icon][mail]](mailto:alexander.zolotov@jetbrains.com)
|
||||
[![icon][github]](https://github.com/zolotov)
|
||||
|
||||
Alexander Zolotov
|
||||
* [![icon][mail]](mailto:johnlindquist@gmail.com)
|
||||
[![icon][github]](https://github.com/johnlindquist)
|
||||
|
||||
John Lindquist
|
||||
* [![icon][mail]](mailto:iklotzko@ltech.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Ira Klotzko
|
||||
* [![icon][mail]](mailto:alex@selesse.com)
|
||||
[![icon][github]](https://github.com/selesse)
|
||||
|
||||
Alex Selesse
|
||||
* [![icon][mail]](mailto:dbennett@palantir.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Dathan Bennett
|
||||
* [![icon][mail]](mailto:kphayen@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
salaam
|
||||
* [![icon][mail]](mailto:rasen.dubi@gmail.com)
|
||||
[![icon][github]](https://github.com/rasendubi)
|
||||
|
||||
Alexey Shmalko
|
||||
* [![icon][mail]](mailto:a.m.brookins@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Andrew Brookins
|
||||
* [![icon][mail]](mailto:changwang83@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Chang Wang
|
||||
* [![icon][mail]](mailto:josejaime.sanchez@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Jaime Sanchez
|
||||
* [![icon][mail]](mailto:thomas@homburg.dk)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Thomas B Homburg
|
||||
* [![icon][mail]](mailto:smartbomb@server.fake)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
smartbomb
|
||||
* [![icon][mail]](mailto:tuomas.tynkkynen@iki.fi)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Tuomas Tynkkynen
|
||||
* [![icon][mail]](mailto:jackson@donorschoose.org)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Jackson Popkin
|
||||
* [![icon][mail]](mailto:yuyuyu1999@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Teruo Kunihiro
|
||||
* [![icon][mail]](mailto:lubashka.994@mail.ru)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Liubov Paina
|
||||
* [![icon][mail]](mailto:me@dhleong.net)
|
||||
[![icon][github]](https://github.com/dhleong)
|
||||
|
||||
Daniel Leong
|
||||
* [![icon][mail]](mailto:aleksey@pri-num.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Aleksey Lagoshin
|
||||
* [![icon][mail]](mailto:pbu_98@yahoo.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Paulo Bu
|
||||
* [![icon][mail]](mailto:gaganis@yahoo.com)
|
||||
[![icon][github]](https://github.com/gaganis)
|
||||
|
||||
Giorgos Gaganis
|
||||
* [![icon][mail]](mailto:pavel.fatin@jetbrains.com)
|
||||
[![icon][github]](https://github.com/pavelfatin)
|
||||
|
||||
Pavel Fatin
|
||||
* [![icon][mail]](mailto:tietyt@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
tieTYT
|
||||
* [![icon][mail]](mailto:nickgieschen@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Nick Gieschen
|
||||
* [![icon][mail]](mailto:ikenox@gmail.com)
|
||||
[![icon][github]](https://github.com/ikenox)
|
||||
|
||||
Naoto Ikeno
|
||||
* [![icon][mail]](mailto:qzed@users.noreply.github.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Maximilian Luz
|
||||
* [![icon][mail]](mailto:vparfinenko@excelsior-usa.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Vladimir Parfinenko
|
||||
* [![icon][mail]](mailto:hassmann@hwdev.de)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Florian Hassmann
|
||||
* [![icon][mail]](mailto:jpalus@fastmail.com)
|
||||
[![icon][github]](https://github.com/jpalus)
|
||||
|
||||
Jan Palus
|
||||
* [![icon][mail]](mailto:kpetrov@ripe.net)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Konstantin Petrov
|
||||
* [![icon][mail]](mailto:ya-ikmik2012@yandex.ru)
|
||||
[![icon][github]](https://github.com/vasalf)
|
||||
|
||||
Vasily Alferov
|
||||
* [![icon][mail]](mailto:fkve97@gmail.com)
|
||||
[![icon][github]](https://github.com/karavaevitalii)
|
||||
|
||||
Vitalii Karavaev
|
||||
* [![icon][mail]](mailto:johnlinp@gmail.com)
|
||||
[![icon][github]](https://github.com/johnlinp)
|
||||
|
||||
John Lin
|
||||
* [![icon][mail]](mailto:alexpl292@gmail.com)
|
||||
[![icon][github]](https://github.com/AlexPl292)
|
||||
|
||||
Alex Plate
|
||||
* [![icon][mail]](mailto:m.t.ellis@gmail.com)
|
||||
[![icon][github]](https://github.com/citizenmatt)
|
||||
|
||||
Matt Ellis
|
||||
* [![icon][mail]](mailto:johngrib82@gmail.com)
|
||||
[![icon][github]](https://github.com/johngrib)
|
||||
|
||||
John Grib
|
||||
* [![icon][mail]](mailto:hild@b4mad.net)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Marcel Hild
|
||||
* [![icon][mail]](mailto:vedranb@gmail.com)
|
||||
[![icon][github-off]](#)
|
||||
|
||||
Vedran Budimcic
|
||||
* [![icon][mail]](mailto:andreigasparovici1@gmail.com)
|
||||
[![icon][github]](https://github.com/andreigasparovici)
|
||||
|
||||
Andrei Gasparovici
|
||||
* [![icon][mail]](mailto:qtankle@gmail.com)
|
||||
[![icon][github]](https://github.com/dos65)
|
||||
|
||||
dos65
|
||||
* [![icon][mail]](mailto:ttonyarra@gmail.com)
|
||||
[![icon][github]](https://github.com/TonyArra)
|
||||
|
||||
Tony Arra
|
||||
* [![icon][mail]](mailto:bradziolko@gmail.com)
|
||||
[![icon][github]](https://github.com/bradziolko)
|
||||
|
||||
Brad Ziolko
|
||||
* [![icon][mail]](mailto:sumoooru2@gmail.com)
|
||||
[![icon][github]](https://github.com/sumoooru2)
|
||||
|
||||
sumoooru2
|
||||
* [![icon][mail]](mailto:aqwsedrft1234@yahoo.co.jp)
|
||||
[![icon][github]](https://github.com/gecko655)
|
||||
|
||||
gecko655
|
||||
* [![icon][mail]](mailto:megna.dany@gmail.com)
|
||||
[![icon][github]](https://github.com/danielemegna)
|
||||
|
||||
Daniele Megna
|
||||
* [![icon][mail]](mailto:apottere@gmail.com)
|
||||
[![icon][github]](https://github.com/apottere)
|
||||
|
||||
Andrew Potter
|
||||
* [![icon][mail]](mailto:romain.gautier@nimamoh.net)
|
||||
[![icon][github]](https://github.com/Nimamoh)
|
||||
|
||||
Romain Gautier
|
||||
* [![icon][mail]](mailto:elliot.courant@wheniwork.com)
|
||||
[![icon][github]](https://github.com/ECourant)
|
||||
|
||||
Elliot Courant
|
||||
* [![icon][mail]](mailto:simon.rainer@fau.de)
|
||||
[![icon][github]](https://github.com/Vvalter)
|
||||
|
||||
Simon Rainer
|
||||
* [![icon][mail]](mailto:mziwisky@instructure.com)
|
||||
[![icon][github]](https://github.com/mziwisky)
|
||||
|
||||
Michael Ziwisky
|
||||
* [![icon][mail]](mailto:pierce@plasticcow.com)
|
||||
[![icon][github]](https://github.com/thecodewarrior)
|
||||
|
||||
Pierce Corcoran
|
||||
* [![icon][mail]](mailto:jonatantierno@gmail.com)
|
||||
[![icon][github]](https://github.com/jonatantierno)
|
||||
|
||||
Jonatan Tierno
|
||||
* [![icon][mail]](mailto:brendan@annable.me)
|
||||
[![icon][github]](https://github.com/BrendanAnnable)
|
||||
|
||||
Brendan Annable
|
||||
* [![icon][mail]](mailto:nerd.naveen@gmail.com)
|
||||
[![icon][github]](https://github.com/NOLFXceptMe)
|
||||
|
||||
Naveen Kumar Molleti
|
||||
* [![icon][mail]](mailto:jorgen.granseth@bekk.no)
|
||||
[![icon][github]](https://github.com/jorgengranseth)
|
||||
|
||||
Jørgen Granseth
|
||||
* [![icon][mail]](mailto:rafal@hajdacki.com)
|
||||
[![icon][github]](https://github.com/hajdamak)
|
||||
|
||||
Rafał Hajdacki
|
||||
* [![icon][mail]](mailto:igrek+github@fastem.com)
|
||||
[![icon][github]](https://github.com/igrekster)
|
||||
|
||||
igrekster
|
||||
|
||||
If you are a contributor and your name is not listed here, feel free to
|
||||
contact the maintainer.
|
||||
contact the maintainers.
|
||||
|
||||
<a href="https://icons8.com">Icons by Icons8</a>
|
||||
|
||||
[mail]: resources/icons/mail.png
|
||||
[github]: resources/icons/github.png
|
||||
|
||||
[github-off]: resources/icons/github-off.png
|
||||
|
80
CHANGES.md
@@ -8,14 +8,85 @@ 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)
|
||||
receive EAP builds as updates! Use the `EAP` option in the status bar or
|
||||
add this URL to "Settings | Plugins | Manage Plugin Repositories":
|
||||
`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.55, 2020-01-20
|
||||
--------------
|
||||
|
||||
**Features:**
|
||||
* Surround and Commentary extensions support repeating with a dot command ([VIM-1118](https://youtrack.jetbrains.com/issue/VIM-1118))
|
||||
* Support XDG settings standard ([VIM-664](https://youtrack.jetbrains.com/issue/VIM-664))
|
||||
* Add option to remove the status bar icon ([VIM-1847](https://youtrack.jetbrains.com/issue/VIM-1847))
|
||||
|
||||
**Fixes:**
|
||||
* [VIM-1823](https://youtrack.jetbrains.com/issue/VIM-1823) Fix multiple carets with ignorecase
|
||||
* [VIM-1053](https://youtrack.jetbrains.com/issue/VIM-1053)
|
||||
[VIM-1038](https://youtrack.jetbrains.com/issue/VIM-1038)
|
||||
Implement gq+motion. Support some double `g` commands (`guu`, `gUU`, `g~~`).
|
||||
* [VIM-1325](https://youtrack.jetbrains.com/issue/VIM-1325)
|
||||
[VIM-1050](https://youtrack.jetbrains.com/issue/VIM-1050)
|
||||
[VIM-1627](https://youtrack.jetbrains.com/issue/VIM-1627)
|
||||
[VIM-1867](https://youtrack.jetbrains.com/issue/VIM-1867)
|
||||
Fix bindings for active lookup
|
||||
* [VIM-1845](https://youtrack.jetbrains.com/issue/VIM-1845) Show ActionGroup popups
|
||||
* [VIM-1424](https://youtrack.jetbrains.com/issue/VIM-1424) CTRL-A doesn't have any restrictions now
|
||||
* [VIM-1454](https://youtrack.jetbrains.com/issue/VIM-1454) Fix CTRL-W with the autocompletion lookup
|
||||
* [VIM-1855](https://youtrack.jetbrains.com/issue/VIM-1855) Fix initialization error
|
||||
* [VIM-1853](https://youtrack.jetbrains.com/issue/VIM-1853) Fix marks for disposed projects
|
||||
* [VIM-1858](https://youtrack.jetbrains.com/issue/VIM-1858) Fix imap for autocomplete
|
||||
* [VIM-1362](https://youtrack.jetbrains.com/issue/VIM-1362) Search with confirm doesn't scroll down far enough
|
||||
* [VIM-1875](https://youtrack.jetbrains.com/issue/VIM-1875) Fix `isk` in `~/.ideaivmrc`
|
||||
* [VIM-1874](https://youtrack.jetbrains.com/issue/VIM-1874) Fix `set clipboard=unnamed` execution from `~/.ideavimrc`
|
||||
* [VIM-1878](https://youtrack.jetbrains.com/issue/VIM-1878) Fix `c` command after extract method action
|
||||
* [VIM-1884](https://youtrack.jetbrains.com/issue/VIM-1884) Show quickDoc during popup with `CTRL-J`
|
||||
|
||||
0.54, 2019-11-20
|
||||
--------------
|
||||
|
||||
**Features:**
|
||||
* EasyMotion plugin emulation ([VIM-820](https://youtrack.jetbrains.com/issue/VIM-820) | [Instructions](https://github.com/JetBrains/ideavim#emulated-vim-plugins))
|
||||
* Support surrounding with a function name ([link](https://github.com/tpope/vim-surround/blob/master/doc/surround.txt#L138))
|
||||
* Add `:delmarks` command ([VIM-1720](https://youtrack.jetbrains.com/issue/VIM-1720))
|
||||
* Add IdeaVim icon to the status bar ([VIM-943](https://youtrack.jetbrains.com/issue/VIM-943))
|
||||
|
||||
**Changes:**
|
||||
* Remove the default IdeaVim toggle shortcut (<kbd>CTRL</kbd><kbd>ALT</kbd><kbd>V</kbd>)
|
||||
* Rename `refactoring` value of `selectmode` option to `ideaselection`
|
||||
* Remove `template` value of `selectmode` option and replace it with `idearefactormode` option.
|
||||
|
||||
**Fixes:**
|
||||
* [VIM-1766](https://youtrack.jetbrains.com/issue/VIM-1766) Fix disappearing caret in ex entry on Linux
|
||||
* [VIM-1032](https://youtrack.jetbrains.com/issue/VIM-1032) Annotations work well with relative line numbers enabled
|
||||
* [VIM-1762](https://youtrack.jetbrains.com/issue/VIM-1762) Relative line numbers respect line number theme
|
||||
* [VIM-1717](https://youtrack.jetbrains.com/issue/VIM-1717) Fix incorrect scroll location if no match with `incsearch`
|
||||
* [VIM-1757](https://youtrack.jetbrains.com/issue/VIM-1757) Fix incorrect search results when specifying offset as part of search command
|
||||
* Fix search highlights not showing after deleting last result
|
||||
* Update current line highlight during incsearch and replace operation
|
||||
* [VIM-1773](https://youtrack.jetbrains.com/issue/VIM-1773) Provide fallback error stripe colour if not defined
|
||||
* [VIM-1785](https://youtrack.jetbrains.com/issue/VIM-1785)
|
||||
[VIM-1731](https://youtrack.jetbrains.com/issue/VIM-1731)
|
||||
Fix some problems with yanking to clipboard
|
||||
* [VIM-1781](https://youtrack.jetbrains.com/issue/VIM-1781) Fix yanking with dollar motion
|
||||
* [VIM-1772](https://youtrack.jetbrains.com/issue/VIM-1772) Fix yanking with `:y` command
|
||||
* [VIM-1685](https://youtrack.jetbrains.com/issue/VIM-1685) Fix `ESC` for insert mode
|
||||
* [VIM-1752](https://youtrack.jetbrains.com/issue/VIM-1752) Fix `ESC` for insert mode
|
||||
* [VIM-1189](https://youtrack.jetbrains.com/issue/VIM-1189)
|
||||
[VIM-927](https://youtrack.jetbrains.com/issue/VIM-927)
|
||||
Fix mappings to black hole register
|
||||
* [VIM-1804](https://youtrack.jetbrains.com/issue/VIM-1804) Exit insert move after toggling IdeaVim
|
||||
* [VIM-1749](https://youtrack.jetbrains.com/issue/VIM-1749) Tag surround is finished on `>`
|
||||
* [VIM-1801](https://youtrack.jetbrains.com/issue/VIM-1801) Fix j/k motions with inline hints
|
||||
* [VIM-1800](https://youtrack.jetbrains.com/issue/VIM-1800) Improve ideamarks option
|
||||
* [VIM-1819](https://youtrack.jetbrains.com/issue/VIM-1819) Fix execution of some rider actions
|
||||
* [VIM-1604](https://youtrack.jetbrains.com/issue/VIM-1604) Add IdeaVim logo
|
||||
|
||||
|
||||
0.53, 2019-08-07
|
||||
--------------
|
||||
* [VIM-1711](https://youtrack.jetbrains.com/issue/VIM-1711) Search is not triggered during surround action
|
||||
@@ -26,8 +97,7 @@ usual beta standards.
|
||||
* [VIM-1725](https://youtrack.jetbrains.com/issue/VIM-1725) Fix problems with Japanese language
|
||||
* [VIM-1648](https://youtrack.jetbrains.com/issue/VIM-1648) Fix exception while substitute with conformation
|
||||
* [VIM-1736](https://youtrack.jetbrains.com/issue/VIM-1736) Fix `` for ex panel
|
||||
* [VIM-1739](https://youtrack.jetbrains.com/issue/VIM-1739) Fix full-width characters for ex panel
|
||||
|
||||
* [VIM-1739](https://youtrack.jetbrains.com/issue/VIM-1739) Fix full-width characters for ex pane
|
||||
|
||||
0.52, 2019-07-23
|
||||
--------------
|
||||
|
@@ -1,25 +1,31 @@
|
||||
<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 href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20183&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20183)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2018.3 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="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 href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2019.1 Tests</span>
|
||||
</div>
|
||||
<div>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20192&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20192)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>2019.2 Tests</span>
|
||||
</div>
|
||||
|
||||
|
||||
### Where to Start
|
||||
|
||||
In order to contribute to IdeaVim, you should have some understanding of Java or [Kotlin](https://kotlinlang.org/).
|
||||
In order to contribute to IdeaVim, you should have some understanding of [Kotlin](https://kotlinlang.org/) or Java.
|
||||
|
||||
See also these docs on the IntelliJ API:
|
||||
|
||||
* [IntelliJ architectural overview](http://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+Architectural+Overview)
|
||||
* [IntelliJ plugin development resources](http://confluence.jetbrains.com/display/IDEADEV/PluginDevelopment)
|
||||
* [IntelliJ architectural overview](https://www.jetbrains.org/intellij/sdk/docs/platform/fundamentals.html)
|
||||
* [IntelliJ plugin development resources](https://www.jetbrains.org/intellij/sdk/docs/welcome.html)
|
||||
|
||||
You can start by:
|
||||
|
||||
@@ -85,7 +91,7 @@ in the issue tracker.
|
||||
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/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
3. Go to `Preferences | Editor | Copyright`, click the "+" button.
|
||||
Scope: Copyright scope
|
||||
|
69
README.md
@@ -1,38 +1,28 @@
|
||||
<img src="resources/META-INF/pluginIcon.svg" width="80" height="80" alt="icon" align="left"/>
|
||||
|
||||
IdeaVim
|
||||
=======
|
||||
===
|
||||
|
||||
<div>
|
||||
<a href="https://confluence.jetbrains.com/display/ALL/JetBrains+on+GitHub">
|
||||
<img src="http://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||
<img src="https://jb.gg/badges/official.svg" alt="official JetBrains project"/>
|
||||
</a>
|
||||
<a href="https://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_TestsForIntelliJ20191&guest=1">
|
||||
<img src="https://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_TestsForIntelliJ20191)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Deploy&guest=1">
|
||||
<img src="http://teamcity.jetbrains.com/app/rest/builds/buildType:(id:IdeaVim_Deploy)/statusIcon.svg?guest=1"/>
|
||||
</a>
|
||||
<span>Stable</span>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<a href="http://teamcity.jetbrains.com/viewType.html?buildTypeId=IdeaVim_Build&guest=1">
|
||||
<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:
|
||||
|
||||
* [Plugin homepage](http://plugins.jetbrains.com/plugin/164)
|
||||
* [Plugin homepage](https://plugins.jetbrains.com/plugin/164-ideavim)
|
||||
* [Changelog](CHANGES.md)
|
||||
* [Bug tracker](http://youtrack.jetbrains.com/issues/VIM)
|
||||
* [Continuous integration builds](http://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||
* [@IdeaVim](http://twitter.com/ideavim) in Twitter
|
||||
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||
* [Continuous integration builds](https://teamcity.jetbrains.com/project.html?projectId=IdeaVim&guest=1)
|
||||
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||
|
||||
|
||||
Installation
|
||||
@@ -59,6 +49,10 @@ Get Early Access
|
||||
Would you like to try new features and fixes? Join the Early Access Program and
|
||||
receive EAP builds as updates!
|
||||
|
||||
1. Click the IdeaVim icon in the status bar | `EAP` | `Get Early Access...`
|
||||
|
||||
Or subscribe to EAP updates manually:
|
||||
|
||||
1. Open `Settings | Plugins`
|
||||
2. Click the gear icon :gear:, select `Manage Plugin Repositories`, and add the following url:
|
||||
`https://plugins.jetbrains.com/plugins/eap/ideavim`
|
||||
@@ -70,8 +64,8 @@ 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)
|
||||
* [@IdeaVim](https://twitter.com/ideavim) in Twitter
|
||||
* [Bug tracker](https://youtrack.jetbrains.com/issues/VIM)
|
||||
|
||||
|
||||
Summary of Supported Vim Features
|
||||
@@ -111,7 +105,7 @@ Not supported (yet):
|
||||
See also:
|
||||
|
||||
* [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](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+sort+by%3A+votes)
|
||||
|
||||
|
||||
Files
|
||||
@@ -125,7 +119,7 @@ You can read your ~/.vimrc file from ~/.ideavimrc with this command:
|
||||
source ~/.vimrc
|
||||
|
||||
Note, that IdeaVim currently parses ~/.ideavimrc file via simple pattern matching.
|
||||
See [VIM-669](http://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||
See [VIM-669](https://youtrack.jetbrains.com/issue/VIM-669) for proper parsing
|
||||
of VimL files.
|
||||
|
||||
Also note that if you have overridden the `user.home` JVM option, this
|
||||
@@ -133,24 +127,40 @@ will affect where IdeaVim looks for your .ideavimrc file. For example, if you
|
||||
have `-Duser.home=/my/alternate/home` then IdeaVim will source
|
||||
`/my/alternate/home/.ideavimrc` instead of `~/.ideavimrc`.
|
||||
|
||||
Alternatively, you can set up initialization commands using [XDG](https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html) standard.
|
||||
Put your settings to `$XDG_CONFIG_HOME$/ideavim/ideavimrc` file.
|
||||
|
||||
|
||||
Emulated Vim Plugins
|
||||
--------------------
|
||||
|
||||
IdeaVim extensions emulate some plugins of the original Vim. In order to use
|
||||
IdeaVim extensions, you have to enable them via this command in your ~/.ideavimrc:
|
||||
IdeaVim extensions, you have to enable them via this command in your `~/.ideavimrc`:
|
||||
|
||||
set <extension-name>
|
||||
|
||||
Available extensions:
|
||||
|
||||
* easymotion
|
||||
* Setup:
|
||||
* Install [IdeaVim-EasyMotion](https://plugins.jetbrains.com/plugin/13360-ideavim-easymotion/)
|
||||
and [AceJump](https://plugins.jetbrains.com/plugin/7086-acejump/) plugins.
|
||||
* `set easymotion`
|
||||
* Emulates [vim-easymotion](https://github.com/easymotion/vim-easymotion)
|
||||
* Commands: All commands with the mappings are supported. See the [full list of supported commands](https://github.com/AlexPl292/IdeaVim-EasyMotion#supported-commands).
|
||||
|
||||
* surround
|
||||
* Setup: `set surround`
|
||||
* Emulates [vim-surround](https://github.com/tpope/vim-surround)
|
||||
* Commands: `ys`, `cs`, `ds`, `S`
|
||||
|
||||
* multiple-cursors
|
||||
* Setup: `set multiple-cursors`
|
||||
* Emulates [vim-multiple-cursors](https://github.com/terryma/vim-multiple-cursors)
|
||||
* Commands: `<A-n>`, `<A-x>`, `<A-p>`, `g<A-n>`
|
||||
|
||||
* commentary
|
||||
* Setup: `set commentary`
|
||||
* Emulates [commentary.vim](https://github.com/tpope/vim-commentary)
|
||||
* Commands: `gcc`, `gc + motion`, `v_gc`
|
||||
|
||||
@@ -164,7 +174,7 @@ The IdeaVim plugin uses the undo/redo functionality of the IntelliJ Platform,
|
||||
so the behavior of the `u` and `<C-R>` commands may differ from the original
|
||||
Vim. Vim compatibility of undo/redo may be improved in future releases.
|
||||
|
||||
See also [unresolved undo issues](http://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||
See also [unresolved undo issues](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+u).
|
||||
|
||||
### Escape
|
||||
|
||||
@@ -174,7 +184,7 @@ should use `<C-c>` or `<C-[>` instead. In some dialog windows, the normal mode i
|
||||
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](https://youtrack.jetbrains.com/issues/VIM?q=%23Unresolved+Help+topic%3A+i_Esc).
|
||||
|
||||
### Executing IDE Actions
|
||||
|
||||
@@ -206,4 +216,5 @@ for a list of authors and contributors.
|
||||
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
|
||||
or any later version.
|
||||
|
15
build.gradle
@@ -55,8 +55,19 @@ repositories {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"
|
||||
compile "org.jetbrains:annotations:17.0.0"
|
||||
compileOnly "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlinVersion"
|
||||
compileOnly "org.jetbrains:annotations:17.0.0"
|
||||
}
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
}
|
||||
}
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = javaVersion
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register("slackEapNotification") {
|
||||
|
@@ -13,12 +13,6 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
'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
|
||||
@@ -46,12 +40,6 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
'matchpairs' 'mps' pairs of characters that "%" can match
|
||||
'nrformats' 'nf' number formats recognized for CTRL-A command
|
||||
'number' 'nu' print the line number in front of each line
|
||||
|
||||
`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
|
||||
the cursor
|
||||
'scroll' 'scr' lines to scroll with CTRL-U and CTRL-D
|
||||
@@ -59,7 +47,7 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
'scrolloff' 'so' minimum number of lines above and below the cursor
|
||||
'selection' 'sel' what type of selection to use
|
||||
|
||||
`selectmode` `slm` String (default "template")
|
||||
`selectmode` `slm` String (default "")
|
||||
|
||||
This is a comma-separated list of words, which specify when to start
|
||||
Select mode instead of Visual mode, when a selection is started.
|
||||
@@ -67,17 +55,16 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
mouse when using the mouse
|
||||
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
|
||||
ideaselection when IDE sets a selection - IdeaVim ONLY
|
||||
(examples: extend selection, wrap with while, etc.)
|
||||
|
||||
Deprecated values:
|
||||
template ~~please use `idearefactormode` option~~
|
||||
when starting a template - IdeaVim ONLY
|
||||
refactoring ~~please use ideaselection~~
|
||||
same as ideaselection - IdeaVim ONLY
|
||||
|
||||
'showmode' 'smd' message on the status line to show current mode
|
||||
|
||||
`ideajoin` `ideajoin` Boolean (default false) - IdeaVim ONLY
|
||||
|
||||
If true, join command will be performed via IDE
|
||||
See wiki/`ideajoin` examples
|
||||
|
||||
'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
|
||||
@@ -88,5 +75,48 @@ The following `:set` commands can appear in `~/.ideavimrc` or be set manually in
|
||||
'visualbell' 'vb' use visual bell instead of beeping
|
||||
'wrapscan' 'ws' searches wrap around the end of file
|
||||
|
||||
|
||||
|
||||
IdeaVim only commands:
|
||||
|
||||
`ideamarks` `ideamarks` Boolean (default true)
|
||||
|
||||
If true, creation of global mark will trigger creation of IDE's bookmark
|
||||
and vice versa.
|
||||
|
||||
`idearefactormode` `idearefactormode` String(default "select")
|
||||
|
||||
Define the mode that would be enabled during
|
||||
the refactoring (renaming, live template, introduce variable, etc)
|
||||
|
||||
Use one of the following values:
|
||||
- keep - keep the mode that was enabled before starting a refactoring
|
||||
- select - start refactoring in select mode
|
||||
- visual - start refactoring in visual mode
|
||||
|
||||
This option has effect if you are in normal, insert or replace mode before refactoring start.
|
||||
Visual or select mode are not changed.
|
||||
|
||||
|
||||
`ideajoin` `ideajoin` Boolean (default false)
|
||||
|
||||
If true, join command will be performed via IDE
|
||||
See wiki/`ideajoin` examples
|
||||
|
||||
`ideastatusbar` `ideastatusbar` Boolean (default true)
|
||||
|
||||
If false, IdeaVim icon won't be shown in the status bar.
|
||||
Works only from `~/.ideavimrc` after the IDE restart.
|
||||
|
||||
`lookupkeys` `lookupkeys` List of strings
|
||||
|
||||
List of keys that should be processed by the IDE during the active lookup (autocompletion).
|
||||
For example, <Tab> and <Enter> are used by the IDE to finish the lookup,
|
||||
but <C-W> should be passed to IdeaVim.
|
||||
Default value:
|
||||
"<Tab>", "<Down>", "<Up>", "<Enter>", "<Left>", "<Right>",
|
||||
"<C-Down>", "<C-Up>", "<PageUp>", "<PageDown>",
|
||||
"<C-J>", "<C-Q>"
|
||||
|
||||
----------
|
||||
[1] - cursor keys, <End>, <Home>, <PageUp> and <PageDown>
|
||||
|
@@ -1,9 +1,11 @@
|
||||
ideaVersion=192-EAP-SNAPSHOT
|
||||
# suppress inspection "UnusedProperty" for whole file
|
||||
|
||||
ideaVersion=2019.3
|
||||
downloadIdeaSources=true
|
||||
instrumentPluginCode=true
|
||||
version=SNAPSHOT
|
||||
javaVersion=1.8
|
||||
kotlinVersion=1.3.41
|
||||
kotlinVersion=1.3.61
|
||||
publishUsername=username
|
||||
publishToken=token
|
||||
publishChannels=eap
|
||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
24
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,24 +1,6 @@
|
||||
#
|
||||
# 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
|
||||
#Fri Nov 22 14:42:01 MSK 2019
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
||||
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
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
23
resources/META-INF/ApplicationServices.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MotionGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.ChangeGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.CommandGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MarkGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.RegisterGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.FileGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.SearchGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.ProcessGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.MacroGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.DigraphGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.HistoryGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.KeyGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.WindowGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.EditorGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.visual.VisualMotionGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.copy.YankGroup"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.copy.PutGroup"/>
|
||||
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
345
resources/META-INF/VimActions.xml
Normal file
@@ -0,0 +1,345 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="IdeaVIM">
|
||||
<!-- Motions -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.tabs.MotionPreviousTabAction" mappingModes="NXO" keys="gT"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.tabs.MotionNextTabAction" mappingModes="NXO" keys="gt"/>
|
||||
<!-- Left/Right -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionColumnAction" mappingModes="NXO" keys="|"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnAction" mappingModes="NXO" keys="0"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstColumnInsertModeAction" mappingModes="I" keys="«Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenColumnAction" mappingModes="NXO" keys="g0,g«Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstNonSpaceAction" mappingModes="NXO" keys="^"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionFirstScreenNonSpaceAction" mappingModes="NXO" keys="g^"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnAction" mappingModes="NXO" keys="$"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastColumnInsertAction" mappingModes="I" keys="«End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastScreenColumnAction" mappingModes="NXO" keys="g$,g«End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharAction" mappingModes="NXO" keys=";"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastMatchCharReverseAction" mappingModes="NXO" keys="«COMMA»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLastNonSpaceAction" mappingModes="NXO" keys="g_"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftAction" mappingModes="NXO" keys="h"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftInsertModeAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftWrapAction" mappingModes="NXO" keys="«BS»,«C-H»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftMatchCharAction" mappingModes="NXO" keys="F"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionLeftTillMatchCharAction" mappingModes="NXO" keys="T"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionMiddleColumnAction" mappingModes="NXO" keys="gm"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightAction" mappingModes="NXO" keys="l"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightInsertAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightWrapAction" mappingModes="NXO" keys=" "/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightMatchCharAction" mappingModes="NXO" keys="f"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionRightTillMatchCharAction" mappingModes="NXO" keys="t"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionHomeAction" mappingModes="NV" keys="«Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftHomeAction" mappingModes="NV" keys="«S-Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionEndAction" mappingModes="NVO" keys="«End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftEndAction" mappingModes="NV" keys="«S-End»"/>
|
||||
<!-- Up/Down -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownAction" mappingModes="NXO" keys="j"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownCtrlNAction" mappingModes="NXO" keys="«C-N»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownNotLineWiseAction" mappingModes="NXO" keys="gj,g«Down»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownFirstNonSpaceAction" mappingModes="NXO" keys="+,«C-M»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.EnterNormalAction" mappingModes="NXO" keys="«CR»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionDownLess1FirstNonSpaceAction" mappingModes="NXO" keys="_"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstAction" mappingModes="NXO" keys="gg,«C-Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineFirstInsertAction" mappingModes="I" keys="«C-Home»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastAction" mappingModes="NXO" keys="G"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndAction" mappingModes="NXO" keys="«C-End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionGotoLineLastEndInsertAction" mappingModes="I" keys="«C-End»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionPercentOrMatchAction" mappingModes="NXO" keys="%"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpAction" mappingModes="NXO" keys="k"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpCtrlPAction" mappingModes="NXO" keys="«C-P»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpNotLineWiseAction" mappingModes="NXO" keys="gk,g«Up»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionUpFirstNonSpaceAction" mappingModes="NXO" keys="-"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionArrowDownAction" mappingModes="NVO"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionArrowUpAction" mappingModes="NVO"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowLeftAction" mappingModes="NXO"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionArrowRightAction" mappingModes="NXO"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.LookupDownAction" mappingModes="I" keys="«C-N»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.LookupUpAction" mappingModes="I" keys="«C-P»"/>
|
||||
<!-- Text -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndLeftAction" mappingModes="NXO" keys="]b"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelEndRightAction" mappingModes="NXO" keys="]w"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelLeftAction" mappingModes="NXO" keys="[b"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionCamelRightAction" mappingModes="NXO" keys="[w"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction" mappingModes="NXO" keys="go"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction" mappingModes="NXO" keys="ge"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndLeftAction" mappingModes="NXO" keys="gE"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordEndRightAction" mappingModes="NXO" keys="e"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndRightAction" mappingModes="NXO" keys="E"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftAction" mappingModes="NXO" keys="b"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordLeftInsertAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordLeftAction" mappingModes="NXO" keys="B,«C-Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordRightAction" mappingModes="NXO" keys="w"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionWordRightInsertAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionBigWordRightAction" mappingModes="NXO" keys="W,«C-Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextStartAction" mappingModes="NXO" keys=")"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousStartAction" mappingModes="NXO" keys="("/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextEndAction" mappingModes="NXO" keys="g)"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousEndAction" mappingModes="NXO" keys="g("/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionParagraphNextAction" mappingModes="NXO" keys="}"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionParagraphPreviousAction" mappingModes="NXO" keys="{"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceCloseAction" mappingModes="NXO" keys="]}"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceOpenAction" mappingModes="NXO" keys="[{"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenCloseAction" mappingModes="NXO" keys="])"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenOpenAction" mappingModes="NXO" keys="[("/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardEndAction" mappingModes="NXO" keys="[]"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardStartAction" mappingModes="NXO" keys="[["/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardEndAction" mappingModes="NXO" keys="]]"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardStartAction" mappingModes="NXO" keys="]["/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousEndAction" mappingModes="NXO" keys="[M"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousStartAction" mappingModes="NXO" keys="[m"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextEndAction" mappingModes="NXO" keys="]M"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextStartAction" mappingModes="NXO" keys="]m"/>
|
||||
<!-- Text Objects -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterWordAction" mappingModes="XO" keys="aw"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBigWordAction" mappingModes="XO" keys="aW"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerWordAction" mappingModes="XO" keys="iw"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBigWordAction" mappingModes="XO" keys="iW"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockAngleAction" mappingModes="XO" keys="i>,i<"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBraceAction" mappingModes="XO" keys="iB,i{,i}"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBracketAction" mappingModes="XO" keys="i[,i]"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockParenAction" mappingModes="XO" keys="ib,i(,i)"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockDoubleQuoteAction" mappingModes="XO" keys='i"'/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockSingleQuoteAction" mappingModes="XO" keys="i'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBackQuoteAction" mappingModes="XO" keys="i`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockTagAction" mappingModes="XO" keys="it"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockAngleAction" mappingModes="XO" keys="a<,a>"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBraceAction" mappingModes="XO" keys="aB,a{,a}"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBracketAction" mappingModes="XO" keys="a[,a]"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockParenAction" mappingModes="XO" keys="ab,a(,a)"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockDoubleQuoteAction" mappingModes="XO" keys='a"'/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockSingleQuoteAction" mappingModes="XO" keys="a'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockBackQuoteAction" mappingModes="XO" keys="a`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockTagAction" mappingModes="XO" keys="at"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerParagraphAction" mappingModes="XO" keys="ip"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterParagraphAction" mappingModes="XO" keys="ap"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionInnerSentenceAction" mappingModes="XO" keys="is"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.object.MotionOuterSentenceAction" mappingModes="XO" keys="as"/>
|
||||
<!-- Marks -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionMarkAction" mappingModes="NX" keys="m"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkAction" mappingModes="XO" keys="`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkNoSaveJumpAction" mappingModes="XO" keys="g`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineAction" mappingModes="XO" keys="'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoFileMarkLineNoSaveJumpAction" mappingModes="XO" keys="g'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkAction" mappingModes="N" keys="`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkNoSaveJumpAction" mappingModes="N" keys="g`"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineAction" mappingModes="N" keys="'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionGotoMarkLineNoSaveJumpAction" mappingModes="N" keys="g'"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionJumpNextAction" mappingModes="N" keys="«C-I»,«Tab»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" mappingModes="N" keys="«C-O»,«C-T»"/>
|
||||
<!-- Screen -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionFirstScreenLineAction" mappingModes="NXO" keys="H"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionLastScreenLineAction" mappingModes="NXO" keys="L"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction" mappingModes="NXO" keys="M"/>
|
||||
<!-- Scroll -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLinePageStartAction" mappingModes="NXO" keys="z+"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineStartAction" mappingModes="NXO" keys="z«CR»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction" mappingModes="NXO" keys="zt"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction" mappingModes="NXO" keys="«C-D»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction" mappingModes="NXO" keys="«C-U»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction" mappingModes="NXO" keys="zb"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLinePageStartAction" mappingModes="NXO" keys="z^"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineStartAction" mappingModes="NXO" keys="z-"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction" mappingModes="NXO" keys="«C-E»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction" mappingModes="NXO" keys="«C-Y»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineAction" mappingModes="NXO" keys="zz"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollMiddleScreenLineStartAction" mappingModes="NXO" keys="z."/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownAction" mappingModes="NXO" keys="«C-F»,«PageDown»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageDownInsertModeAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpAction" mappingModes="NXO" keys="«C-B»,«PageUp»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollPageUpInsertModeAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenColumnAction" mappingModes="NXO" keys="zs"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenColumnAction" mappingModes="NXO" keys="ze"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnLeftAction" mappingModes="NXO" keys="zl,z«Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollColumnRightAction" mappingModes="NXO" keys="zh,z«Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftDownAction" mappingModes="NV" keys="«S-Down»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.updown.MotionShiftUpAction" mappingModes="NV" keys="«S-Up»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftRightAction" mappingModes="NV" keys="«S-Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.leftright.MotionShiftLeftAction" mappingModes="NV" keys="«S-Left»"/>
|
||||
<!-- Visual -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualExitModeAction" mappingModes="X" keys="«Esc»,«C-[»,«C-C»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleCharacterModeAction" mappingModes="NX" keys="v"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction" mappingModes="NX" keys="V"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualToggleBlockModeAction" mappingModes="NX" keys="«C-q»,«C-v»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction" mappingModes="X" keys="o"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsBlockAction" mappingModes="X" keys="O"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSelectPreviousAction" mappingModes="N" keys="gv"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.visual.VisualSwapSelectionsAction" mappingModes="X" keys="gv"/>
|
||||
|
||||
<!-- Select-->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableCharacterModeAction" mappingModes="N" keys="gh"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableLineModeAction" mappingModes="N" keys="gH"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnableBlockModeAction" mappingModes="N" keys="g«C-h»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionRightAction" mappingModes="S" keys="«Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.motion.SelectMotionLeftAction" mappingModes="S" keys="«Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectToggleVisualMode" mappingModes="V" keys="«C-G»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEnterAction" mappingModes="S" keys="«enter»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectEscapeAction" mappingModes="S" keys="«esc»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.select.SelectDeleteAction" mappingModes="S" keys="«BS»,«DEL»"/>
|
||||
|
||||
<!-- Insert -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAfterCursorAction" mappingModes="N" keys="a"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAfterLineEndAction" mappingModes="N" keys="A"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction" mappingModes="N" keys="gi"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction" mappingModes="N" keys="i,«Insert»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction" mappingModes="N" keys="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction" mappingModes="I" keys="«C-Y»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction" mappingModes="I" keys="«C-E»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertDeleteInsertedTextAction" mappingModes="I" keys="«C-U»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction" mappingModes="I" keys="«C-W»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction" mappingModes="I" keys="«C-M»,«CR»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction" mappingModes="I" keys="«C-[»,«C-C»,«Esc»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction" mappingModes="N" keys="gI"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction" mappingModes="N" keys="O"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction" mappingModes="N" keys="o"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction" mappingModes="I" keys="«C-A»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction" mappingModes="I" keys="«C-R»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction" mappingModes="I" keys="«Ins»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction" mappingModes="I" keys="«C-O»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.VisualBlockInsertAction" mappingModes="X" keys="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.insert.VisualBlockAppendAction" mappingModes="X" keys="A"/>
|
||||
|
||||
<!-- Delete -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction" mappingModes="N" keys="«DEL»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction" mappingModes="N" keys="X"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction" mappingModes="N" keys="x"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction" mappingModes="N" keys="D"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction" mappingModes="N" keys="gJ"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction" mappingModes="N" keys="J"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction" mappingModes="X" keys="gJ"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction" mappingModes="X" keys="J"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction" mappingModes="N" keys="d"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction" mappingModes="X" keys="d,x,«Del»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction" mappingModes="X" keys="X"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesEndAction" mappingModes="X" keys="D"/>
|
||||
|
||||
<!-- Change -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction" mappingModes="N" keys="gu"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction" mappingModes="X" keys="u"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction" mappingModes="N" keys="~"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction" mappingModes="N" keys="g~"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction" mappingModes="X" keys="~"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction" mappingModes="N" keys="gU"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction" mappingModes="X" keys="U"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction" mappingModes="N" keys="r"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction" mappingModes="N" keys="s"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeEndOfLineAction" mappingModes="N" keys="C"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLineAction" mappingModes="N" keys="S"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" mappingModes="N" keys="c"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberIncAction" mappingModes="N" keys="«C-A»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeNumberDecAction" mappingModes="N" keys="«C-X»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberIncAction" mappingModes="X" keys="«C-A»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberDecAction" mappingModes="X" keys="«C-X»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheIncAction" mappingModes="X" keys="g«C-A»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.number.ChangeVisualNumberAvalancheDecAction" mappingModes="X" keys="g«C-X»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeReplaceAction" mappingModes="N" keys="R"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualAction" mappingModes="X" keys="c,s"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualCharacterAction" mappingModes="X" keys="r"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction" mappingModes="X" keys="R,S"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesEndAction" mappingModes="X" keys="C"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.FilterMotionAction" mappingModes="N" keys="!"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.FilterVisualLinesAction" mappingModes="X" keys="!"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.AutoIndentLinesVisualAction" mappingModes="X" keys="="/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ReformatCodeVisualAction" mappingModes="X" keys="gq"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ReformatCodeMotionAction" mappingModes="N" keys="gq"/>
|
||||
|
||||
<!-- Shift -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.AutoIndentMotionAction" mappingModes="N" keys="="/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftLinesAction" mappingModes="I" keys="«C-D»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftMotionAction" mappingModes="N" keys="<"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftLeftVisualAction" mappingModes="X" keys="<"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightLinesAction" mappingModes="I" keys="«C-T»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightMotionAction" mappingModes="N" keys=">"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" mappingModes="X" keys=">"/>
|
||||
|
||||
<!-- Copy -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction" mappingModes="N" keys="p"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction" mappingModes="N" keys="P"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorNoIndentAction" mappingModes="N" keys="]p"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorNoIndentAction" mappingModes="N" keys="[P,]P,[p"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorActionMoveCursor" mappingModes="N" keys="gp"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorActionMoveCursor" mappingModes="N" keys="gP"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.SelectRegisterAction" mappingModes="NXO" keys='"'/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankLineAction" mappingModes="N" keys="Y"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankMotionAction" mappingModes="N" keys="y"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankVisualAction" mappingModes="X" keys="y"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.YankVisualLinesAction" mappingModes="X" keys="Y"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextAction" mappingModes="X" keys="p,P"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextNoIndentAction" mappingModes="X" keys="[p,]p,]P,[P"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.copy.PutVisualTextMoveCursorAction" mappingModes="X" keys="gp,gP"/>
|
||||
|
||||
<!-- File -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileSaveCloseAction" mappingModes="N" keys="ZQ,ZZ"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FilePreviousAction" mappingModes="N"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetAsciiAction" mappingModes="N" keys="ga"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetHexAction" mappingModes="N" keys="g8"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetFileInfoAction" mappingModes="N" keys="«C-G»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.file.FileGetLocationInfoAction" mappingModes="NX" keys="g«C-G»"/>
|
||||
|
||||
<!-- Window -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.VerticalSplitAction" mappingModes="N" keys="«C-W»v,«C-W»«C-V»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.HorizontalSplitAction" mappingModes="N" keys="«C-W»s,«C-W»S,«C-W»«C-S»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.CloseWindowAction" mappingModes="N" keys="«C-W»c"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowOnlyAction" mappingModes="N" keys="«C-W»o,«C-W»«C-O»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowNextAction" mappingModes="N" keys="«C-W»w,«C-W»«C-W»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowPrevAction" mappingModes="N" keys="«C-W»W"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowLeftAction" mappingModes="N" keys="«C-W»h,«C-W»«C-H»,«C-W»«Left»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowRightAction" mappingModes="N" keys="«C-W»l,«C-W»«C-L»,«C-W»«Right»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowUpAction" mappingModes="N" keys="«C-W»k,«C-W»«C-K»,«C-W»«Up»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.window.WindowDownAction" mappingModes="N" keys="«C-W»j,«C-W»«C-J»,«C-W»«Down»"/>
|
||||
|
||||
<!-- Search -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchEntryFwdAction" mappingModes="NXO" keys="/"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchEntryRevAction" mappingModes="NXO" keys="?"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchAgainNextAction" mappingModes="NXO" keys="n"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchAgainPreviousAction" mappingModes="NXO" keys="N"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction" mappingModes="NXO" keys="*"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordBackwardAction" mappingModes="NXO" keys="#"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWordForwardAction" mappingModes="NXO" keys="g*"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.SearchWordBackwardAction" mappingModes="NXO" keys="g#"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.search.GotoDeclarationAction" mappingModes="NX" keys="gD,gd,«C-]»"/>
|
||||
|
||||
<!-- Macro -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.macro.ToggleRecordingAction" mappingModes="NX" keys="q"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.macro.PlaybackRegisterAction" mappingModes="N" keys="@"/>
|
||||
|
||||
<!-- Command Line -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" mappingModes="C"/>
|
||||
|
||||
<!-- Other -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" mappingModes="N" keys="&"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.change.ChangeLastGlobalSearchReplaceAction" mappingModes="N" keys="g&"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.RepeatChangeAction" mappingModes="N" keys="."/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.ExEntryAction" mappingModes="NXO" keys=":"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.ResetModeAction" mappingModes="ALL" keys="«C-\»«C-N»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.RedoAction" mappingModes="N" keys="«C-R»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.UndoAction" mappingModes="N"/>
|
||||
|
||||
<!-- Keys -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.change.OperatorAction" mappingModes="N" keys="g@"/>
|
||||
|
||||
<!-- Visual Selection of last Search Pattern (gn) -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.VisualSelectNextSearch" mappingModes="NX" keys="gn"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.VisualSelectPreviousSearch" mappingModes="NX" keys="gN"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.GnNextTextObject" mappingModes="O" keys="gn"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.gn.GnPreviousTextObject" mappingModes="O" keys="gN"/>
|
||||
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.CtrlDownAction" mappingModes="N" keys="«C-Down»"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.motion.scroll.CtrlUpAction" mappingModes="N" keys="«C-Up»"/>
|
||||
|
||||
<!-- Folds -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseAllRegions" mappingModes="NX" keys="zM"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseRegion" mappingModes="NX" keys="zc"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimCollapseRegionRecursively" mappingModes="NX" keys="zC"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandAllRegions" mappingModes="NX" keys="zR"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandRegion" mappingModes="NX" keys="zo"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.fold.VimExpandRegionRecursively" mappingModes="NX" keys="zO"/>
|
||||
|
||||
<!-- Editor Actions -->
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorBackSpace" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorDelete" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorDown" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorTab" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimEditorUp" mappingModes="I"/>
|
||||
<vimAction implementation="com.maddyhome.idea.vim.action.editor.VimQuickJavaDoc" mappingModes="N" keys="K"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
64
resources/META-INF/VimExCommands.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="IdeaVIM">
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ActionListHandler" names="actionlist"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.AsciiHandler" names="as[cii]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdFilterHandler" names="!"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdHandler" names="com[mand]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CmdClearHandler" names="comc[lear]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.CopyTextHandler" names="co[py],t"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DelCmdHandler" names="delc[ommand]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DeleteLinesHandler" names="d[elete]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DeleteMarksHandler" names="delm[arks]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DigraphHandler" names="dig[raphs]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.DumpLineHandler" names="dump[line]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.EditFileHandler" names="bro[wse],e[dit]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ActionHandler" names="action"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.EchoHandler" names="ec[ho]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ExitHandler" names="qa[ll],quita[ll],wqa[ll],xa[ll]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindClassHandler" names="cla[ss]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindFileHandler" names="fin[d]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.FindSymbolHandler" names="sym[bol]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.GotoCharacterHandler" names="go[to]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.HelpHandler" names="h[elp]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.HistoryHandler" names="his[tory]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JoinLinesHandler" names="j[oin]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.JumpsHandler" names="ju[mps]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.LetHandler" names="let"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MapHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarkHandler" names="ma[rk],k"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MarksHandler" names="marks"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.MoveTextHandler" names="m[ove]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NextFileHandler" names="n[ext]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NoHLSearchHandler" names="noh[lsearch]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.OnlyHandler" names="on[ly]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PreviousFileHandler" names="N[ext],prev[ious]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PromptFindHandler" names="pro[mptfind]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PromptReplaceHandler" names="promptr[epl]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PutLinesHandler" names="pu[t]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.QuitHandler" names="q[uit],clo[se],hid[e]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RedoHandler" names="red[o]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RegistersHandler" names="di[splay],reg[isters]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.RepeatHandler" names="@"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectFileHandler" names="argu[ment]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectFirstFileHandler" names="fir[st],rew[ind]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SelectLastFileHandler" names="la[st]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SetHandler" names="se[t]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShiftLeftHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShiftRightHandler"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SourceHandler" names="so[urce]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SortHandler" names="sor[t]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SplitHandler" names="vs[plit],sp[lit]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.SubstituteHandler" names="s[ubstitute],&,~"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.UndoHandler" names="u[ndo]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteAllHandler" names="wa[ll]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteHandler" names="w[rite]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteNextFileHandler" names="wn[ext]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WritePreviousFileHandler" names="wN[ext],wp[revious]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.WriteQuitHandler" names="wq,exi[t],x[it]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.YankLinesHandler" names="y[ank]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.ShellHandler" names="sh[ell]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.NextTabHandler" names="tabn[ext]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.PreviousTabHandler" names="tabp[revious],tabN[ext]"/>
|
||||
<vimExCommand implementation="com.maddyhome.idea.vim.ex.handler.TabOnlyHandler" names="tabo[nly]"/>
|
||||
</extensions>
|
||||
</idea-plugin>
|
7
resources/META-INF/VimExtensions.xml
Normal file
@@ -0,0 +1,7 @@
|
||||
<idea-plugin>
|
||||
<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>
|
||||
</idea-plugin>
|
@@ -1,17 +1,11 @@
|
||||
<idea-plugin url="http://plugins.jetbrains.com/plugin/164">
|
||||
<idea-plugin url="https://plugins.jetbrains.com/plugin/164" xmlns:xi="http://www.w3.org/2001/XInclude">
|
||||
<name>IdeaVim</name>
|
||||
<id>IdeaVIM</id>
|
||||
<change-notes><![CDATA[
|
||||
<ul>
|
||||
<li>Support select mode</li>
|
||||
<li>Integration with templates & in-line refactorings using Select mode</li>
|
||||
<li>Support "Extend selection" action in visual mode</li>
|
||||
<li>Commentary extension</li>
|
||||
<li>Add options to integrate paste/join/marks with the IDE</li>
|
||||
<li>Support 'gn' commands</li>
|
||||
<li>Support :command command</li>
|
||||
<li>Support :shell command</li>
|
||||
<li>Support :tabnext and :tabprevious commands</li>
|
||||
<li>Support dot command for Surround and Commentary extensions</li>
|
||||
<li>Support XDG settings standard</li>
|
||||
<li>Add option to remove the status bar icon</li>
|
||||
<li>Various bug fixes</li>
|
||||
</ul>
|
||||
<p>See also the complete <a href="https://github.com/JetBrains/ideavim/blob/master/CHANGES.md">changelog</a>.</p>
|
||||
@@ -22,13 +16,15 @@
|
||||
<p>See also:</p>
|
||||
<ul>
|
||||
<li><a href="https://github.com/JetBrains/ideavim">GitHub repository</a>: documentation and contributing</li>
|
||||
<li><a href="http://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
||||
<li><a href="https://youtrack.jetbrains.com/issues/VIM">Issue tracker</a>: feature requests and bug reports</li>
|
||||
</ul>
|
||||
]]></description>
|
||||
<version>SNAPSHOT</version>
|
||||
<vendor>JetBrains</vendor>
|
||||
|
||||
<idea-version since-build="183.2940.10"/>
|
||||
<!-- Please search for "[VERSION UPDATE]" in project in case you update the since-build version -->
|
||||
<!-- Check for [Version Update] tag in YouTrack as well -->
|
||||
<idea-version since-build="183.4284.148"/>
|
||||
|
||||
<!-- Mark the plugin as compatible with RubyMine and other products based on the IntelliJ platform -->
|
||||
<depends>com.intellij.modules.lang</depends>
|
||||
@@ -49,372 +45,37 @@
|
||||
</project-components>
|
||||
|
||||
<extensionPoints>
|
||||
<extensionPoint qualifiedName="IdeaVIM.vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||
<extensionPoint name="vimExtension" interface="com.maddyhome.idea.vim.extension.VimExtension"/>
|
||||
|
||||
<extensionPoint name="vimExCommand" beanClass="com.maddyhome.idea.vim.ex.ExBeanClass">
|
||||
<with attribute="implementation" implements="com.maddyhome.idea.vim.ex.CommandHandler"/>
|
||||
</extensionPoint>
|
||||
<extensionPoint name="vimAction" beanClass="com.maddyhome.idea.vim.handler.ActionBeanClass">
|
||||
<with attribute="implementation" implements="com.maddyhome.idea.vim.handler.EditorActionHandlerBase"/>
|
||||
</extensionPoint>
|
||||
</extensionPoints>
|
||||
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
<applicationConfigurable groupId="editor" instance="com.maddyhome.idea.vim.ui.VimEmulationConfigurable"/>
|
||||
|
||||
<projectService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||
<applicationService serviceImplementation="com.maddyhome.idea.vim.group.NotificationService"/>
|
||||
<statusBarWidgetProvider implementation="com.maddyhome.idea.vim.StatusBarIconProvider"/>
|
||||
</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>
|
||||
<xi:include href="/META-INF/ApplicationServices.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
|
||||
<xi:include href="/META-INF/VimActions.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
<xi:include href="/META-INF/VimExCommands.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
<xi:include href="/META-INF/VimExtensions.xml" xpointer="xpointer(/idea-plugin/*)"/>
|
||||
|
||||
<actions>
|
||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction" text="Vim Emulator" description="Toggle the Vim Plugin On/Off">
|
||||
<keyboard-shortcut first-keystroke="control alt V" keymap="$default"/>
|
||||
<action id="VimPluginToggle" class="com.maddyhome.idea.vim.action.VimPluginToggleAction" text="Vim Emulator" description="Toggle the vim plugin On/off">
|
||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||
</action>
|
||||
|
||||
<!-- Motions -->
|
||||
<action id="VimMotionPreviousTab" class="com.maddyhome.idea.vim.action.motion.tabs.MotionPreviousTabAction" text="Move to Previous Tab"/>
|
||||
<action id="VimMotionNextTab" class="com.maddyhome.idea.vim.action.motion.tabs.MotionNextTabAction" text="Move to Next Tab"/>
|
||||
<!-- Left/Right -->
|
||||
<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="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="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="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="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="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="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="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="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="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="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="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 -->
|
||||
<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="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="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="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="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="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 -->
|
||||
<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="VimMotionCamelLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelLeftAction" text="Camel Word Left"/>
|
||||
<action id="VimMotionCamelRight" class="com.maddyhome.idea.vim.action.motion.text.MotionCamelRightAction" text="Camel Word Right"/>
|
||||
<action id="VimMotionNthCharacter" class="com.maddyhome.idea.vim.action.motion.text.MotionNthCharacterAction" text="Nth Character"/>
|
||||
<action id="VimMotionWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionWordEndLeftAction" text="Word End Left"/>
|
||||
<action id="VimMotionBigWordEndLeft" class="com.maddyhome.idea.vim.action.motion.text.MotionBigWordEndLeftAction" text="BigWord End Left"/>
|
||||
<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="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="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="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="VimMotionSentenceEndNext" class="com.maddyhome.idea.vim.action.motion.text.MotionSentenceNextEndAction" text="Next Sentence End"/>
|
||||
<action id="VimMotionSentenceEndPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionSentencePreviousEndAction" text="Previous Sentence End"/>
|
||||
<action id="VimMotionParagraphNext" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphNextAction" text="Next Paragraph"/>
|
||||
<action id="VimMotionParagraphPrevious" class="com.maddyhome.idea.vim.action.motion.text.MotionParagraphPreviousAction" text="Previous Paragraph"/>
|
||||
<action id="VimMotionUnmatchedBraceClose" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceCloseAction" text="Unmatched }"/>
|
||||
<action id="VimMotionUnmatchedBraceOpen" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedBraceOpenAction" text="Unmatched {"/>
|
||||
<action id="VimMotionUnmatchedParenClose" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenCloseAction" text="Unmatched )"/>
|
||||
<action id="VimMotionUnmatchedParenOpen" class="com.maddyhome.idea.vim.action.motion.text.MotionUnmatchedParenOpenAction" text="Unmatched ("/>
|
||||
<action id="VimMotionSectionBackwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardEndAction" text="Section End Backward"/>
|
||||
<action id="VimMotionSectionBackwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionBackwardStartAction" text="Section Start Backward"/>
|
||||
<action id="VimMotionSectionForwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardEndAction" text="Section End Forward"/>
|
||||
<action id="VimMotionSectionForwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionSectionForwardStartAction" text="Section Start Forward"/>
|
||||
<action id="VimMotionMethodBackwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousEndAction" text="Previous Method End"/>
|
||||
<action id="VimMotionMethodBackwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodPreviousStartAction" text="Previous Method Start"/>
|
||||
<action id="VimMotionMethodForwardEnd" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextEndAction" text="Next Method End"/>
|
||||
<action id="VimMotionMethodForwardStart" class="com.maddyhome.idea.vim.action.motion.text.MotionMethodNextStartAction" text="Next Method Start"/>
|
||||
<!-- Text Objects -->
|
||||
<action id="VimMotionTextOuterWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterWordAction" text="Select outer word"/>
|
||||
<action id="VimMotionTextOuterBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBigWordAction" text="Select outer WORD"/>
|
||||
<action id="VimMotionTextInnerWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerWordAction" text="Select inner word"/>
|
||||
<action id="VimMotionTextInnerBigWord" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBigWordAction" text="Select inner WORD"/>
|
||||
<action id="VimMotionInnerBlockAngle" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockAngleAction" text="Select inner < block"/>
|
||||
<action id="VimMotionInnerBlockBrace" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBraceAction" text="Select inner { block"/>
|
||||
<action id="VimMotionInnerBlockBracket" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockBracketAction" text="Select inner [ block"/>
|
||||
<action id="VimMotionInnerBlockParen" class="com.maddyhome.idea.vim.action.motion.object.MotionInnerBlockParenAction" text="Select inner ( 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="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="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="VimMotionOuterBlockParen" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterBlockParenAction" text="Select outer ( 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="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="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="VimMotionOuterSentence" class="com.maddyhome.idea.vim.action.motion.object.MotionOuterSentenceAction" text="Select Outer Sentence"/>
|
||||
<!-- Marks -->
|
||||
<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="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="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="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="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="VimMotionJumpPrevious" class="com.maddyhome.idea.vim.action.motion.mark.MotionJumpPreviousAction" text="Goto Previous Jump"/>
|
||||
<!-- Screen -->
|
||||
<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="VimMotionMiddleScreenLine" class="com.maddyhome.idea.vim.action.motion.screen.MotionMiddleScreenLineAction" text="Middle Screen Line"/>
|
||||
<!-- Scroll -->
|
||||
<action id="VimMotionScrollFirstScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLinePageStartAction" text="Scroll Line to Top"/>
|
||||
<action id="VimMotionScrollFirstScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineStartAction" text="Scroll Line to Top"/>
|
||||
<action id="VimMotionScrollFirstScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollFirstScreenLineAction" text="Scroll Line to Top"/>
|
||||
<action id="VimMotionScrollHalfPageDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageDownAction" text="Scroll Half Page Down"/>
|
||||
<action id="VimMotionScrollHalfPageUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollHalfPageUpAction" text="Scroll Half Page Up"/>
|
||||
<action id="VimMotionScrollLastScreenLine" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineAction" text="Scroll Line to Bottom"/>
|
||||
<action id="VimMotionScrollLastScreenLinePageStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLinePageStartAction" text="Scroll Line to Bottom"/>
|
||||
<action id="VimMotionScrollLastScreenLineStart" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLastScreenLineStartAction" text="Scroll Line to Bottom"/>
|
||||
<action id="VimMotionScrollLineDown" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineDownAction" text="Scroll Line Down"/>
|
||||
<action id="VimMotionScrollLineUp" class="com.maddyhome.idea.vim.action.motion.scroll.MotionScrollLineUpAction" text="Scroll Line Up"/>
|
||||
<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="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="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="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="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 -->
|
||||
<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="VimVisualToggleLineMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleLineModeAction" text="Toggle Line Selection"/>
|
||||
<action id="VimVisualToggleBlockMode" class="com.maddyhome.idea.vim.action.motion.visual.VisualToggleBlockModeAction" text="Toggle Block Selection"/>
|
||||
<action id="VimVisualSwapEnds" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsAction" text="Swap Visual Selection Ends"/>
|
||||
<action id="VimVisualSwapEndsBlock" class="com.maddyhome.idea.vim.action.motion.visual.VisualSwapEndsBlockAction" text="Swap Visual Selection Ends"/>
|
||||
<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"/>
|
||||
|
||||
<!-- 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 -->
|
||||
<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="VimInsertAtPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertAtPreviousInsertAction" text="Insert Before Cursor"/>
|
||||
<action id="VimInsertBeforeCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeCursorAction" text="Insert Before Cursor"/>
|
||||
<action id="VimInsertBeforeFirstNonBlank" class="com.maddyhome.idea.vim.action.change.insert.InsertBeforeFirstNonBlankAction" text="Insert Before First non-Blank"/>
|
||||
<action id="VimInsertCharacterAboveCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterAboveCursorAction" text="Insert Character Above Cursor"/>
|
||||
<action id="VimInsertCharacterBelowCursor" class="com.maddyhome.idea.vim.action.change.insert.InsertCharacterBelowCursorAction" text="Insert Character Below Cursor"/>
|
||||
<action id="VimInsertDeleteInsertedText" class="com.maddyhome.idea.vim.action.change.insert.InsertDeleteInsertedTextAction" text="Delete Inserted Text"/>
|
||||
<action id="VimInsertDeletePreviousWord" class="com.maddyhome.idea.vim.action.change.insert.InsertDeletePreviousWordAction" text="Delete Previous Word"/>
|
||||
<action id="VimInsertEnter" class="com.maddyhome.idea.vim.action.change.insert.InsertEnterAction" text="Enter"/>
|
||||
<action id="VimInsertExitMode" class="com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction" text="Exit Insert Mode"/>
|
||||
<action id="VimInsertLineStart" class="com.maddyhome.idea.vim.action.change.insert.InsertLineStartAction" text="Insert at Line Start"/>
|
||||
<action id="VimInsertNewLineAbove" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineAboveAction" text="Insert New Line Above"/>
|
||||
<action id="VimInsertNewLineBelow" class="com.maddyhome.idea.vim.action.change.insert.InsertNewLineBelowAction" text="Insert New Line Below"/>
|
||||
<action id="VimInsertPreviousInsert" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertAction" text="Insert Previous Text"/>
|
||||
<action id="VimInsertPreviousInsertExit" class="com.maddyhome.idea.vim.action.change.insert.InsertPreviousInsertExitAction" text="Insert Previous Text"/>
|
||||
<action id="VimInsertRegister" class="com.maddyhome.idea.vim.action.change.insert.InsertRegisterAction" text="Insert Register"/>
|
||||
<action id="VimInsertReplaceToggle" class="com.maddyhome.idea.vim.action.change.insert.InsertInsertAction" text="Toggle Insert/Replace"/>
|
||||
<action id="VimInsertSingleCommand" class="com.maddyhome.idea.vim.action.change.insert.InsertSingleCommandAction" text="Execute Command"/>
|
||||
<action id="VimVisualBlockInsert" class="com.maddyhome.idea.vim.action.change.insert.VisualBlockInsertAction" text="Visual Block Insert"/>
|
||||
<action id="VimVisualBlockAppend" class="com.maddyhome.idea.vim.action.change.insert.VisualBlockAppendAction" text="Visual Block Append"/>
|
||||
|
||||
<!-- Delete -->
|
||||
<action id="VimDeleteCharacter" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterAction" text="Delete Character"/>
|
||||
<action id="VimDeleteCharacterLeft" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterLeftAction" text="Delete Character Left"/>
|
||||
<action id="VimDeleteCharacterRight" class="com.maddyhome.idea.vim.action.change.delete.DeleteCharacterRightAction" text="Delete Character Right"/>
|
||||
<action id="VimDeleteEndOfLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteEndOfLineAction" text="Delete End-of-Line"/>
|
||||
<action id="VimDeleteJoinLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinLinesSpacesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteJoinVisualLinesSpaces" class="com.maddyhome.idea.vim.action.change.delete.DeleteJoinVisualLinesSpacesAction" text="Delete Join Lines"/>
|
||||
<action id="VimDeleteLine" class="com.maddyhome.idea.vim.action.change.delete.DeleteLineAction" text="Delete Line"/>
|
||||
<action id="VimDeleteMotion" class="com.maddyhome.idea.vim.action.change.delete.DeleteMotionAction" text="Delete Motion"/>
|
||||
<action id="VimDeleteVisual" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualAction" text="Delete Selection"/>
|
||||
<action id="VimDeleteVisualLines" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesAction" text="Delete Selected Lines"/>
|
||||
<action id="VimDeleteVisualLinesEnd" class="com.maddyhome.idea.vim.action.change.delete.DeleteVisualLinesEndAction" text="Delete Selected Lines"/>
|
||||
|
||||
<!-- Change -->
|
||||
<action id="VimChangeCaseLowerMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerMotionAction" text="Change Motion to Lower Case"/>
|
||||
<action id="VimChangeCaseLowerVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseLowerVisualAction" text="Change Motion to Lower Case"/>
|
||||
<action id="VimChangeCaseToggleCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleCharacterAction" text="Change Toggle Case"/>
|
||||
<action id="VimChangeCaseToggleMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleMotionAction" text="Change Motion Toggle Case"/>
|
||||
<action id="VimChangeCaseToggleVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseToggleVisualAction" text="Change Motion Toggle Case"/>
|
||||
<action id="VimChangeCaseUpperMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperMotionAction" text="Change Motion to Upper Case"/>
|
||||
<action id="VimChangeCaseUpperVisual" class="com.maddyhome.idea.vim.action.change.change.ChangeCaseUpperVisualAction" text="Change Motion to Upper Case"/>
|
||||
<action id="VimChangeCharacter" class="com.maddyhome.idea.vim.action.change.change.ChangeCharacterAction" text="Change Character"/>
|
||||
<action id="VimChangeCharacters" class="com.maddyhome.idea.vim.action.change.change.ChangeCharactersAction" text="Change Characters"/>
|
||||
<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="VimChangeMotion" class="com.maddyhome.idea.vim.action.change.change.ChangeMotionAction" text="Change Motion"/>
|
||||
<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.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="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="VimChangeVisualLines" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesAction" text="Change Motion"/>
|
||||
<action id="VimChangeVisualLinesEnd" class="com.maddyhome.idea.vim.action.change.change.ChangeVisualLinesEndAction" text="Change Motion"/>
|
||||
<action id="VimFilterMotion" class="com.maddyhome.idea.vim.action.change.change.FilterMotionAction" text="Filter Lines"/>
|
||||
<action id="VimFilterCountLines" class="com.maddyhome.idea.vim.action.change.change.FilterCountLinesAction" text="Filter Lines"/>
|
||||
<action id="VimFilterVisualLines" class="com.maddyhome.idea.vim.action.change.change.FilterVisualLinesAction" text="Filter Visual Lines"/>
|
||||
<action id="VimAutoIndentVisual" class="com.maddyhome.idea.vim.action.change.change.AutoIndentLinesVisualAction" text="Auto Indent Selection"/>
|
||||
<action id="VimReformatVisual" class="com.maddyhome.idea.vim.action.change.change.ReformatCodeVisualAction" text="Reformat Selection"/>
|
||||
|
||||
<!-- Shift -->
|
||||
<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="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="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="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="VimShiftRightVisual" class="com.maddyhome.idea.vim.action.change.shift.ShiftRightVisualAction" text="Shift Visual Right"/>
|
||||
|
||||
<!-- Copy -->
|
||||
<action id="VimCopyPutTextAfterCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorAction" text="Put Text"/>
|
||||
<action id="VimCopyPutTextBeforeCursor" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorAction" text="Put Text"/>
|
||||
<action id="VimCopyPutTextAfterCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorNoIndentAction" text="Put Text"/>
|
||||
<action id="VimCopyPutTextBeforeCursorNoIndent" class="com.maddyhome.idea.vim.action.copy.PutTextBeforeCursorNoIndentAction" text="Put Text"/>
|
||||
<action id="VimCopyPutTextAfterCursorMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutTextAfterCursorActionMoveCursor" 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="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="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="VimVisualPutText" class="com.maddyhome.idea.vim.action.copy.PutVisualTextAction" text="Paste over Selection"/>
|
||||
<action id="VimVisualPutTextNoIndent" class="com.maddyhome.idea.vim.action.copy.PutVisualTextNoIndentAction" text="Paste over Selection"/>
|
||||
<action id="VimVisualPutTextMoveCursor" class="com.maddyhome.idea.vim.action.copy.PutVisualTextMoveCursorAction" text="Paste over Selection"/>
|
||||
|
||||
<!-- File -->
|
||||
<action id="VimFileSaveClose" class="com.maddyhome.idea.vim.action.file.FileSaveCloseAction" text="Save and Close Editor"/>
|
||||
<action id="VimFilePrevious" class="com.maddyhome.idea.vim.action.file.FilePreviousAction" text="Selects Previous Editor"/>
|
||||
<action id="VimFileGetAscii" class="com.maddyhome.idea.vim.action.file.FileGetAsciiAction" text="Get ASCII Info"/>
|
||||
<action id="VimFileGetHex" class="com.maddyhome.idea.vim.action.file.FileGetHexAction" text="Get Hex Info"/>
|
||||
<action id="VimFileGetFileInfo" class="com.maddyhome.idea.vim.action.file.FileGetFileInfoAction" text="Get File Info"/>
|
||||
<action id="VimFileGetLocationInfo" class="com.maddyhome.idea.vim.action.file.FileGetLocationInfoAction" text="Get Location Info"/>
|
||||
|
||||
<!-- Window -->
|
||||
<action id="VimWindowSplitVertical" class="com.maddyhome.idea.vim.action.window.VerticalSplitAction" text="Split window vertically"/>
|
||||
<action id="VimWindowSplitHorizontal" class="com.maddyhome.idea.vim.action.window.HorizontalSplitAction" text="Split window horizontally"/>
|
||||
<action id="VimWindowClose" class="com.maddyhome.idea.vim.action.window.CloseWindowAction" text="Close current window"/>
|
||||
<action id="VimWindowOnly" class="com.maddyhome.idea.vim.action.window.WindowOnlyAction" text="Close all windows except current"/>
|
||||
<action id="VimWindowNext" class="com.maddyhome.idea.vim.action.window.WindowNextAction" text="Select next window"/>
|
||||
<action id="VimWindowPrev" class="com.maddyhome.idea.vim.action.window.WindowPrevAction" text="Select previous window"/>
|
||||
<action id="VimWindowLeft" class="com.maddyhome.idea.vim.action.window.WindowLeftAction" text="Go to left window"/>
|
||||
<action id="VimWindowRight" class="com.maddyhome.idea.vim.action.window.WindowRightAction" text="Go to right window"/>
|
||||
<action id="VimWindowUp" class="com.maddyhome.idea.vim.action.window.WindowUpAction" text="Go to window up"/>
|
||||
<action id="VimWindowDown" class="com.maddyhome.idea.vim.action.window.WindowDownAction" text="Go to window down"/>
|
||||
|
||||
<!-- Search -->
|
||||
<action id="VimSearchFwdEntry" class="com.maddyhome.idea.vim.action.motion.search.SearchEntryFwdAction" text="Search Forward"/>
|
||||
<action id="VimSearchRevEntry" class="com.maddyhome.idea.vim.action.motion.search.SearchEntryRevAction" text="Search Backward"/>
|
||||
<action id="VimSearchAgainNext" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainNextAction" text="Search Again"/>
|
||||
<action id="VimSearchAgainPrevious" class="com.maddyhome.idea.vim.action.motion.search.SearchAgainPreviousAction" text="Search Again"/>
|
||||
<action id="VimSearchWholeWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordForwardAction" text="Search Again"/>
|
||||
<action id="VimSearchWholeWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWholeWordBackwardAction" text="Search Again"/>
|
||||
<action id="VimSearchWordForward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordForwardAction" text="Search Again"/>
|
||||
<action id="VimSearchWordBackward" class="com.maddyhome.idea.vim.action.motion.search.SearchWordBackwardAction" text="Search Again"/>
|
||||
<action id="VimGotoDeclaration" class="com.maddyhome.idea.vim.action.motion.search.GotoDeclarationAction" text="Goto Declaration"/>
|
||||
|
||||
<!-- Macro -->
|
||||
<action id="VimToggleRecording" class="com.maddyhome.idea.vim.action.macro.ToggleRecordingAction" text="Record Keystrokes"/>
|
||||
<action id="VimPlaybackRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackRegisterAction" text="Playback Register"/>
|
||||
<action id="VimPlaybackLastRegister" class="com.maddyhome.idea.vim.action.macro.PlaybackLastRegisterAction" text="Playback Last Register"/>
|
||||
|
||||
<!-- Command Line -->
|
||||
<action id="VimProcessExEntry" class="com.maddyhome.idea.vim.action.ex.ProcessExEntryAction" text="Process Ex Entry"/>
|
||||
|
||||
<!-- Other -->
|
||||
<action id="VimLastSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastSearchReplaceAction" text="Repeat Last :s"/>
|
||||
<action id="VimLastGlobalSearchReplace" class="com.maddyhome.idea.vim.action.change.change.ChangeLastGlobalSearchReplaceAction" text="Repeat Last :s"/>
|
||||
<action id="VimRepeatChange" class="com.maddyhome.idea.vim.action.change.RepeatChangeAction" text="Repeat Change"/>
|
||||
<action id="VimRepeatExCommand" class="com.maddyhome.idea.vim.action.change.RepeatExCommandAction" text="Repeat Ex Command"/>
|
||||
<action id="VimExEntry" class="com.maddyhome.idea.vim.action.ExEntryAction" text="Enter Ex Command"/>
|
||||
<action id="VimResetMode" class="com.maddyhome.idea.vim.action.ResetModeAction" text="Reset Mode"/>
|
||||
<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"/>
|
||||
|
||||
<!-- Internal -->
|
||||
<action id="VimInternalAddInlays" class="com.maddyhome.idea.vim.action.internal.AddInlaysAction" text="Add test inlays | IdeaVim internal" internal="true"/>
|
||||
<action id="VimInternalAddInlays" class="com.maddyhome.idea.vim.action.internal.AddInlaysAction" text="Add Test Inlays | IdeaVim Internal" internal="true"/>
|
||||
|
||||
<!-- Keys -->
|
||||
<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"/>
|
||||
<action id="VimActions" class="com.maddyhome.idea.vim.VimActions" text="Vim Actions"/>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
9
resources/META-INF/pluginIcon.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40">
|
||||
<defs>
|
||||
<linearGradient id="ideavim_plugin-a" x1="-6.748%" x2="47.286%" y1="33.61%" y2="85.907%">
|
||||
<stop offset="0%" stop-color="#3BEA62"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<polygon fill="url(#ideavim_plugin-a)" fill-rule="evenodd" points="28.019 4 15.988 24.119 15.988 4 4 4 4 36 17.953 36 36 4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 450 B |
BIN
resources/icons/github-off.png
Normal file
After Width: | Height: | Size: 638 B |
BIN
resources/icons/github.png
Normal file
After Width: | Height: | Size: 364 B |
4
resources/icons/github.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||
<path
|
||||
d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
||||
</svg>
|
After Width: | Height: | Size: 824 B |
9
resources/icons/ideavim.svg
Normal file
@@ -0,0 +1,9 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40">
|
||||
<defs>
|
||||
<linearGradient id="ideavim_plugin-a" x1="-6.748%" x2="47.286%" y1="33.61%" y2="85.907%">
|
||||
<stop offset="0%" stop-color="#3BEA62"/>
|
||||
<stop offset="100%" stop-color="#087CFA"/>
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<polygon fill="url(#ideavim_plugin-a)" fill-rule="evenodd" points="28.019 4 15.988 24.119 15.988 4 4 4 4 36 17.953 36 36 4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 450 B |
3
resources/icons/ideavim_disabled.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40">
|
||||
<polygon fill="#6E6E6E" fill-rule="evenodd" points="28.019 4 15.988 24.119 15.988 4 4 4 4 36 17.953 36 36 4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 204 B |
3
resources/icons/ideavim_disabled_dark.svg
Normal file
@@ -0,0 +1,3 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 40 40">
|
||||
<polygon fill="#AFB1B3" fill-rule="evenodd" points="28.019 4 15.988 24.119 15.988 4 4 4 4 36 17.953 36 36 4"/>
|
||||
</svg>
|
After Width: | Height: | Size: 204 B |
BIN
resources/icons/mail.png
Normal file
After Width: | Height: | Size: 282 B |
4
resources/icons/twitter.svg
Normal file
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" width="16" height="16" fill="#000000">
|
||||
<path fill="#1DA1F2" d="M 25.855469 5.574219 C 24.914063 5.992188 23.902344 6.273438 22.839844 6.402344 C 23.921875 5.75 24.757813 4.722656 25.148438 3.496094 C 24.132813 4.097656 23.007813 4.535156 21.8125 4.769531 C 20.855469 3.75 19.492188 3.113281 17.980469 3.113281 C 15.082031 3.113281 12.730469 5.464844 12.730469 8.363281 C 12.730469 8.773438 12.777344 9.175781 12.867188 9.558594 C 8.503906 9.339844 4.636719 7.246094 2.046875 4.070313 C 1.59375 4.847656 1.335938 5.75 1.335938 6.714844 C 1.335938 8.535156 2.261719 10.140625 3.671875 11.082031 C 2.808594 11.054688 2 10.820313 1.292969 10.425781 C 1.292969 10.449219 1.292969 10.46875 1.292969 10.492188 C 1.292969 13.035156 3.101563 15.15625 5.503906 15.640625 C 5.0625 15.761719 4.601563 15.824219 4.121094 15.824219 C 3.78125 15.824219 3.453125 15.792969 3.132813 15.730469 C 3.800781 17.8125 5.738281 19.335938 8.035156 19.375 C 6.242188 20.785156 3.976563 21.621094 1.515625 21.621094 C 1.089844 21.621094 0.675781 21.597656 0.265625 21.550781 C 2.585938 23.039063 5.347656 23.90625 8.3125 23.90625 C 17.96875 23.90625 23.25 15.90625 23.25 8.972656 C 23.25 8.742188 23.246094 8.515625 23.234375 8.289063 C 24.261719 7.554688 25.152344 6.628906 25.855469 5.574219"/>
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
49
resources/icons/youtrack.svg
Normal file
@@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||
width="16" height="16" viewBox="0 0 70 70" style="enable-background:new 0 0 70 70;" xml:space="preserve">
|
||||
<g>
|
||||
<g>
|
||||
<g>
|
||||
|
||||
<linearGradient id="SVGID_1_" gradientUnits="userSpaceOnUse" x1="7.083" y1="16.2945" x2="64.1058" y2="42.2878" gradientTransform="matrix(1 0 0 -1 0 71.0471)">
|
||||
<stop offset="0" style="stop-color:#7863AB"/>
|
||||
<stop offset="0.1649" style="stop-color:#6572B6"/>
|
||||
<stop offset="0.3776" style="stop-color:#538FCC"/>
|
||||
<stop offset="0.5401" style="stop-color:#3DA5DD"/>
|
||||
<stop offset="0.6317" style="stop-color:#35ADE3"/>
|
||||
</linearGradient>
|
||||
<path style="fill:url(#SVGID_1_);" d="M66.9,47.5c-0.2-0.2-13.1-12.6-13.1-12.6s9.8-10.4,12.4-13c0.8-0.8,1.5-1.6,2-2.6
|
||||
c3.6-6.1,1.5-13.9-4.6-17.5c-4.5-2.6-10.1-2.2-14.1,0.8c-0.7,0.5-1.3,1-1.9,1.6C47.3,4.6,33.7,17,21.9,27.8l22.1,14L20.8,67.9
|
||||
c-1.4,1-2.8,1.6-4.3,1.9c0.3,0,0.5,0,0.8-0.1c4.6-0.7,43.9-7.3,45.8-7.7c2.3-0.4,4.4-1.8,5.7-3.9C71,54.5,70,50,66.9,47.5z"/>
|
||||
|
||||
<linearGradient id="SVGID_2_" gradientUnits="userSpaceOnUse" x1="30.31" y1="42.9162" x2="1.0679" y2="68.7442" gradientTransform="matrix(1 0 0 -1 0 71.0471)">
|
||||
<stop offset="0" style="stop-color:#7863AB"/>
|
||||
<stop offset="7.176042e-002" style="stop-color:#895EA7"/>
|
||||
<stop offset="0.2523" style="stop-color:#C34F9D"/>
|
||||
<stop offset="0.3901" style="stop-color:#ED3995"/>
|
||||
<stop offset="0.4677" style="stop-color:#EE3B8B"/>
|
||||
</linearGradient>
|
||||
<path style="fill:url(#SVGID_2_);" d="M45.9,30.5c-0.4-2.7-1.8-4.9-3.8-6.5C40,22.4,23.8,5.6,22,3.7C19.2,1,15.2-0.5,11.1,0.2
|
||||
C4.1,1.2-0.8,7.8,0.3,14.8c0.5,3.5,2.5,6.5,5.1,8.4c2.6,2,23,16,24.3,17c2.1,1.6,4.9,2.5,7.7,2C42.9,41.2,46.8,36,45.9,30.5z"/>
|
||||
</g>
|
||||
|
||||
<linearGradient id="SVGID_3_" gradientUnits="userSpaceOnUse" x1="4.9829" y1="12.3617" x2="74.0226" y2="55.8638" gradientTransform="matrix(1 0 0 -1 0 71.0471)">
|
||||
<stop offset="0" style="stop-color:#7863AB"/>
|
||||
<stop offset="0.1649" style="stop-color:#6572B6"/>
|
||||
<stop offset="0.3776" style="stop-color:#538FCC"/>
|
||||
<stop offset="0.5401" style="stop-color:#3DA5DD"/>
|
||||
<stop offset="0.6317" style="stop-color:#35ADE3"/>
|
||||
</linearGradient>
|
||||
<path style="fill:url(#SVGID_3_);" d="M23,67.8c0.1,0,23.3-26.1,23.3-26.1L22.9,26.9c-8.3,7.6-16,14.5-17.8,16.2
|
||||
c-1.1,1-2.2,2.3-3,3.7c-4.3,7.4-1.8,16.8,5.6,21.1C10.7,69.6,17.5,71.7,23,67.8z"/>
|
||||
</g>
|
||||
<g>
|
||||
<rect x="13.4" y="13.4" style="fill:#231F20;" width="43.2" height="43.2"/>
|
||||
<rect x="17.4" y="48.5" style="fill:#FFFFFF;" width="16.2" height="2.7"/>
|
||||
<polygon style="fill:#FFFFFF;" points="23.8,29.9 17,19.1 21.6,19.1 25.8,26.2 30.2,19.1 34.7,19.1 27.8,29.8 27.8,37 23.8,37
|
||||
"/>
|
||||
<polygon style="fill:#FFFFFF;" points="41.6,22.7 36.1,22.7 36.1,19.1 51,19.1 51,22.7 45.5,22.7 45.5,37 41.6,37 "/>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 3.0 KiB |
@@ -13,7 +13,7 @@
|
||||
# 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/>.
|
||||
# along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
notexcmd=Not an editor command: {0}
|
||||
@@ -23,6 +23,7 @@ e_badrange=Unexpected character ''{0}'' in range
|
||||
e_norange=No range allowed
|
||||
e_rangereq=Range required
|
||||
e_argreq=Argument required
|
||||
e_argforb=Argument forbidden
|
||||
e_noprev=E34: No previous command
|
||||
e_nopresub=E33: No previous substitute regular expression
|
||||
E191=E191: Argument must be a letter or forward/backward quote
|
||||
@@ -67,4 +68,5 @@ E385=E385: search hit BOTTOM without match for: {0}
|
||||
e_patnotf2=Pattern not found: {0}
|
||||
unkopt=Unknown option: {0}
|
||||
e_invarg=Invalid argument: {0}
|
||||
E475=E475: Invalid argument: {0}
|
||||
E774=E774: 'operatorfunc' is empty
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
rootProject.name = 'IdeaVIM'
|
@@ -13,7 +13,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim;
|
||||
|
@@ -13,37 +13,60 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.ide.DataManager;
|
||||
import com.intellij.ide.IdeEventQueue;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.application.Application;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.command.CommandProcessor;
|
||||
import com.intellij.openapi.command.UndoConfirmationPolicy;
|
||||
import com.intellij.openapi.editor.Caret;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||
import com.intellij.openapi.editor.actionSystem.DocCommandGroupId;
|
||||
import com.intellij.openapi.editor.actionSystem.TypedActionHandler;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.maddyhome.idea.vim.action.MotionEditorAction;
|
||||
import com.maddyhome.idea.vim.action.TextObjectAction;
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory;
|
||||
import com.intellij.openapi.ui.popup.ListPopup;
|
||||
import com.maddyhome.idea.vim.action.DuplicableOperatorAction;
|
||||
import com.maddyhome.idea.vim.action.change.VimRepeater;
|
||||
import com.maddyhome.idea.vim.action.macro.ToggleRecordingAction;
|
||||
import com.maddyhome.idea.vim.action.motion.search.SearchEntryFwdAction;
|
||||
import com.maddyhome.idea.vim.action.motion.search.SearchEntryRevAction;
|
||||
import com.maddyhome.idea.vim.command.*;
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler;
|
||||
import com.maddyhome.idea.vim.group.ChangeGroup;
|
||||
import com.maddyhome.idea.vim.group.RegisterGroup;
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection;
|
||||
import com.maddyhome.idea.vim.group.visual.VisualGroupKt;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.helper.*;
|
||||
import com.maddyhome.idea.vim.key.*;
|
||||
import com.maddyhome.idea.vim.listener.SelectionVimListenerSuppressor;
|
||||
import com.maddyhome.idea.vim.listener.VimListenerSuppressor;
|
||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||
import org.jetbrains.annotations.Contract;
|
||||
import org.jetbrains.annotations.NonNls;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
import java.util.*;
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.intellij.openapi.actionSystem.CommonDataKeys.*;
|
||||
import static com.intellij.openapi.actionSystem.PlatformDataKeys.PROJECT_FILE_DIRECTORY;
|
||||
import static com.maddyhome.idea.vim.helper.StringHelper.parseKeys;
|
||||
|
||||
/**
|
||||
* This handlers every keystroke that the user can argType except those that are still valid hotkeys for various Idea
|
||||
@@ -67,7 +90,6 @@ public class KeyHandler {
|
||||
* Creates an instance
|
||||
*/
|
||||
private KeyHandler() {
|
||||
reset(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,6 +110,15 @@ public class KeyHandler {
|
||||
return origHandler;
|
||||
}
|
||||
|
||||
public static void executeVimAction(@NotNull Editor editor,
|
||||
@NotNull EditorActionHandlerBase cmd,
|
||||
DataContext context) {
|
||||
CommandProcessor.getInstance()
|
||||
.executeCommand(editor.getProject(), () -> cmd.execute(editor, getProjectAwareDataContext(editor, context)),
|
||||
cmd.getId(), DocCommandGroupId.noneGroupId(editor.getDocument()), UndoConfirmationPolicy.DEFAULT,
|
||||
editor.getDocument());
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute an action
|
||||
*
|
||||
@@ -95,18 +126,35 @@ public class KeyHandler {
|
||||
* @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);
|
||||
new AnActionEvent(null, context, ActionPlaces.ACTION_SEARCH, action.getTemplatePresentation(),
|
||||
ActionManager.getInstance(), 0);
|
||||
|
||||
if (action instanceof ActionGroup && !((ActionGroup)action).canBePerformed(context)) {
|
||||
// Some of the AcitonGroups should not be performed, but shown as a popup
|
||||
ListPopup popup = JBPopupFactory.getInstance()
|
||||
.createActionGroupPopup(event.getPresentation().getText(), (ActionGroup)action, context, false, null, -1);
|
||||
|
||||
Component component = context.getData(PlatformDataKeys.CONTEXT_COMPONENT);
|
||||
if (component != null) {
|
||||
Window window = SwingUtilities.getWindowAncestor(component);
|
||||
if (window != null) {
|
||||
popup.showInCenterOf(window);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
popup.showInFocusCenter();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
// beforeActionPerformedUpdate should be called to update the action. It fixes some rider-specific problems
|
||||
// because rider use async update method. See VIM-1819
|
||||
action.beforeActionPerformedUpdate(event);
|
||||
if (event.getPresentation().isEnabled()) {
|
||||
action.actionPerformed(event);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -165,8 +213,13 @@ public class KeyHandler {
|
||||
// Update the count
|
||||
count = count * 10 + (chKey - '0');
|
||||
}
|
||||
else if (allowKeyMappings && handleKeyMapping(editor, key, context)) {
|
||||
return;
|
||||
else if (!waitCommandFinish(editor) && allowKeyMappings && handleKeyMapping(editor, key, context)) {
|
||||
if (editorState.getMappingMode() != MappingMode.OP_PENDING ||
|
||||
currentCmd.isEmpty() ||
|
||||
currentCmd.peek().getArgument() == null ||
|
||||
Objects.requireNonNull(currentCmd.peek().getArgument()).getType() != Argument.Type.OFFSETS) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
// Pressing delete while entering a count "removes" the last digit entered
|
||||
// Unlike the digits, this must be checked *after* checking for key mappings
|
||||
@@ -190,24 +243,17 @@ public class KeyHandler {
|
||||
|
||||
// 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
|
||||
final Node node = editorState.getCurrentNode().getChildOrArgument(key);
|
||||
Node node = editorState.getCurrentNode().get(key);
|
||||
|
||||
if (handleDigraph(editor, key, context, node)) {
|
||||
return;
|
||||
}
|
||||
if (handleDigraph(editor, key, context, node)) return;
|
||||
|
||||
// If this is a branch node we have entered only part of a multi-key command
|
||||
if (node instanceof BranchNode) {
|
||||
handleBranchNode(editor, context, editorState, chKey, (BranchNode)node);
|
||||
node = mapOpCommand(key, node, editorState);
|
||||
|
||||
if (node instanceof CommandNode) {
|
||||
handleCommandNode(editor, context, key, (CommandNode)node, editorState);
|
||||
}
|
||||
// If this is a command node the user has entered a valid key sequence of a known command
|
||||
else if (node instanceof CommandNode) {
|
||||
handleCommandNode(editor, (CommandNode)node);
|
||||
}
|
||||
// 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
|
||||
else if (node instanceof ArgumentNode) {
|
||||
shouldRecord = handleArgumentNode(editor, key, context, editorState, (ArgumentNode)node);
|
||||
else if (node instanceof CommandPartNode) {
|
||||
editorState.setCurrentNode((CommandPartNode)node);
|
||||
}
|
||||
else {
|
||||
if (lastWasBS && lastChar != 0 && OptionsManager.INSTANCE.getDigraph().isSet()) {
|
||||
@@ -250,21 +296,32 @@ public class KeyHandler {
|
||||
if (editorState.getMappingMode() == MappingMode.OP_PENDING) {
|
||||
editorState.popState();
|
||||
}
|
||||
else {
|
||||
VimPlugin.indicateError();
|
||||
reset(editor);
|
||||
}
|
||||
}
|
||||
// We had some sort of error so reset the handler and let the user know (beep)
|
||||
else if (state == State.ERROR) {
|
||||
VimPlugin.indicateError();
|
||||
fullReset(editor);
|
||||
reset(editor);
|
||||
}
|
||||
else if (isRecording && shouldRecord) {
|
||||
VimPlugin.getRegister().recordKeyStroke(key);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean waitCommandFinish(@NotNull Editor editor) {
|
||||
return !(CommandState.getInstance(editor).getCurrentNode() instanceof RootNode);
|
||||
}
|
||||
|
||||
/**
|
||||
* See the description for {@link com.maddyhome.idea.vim.action.DuplicableOperatorAction}
|
||||
*/
|
||||
private Node mapOpCommand(KeyStroke key, Node node, @NotNull CommandState editorState) {
|
||||
if (editorState.getMappingMode() == MappingMode.OP_PENDING && !currentCmd.empty()) {
|
||||
EditorActionHandlerBase action = currentCmd.peek().getAction();
|
||||
if (action instanceof DuplicableOperatorAction &&
|
||||
((DuplicableOperatorAction)action).getDuplicateWith() == key.getKeyChar()) {
|
||||
return editorState.getCurrentNode().get(KeyStroke.getKeyStroke('_'));
|
||||
}
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
private static <T> boolean isPrefix(@NotNull List<T> list1, @NotNull List<T> list2) {
|
||||
if (list1.size() > list2.size()) {
|
||||
return false;
|
||||
@@ -278,29 +335,29 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
private void handleEditorReset(@NotNull Editor editor, @NotNull KeyStroke key, @NotNull final DataContext context) {
|
||||
if (state != State.COMMAND && count == 0 && currentArg == Argument.Type.NONE && currentCmd.size() == 0) {
|
||||
if (count == 0 && currentArg == null && currentCmd.size() == 0) {
|
||||
RegisterGroup register = VimPlugin.getRegister();
|
||||
if (register.getCurrentRegister() == register.getDefaultRegister()) {
|
||||
if (key.getKeyCode() == KeyEvent.VK_ESCAPE) {
|
||||
CommandProcessor.getInstance().executeCommand(editor.getProject(),
|
||||
() -> KeyHandler.executeAction("EditorEscape", context), "", null);
|
||||
CommandProcessor.getInstance()
|
||||
.executeCommand(editor.getProject(), () -> KeyHandler.executeAction("EditorEscape", context), "", null);
|
||||
}
|
||||
VimPlugin.indicateError();
|
||||
}
|
||||
}
|
||||
reset(editor);
|
||||
ChangeGroup.resetCaret(editor, false);
|
||||
}
|
||||
|
||||
private boolean handleKeyMapping(@NotNull final Editor editor,
|
||||
@NotNull final KeyStroke key,
|
||||
@NotNull final DataContext context) {
|
||||
if (state == State.CHAR_OR_DIGRAPH) return false;
|
||||
|
||||
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);
|
||||
@@ -314,11 +371,19 @@ public class KeyHandler {
|
||||
final Application application = ApplicationManager.getApplication();
|
||||
|
||||
if (mapping.isPrefix(fromKeys)) {
|
||||
// Okay, there is some mapping that starts with inserted key sequence. So,
|
||||
// either the user will continue to enter the mapping, or (if timeout option is set)
|
||||
// the entered command should be executed. Here we set up the times that will execute
|
||||
// typed keys after some delay.
|
||||
// E.g. there is a map for "dweri". If the user types "d", "w" they mean either "dweri" or "dw" command.
|
||||
// If the user will continue typing "e", "r" and "i", the timer will be cancelled. If the user will
|
||||
// not type anything, the "dw" command will be executed.
|
||||
mappingKeys.add(key);
|
||||
if (!application.isUnitTestMode() && OptionsManager.INSTANCE.getTimeout().isSet()) {
|
||||
commandState.startMappingTimer(actionEvent -> application.invokeLater(() -> {
|
||||
final KeyStroke firstKey = mappingKeys.get(0);
|
||||
mappingKeys.clear();
|
||||
if (editor.isDisposed()) {
|
||||
if (editor.isDisposed() || firstKey.equals(parseKeys("<Plug>").get(0))) {
|
||||
return;
|
||||
}
|
||||
for (KeyStroke keyStroke : fromKeys) {
|
||||
@@ -329,62 +394,129 @@ public class KeyHandler {
|
||||
return true;
|
||||
}
|
||||
else if (mappingInfo != null) {
|
||||
// Okay, there is a mapping for the entered key sequence
|
||||
// now the another key sequence should be executed, or the handler that attached to this command
|
||||
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);
|
||||
}
|
||||
final List<KeyStroke> toKeys = mappingInfo.getToKeys();
|
||||
final VimExtensionHandler extensionHandler = mappingInfo.getExtensionHandler();
|
||||
final EditorDataContext currentContext = new EditorDataContext(editor);
|
||||
if (toKeys != null) {
|
||||
// Here is a mapping to another key sequence
|
||||
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;
|
||||
}
|
||||
};
|
||||
if (application.isUnitTestMode()) {
|
||||
handleMappedKeys.run();
|
||||
}
|
||||
else {
|
||||
application.invokeLater(handleMappedKeys);
|
||||
else if (extensionHandler != null) {
|
||||
// Here is a mapping to some vim handler
|
||||
final CommandProcessor processor = CommandProcessor.getInstance();
|
||||
final boolean isPendingMode = CommandState.getInstance(editor).getMappingMode() == MappingMode.OP_PENDING;
|
||||
Map<Caret, Integer> startOffsets =
|
||||
editor.getCaretModel().getAllCarets().stream().collect(Collectors.toMap(Function.identity(), Caret::getOffset));
|
||||
|
||||
if (extensionHandler.isRepeatable()) {
|
||||
VimRepeater.Extension.INSTANCE.clean();
|
||||
}
|
||||
processor.executeCommand(editor.getProject(), () -> extensionHandler.execute(editor, context),
|
||||
"Vim " + extensionHandler.getClass().getSimpleName(), null);
|
||||
|
||||
if (extensionHandler.isRepeatable()) {
|
||||
VimRepeater.Extension.INSTANCE.setLastExtensionHandler(extensionHandler);
|
||||
VimRepeater.Extension.INSTANCE.setArgumentCaptured(null);
|
||||
VimRepeater.INSTANCE.setRepeatHandler(true);
|
||||
}
|
||||
if (isPendingMode &&
|
||||
!currentCmd.isEmpty() &&
|
||||
currentCmd.peek().getArgument() == null) {
|
||||
Map<Caret, VimSelection> offsets = new HashMap<>();
|
||||
|
||||
for (Caret caret : editor.getCaretModel().getAllCarets()) {
|
||||
@Nullable Integer startOffset = startOffsets.get(caret);
|
||||
if (caret.hasSelection()) {
|
||||
final VimSelection vimSelection = VimSelection.Companion
|
||||
.create(UserDataManager.getVimSelectionStart(caret), caret.getOffset(),
|
||||
SelectionType.fromSubMode(CommandStateHelper.getSubMode(editor)), editor);
|
||||
offsets.put(caret, vimSelection);
|
||||
commandState.popState();
|
||||
}
|
||||
else if (startOffset != null && startOffset != caret.getOffset()) {
|
||||
// Command line motions are always characterwise exclusive
|
||||
int endOffset = caret.getOffset();
|
||||
if (startOffset < endOffset) {
|
||||
endOffset -= 1;
|
||||
} else {
|
||||
startOffset -= 1;
|
||||
}
|
||||
final VimSelection vimSelection = VimSelection.Companion
|
||||
.create(startOffset, endOffset, SelectionType.CHARACTER_WISE, editor);
|
||||
offsets.put(caret, vimSelection);
|
||||
|
||||
try (VimListenerSuppressor.Locked ignored = SelectionVimListenerSuppressor.INSTANCE.lock()) {
|
||||
// Move caret to the initial offset for better undo action
|
||||
// This is not a necessary thing, but without it undo action look less convenient
|
||||
editor.getCaretModel().moveToOffset(startOffset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!offsets.isEmpty()) {
|
||||
currentCmd.peek().setArgument(new Argument(offsets));
|
||||
state = State.READY;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 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) {
|
||||
handleKey(editor, key, currentContext);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
final List<KeyStroke> unhandledKeys = new ArrayList<>(mappingKeys);
|
||||
// If the user enters a command that starts with known mapping, but it is not exactly this mapping,
|
||||
// mapping handler prevents further processing of there keys.
|
||||
// E.g. if there is a mapping for "hello" and user enters command "help"
|
||||
// the processing of "h", "e" and "l" will be prevented by this handler.
|
||||
// However, these keys should be processed as usual when user enters "p"
|
||||
// and the following for loop does exactly that.
|
||||
//
|
||||
// Okay, look at the code below. Why is the first key handled separately?
|
||||
// Let's assume the next mappings:
|
||||
// - map ds j
|
||||
// - map I 2l
|
||||
// If user enters `dI`, the first `d` will be caught be this handler because it's a prefix for `ds` command.
|
||||
// After the user enters `I`, the caught `d` should be processed without mapping and the rest of keys
|
||||
// should be processed with mappings (to make I work)
|
||||
//
|
||||
// Additionally, the <Plug>mappings are not executed if the are failed to map to somethings.
|
||||
// E.g.
|
||||
// - map <Plug>iA someAction
|
||||
// - map I <Plug>i
|
||||
// For `IA` someAction should be executed.
|
||||
// But if the user types `Ib`, `<Plug>i` won't be executed again. Only `b` will be passed to keyHandler.
|
||||
if (mappingKeys.isEmpty()) return false;
|
||||
|
||||
// Well, this will always be false, but just for protection
|
||||
if (fromKeys.isEmpty()) return false;
|
||||
final List<KeyStroke> unhandledKeys = new ArrayList<>(fromKeys);
|
||||
mappingKeys.clear();
|
||||
for (KeyStroke keyStroke : unhandledKeys) {
|
||||
handleKey(editor, keyStroke, context, false);
|
||||
|
||||
if (unhandledKeys.get(0).equals(parseKeys("<Plug>").get(0))) {
|
||||
handleKey(editor, unhandledKeys.get(unhandledKeys.size() - 1), context);
|
||||
} else {
|
||||
handleKey(editor, unhandledKeys.get(0), context, false);
|
||||
for (KeyStroke keyStroke : unhandledKeys.subList(1, unhandledKeys.size())) {
|
||||
handleKey(editor, keyStroke, context, true);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -398,8 +530,7 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
private boolean isEditorReset(@NotNull KeyStroke key, @NotNull CommandState editorState) {
|
||||
return (editorState.getMode() == CommandState.Mode.COMMAND || state == State.COMMAND) &&
|
||||
StringHelper.isCloseKeyStroke(key);
|
||||
return (editorState.getMode() == CommandState.Mode.COMMAND) && StringHelper.isCloseKeyStroke(key);
|
||||
}
|
||||
|
||||
private void handleCharArgument(@NotNull KeyStroke key, char chKey) {
|
||||
@@ -492,10 +623,8 @@ public class KeyHandler {
|
||||
final Command mot = arg.getMotion();
|
||||
// If no count was entered for either command then nothing changes. If either had a count then
|
||||
// the motion gets the product of both.
|
||||
if (mot != null) {
|
||||
int cnt = cmd.getRawCount() == 0 && mot.getRawCount() == 0 ? 0 : cmd.getCount() * mot.getCount();
|
||||
mot.setCount(cnt);
|
||||
}
|
||||
int cnt = cmd.getRawCount() == 0 && mot.getRawCount() == 0 ? 0 : cmd.getCount() * mot.getCount();
|
||||
mot.setCount(cnt);
|
||||
cmd.setCount(0);
|
||||
}
|
||||
|
||||
@@ -527,8 +656,9 @@ public class KeyHandler {
|
||||
|
||||
if (ApplicationManager.getApplication().isDispatchThread()) {
|
||||
Runnable action = new ActionRunner(editor, context, cmd, key);
|
||||
String name = cmd.getAction().getTemplatePresentation().getText();
|
||||
name = name != null ? "Vim " + name : "";
|
||||
EditorActionHandlerBase cmdAction = cmd.getAction();
|
||||
String name = cmdAction.getId();
|
||||
|
||||
if (type.isWrite()) {
|
||||
RunnableHelper.runWriteCommand(project, action, name, action);
|
||||
}
|
||||
@@ -541,93 +671,85 @@ public class KeyHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private void handleCommandNode(@NotNull Editor editor, @NotNull CommandNode 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);
|
||||
private void handleCommandNode(Editor editor,
|
||||
DataContext context,
|
||||
KeyStroke key,
|
||||
@NotNull CommandNode node,
|
||||
CommandState editorState) {
|
||||
// The user entered a valid command. Create the command and add it to the stack
|
||||
final EditorActionHandlerBase myAction = node.getActionHolder().getAction();
|
||||
Command cmd = new Command(count, myAction, myAction.getType(), myAction.getFlags(), keys);
|
||||
currentCmd.push(cmd);
|
||||
|
||||
if (currentArg != null && !checkArgumentCompatibility(node)) return;
|
||||
|
||||
if (myAction.getArgumentType() == null || stopMacroRecord(node, editorState)) {
|
||||
state = State.READY;
|
||||
}
|
||||
else {
|
||||
currentArg = myAction.getArgumentType();
|
||||
startWaitingForArgument(editor, context, key.getKeyChar(), currentArg, editorState, myAction);
|
||||
partialReset(editor);
|
||||
}
|
||||
|
||||
// TODO In the name of God, get rid of EX_STRING, FLAG_COMPLETE_EX and all the related staff
|
||||
if (currentArg == Argument.Type.EX_STRING && myAction.getFlags().contains(CommandFlags.FLAG_COMPLETE_EX)) {
|
||||
EditorActionHandlerBase action;
|
||||
if (forwardSearch) {
|
||||
action = new SearchEntryFwdAction();
|
||||
}
|
||||
else {
|
||||
// Oops - this wasn't a motion command. The user goofed and typed something else
|
||||
state = State.BAD_COMMAND;
|
||||
action = new SearchEntryRevAction();
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
String text = VimPlugin.getProcess().endSearchCommand(editor);
|
||||
currentCmd.pop();
|
||||
|
||||
Argument arg = new Argument(text);
|
||||
cmd = new Command(count, action, action.getType(), action.getFlags(), keys);
|
||||
cmd.setArgument(arg);
|
||||
currentCmd.push(cmd);
|
||||
CommandState.getInstance(editor).popState();
|
||||
}
|
||||
}
|
||||
|
||||
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.
|
||||
Command cmd = new Command(count, node.getActionId(), node.getAction(), node.getCmdType(), node.getFlags());
|
||||
cmd.setKeys(keys);
|
||||
currentCmd.push(cmd);
|
||||
// What type of argument does this command expect?
|
||||
switch (node.getArgType()) {
|
||||
case DIGRAPH:
|
||||
//digraphState = 0;
|
||||
digraph = new DigraphSequence();
|
||||
// No break - fall through
|
||||
private boolean stopMacroRecord(CommandNode node, @NotNull CommandState editorState) {
|
||||
return editorState.isRecording() && node.getActionHolder().getAction() instanceof ToggleRecordingAction;
|
||||
}
|
||||
|
||||
private void startWaitingForArgument(Editor editor,
|
||||
DataContext context,
|
||||
char key,
|
||||
@NotNull Argument.Type argument,
|
||||
CommandState editorState,
|
||||
EditorActionHandlerBase action) {
|
||||
switch (argument) {
|
||||
case CHARACTER:
|
||||
case DIGRAPH:
|
||||
digraph = new DigraphSequence();
|
||||
state = State.CHAR_OR_DIGRAPH;
|
||||
break;
|
||||
case MOTION:
|
||||
state = State.NEW_COMMAND;
|
||||
currentArg = node.getArgType();
|
||||
// Is the current command an operator? If so set the state to only accept "operator pending"
|
||||
// commands
|
||||
if (node.getFlags().contains(CommandFlags.FLAG_OP_PEND)) {
|
||||
editorState.pushState(editorState.getMode(), editorState.getSubMode(), MappingMode.OP_PENDING);
|
||||
if (CommandState.getInstance(editor).isDotRepeatInProgress() && VimRepeater.Extension.INSTANCE.getArgumentCaptured() != null) {
|
||||
currentCmd.peek().setArgument(VimRepeater.Extension.INSTANCE.getArgumentCaptured());
|
||||
state = State.READY;
|
||||
}
|
||||
editorState.pushState(editorState.getMode(), editorState.getSubMode(), MappingMode.OP_PENDING);
|
||||
break;
|
||||
case EX_STRING:
|
||||
break;
|
||||
default:
|
||||
// Oops - we aren't expecting any other type of argument
|
||||
state = State.ERROR;
|
||||
}
|
||||
forwardSearch = !(action instanceof SearchEntryRevAction);
|
||||
|
||||
// If the current keystroke is really the first character of an argument the user needs to enter,
|
||||
// recursively go back and handle this keystroke again with all the state properly updated to
|
||||
// handle the argument
|
||||
if (currentArg != Argument.Type.NONE) {
|
||||
partialReset(editor);
|
||||
handleKey(editor, key, context);
|
||||
VimPlugin.getProcess().startSearchCommand(editor, context, count, key);
|
||||
state = State.NEW_COMMAND;
|
||||
editorState.pushState(CommandState.Mode.CMD_LINE, CommandState.SubMode.NONE, MappingMode.CMD_LINE);
|
||||
currentCmd.pop();
|
||||
}
|
||||
}
|
||||
|
||||
private boolean checkArgumentCompatibility(@NotNull CommandNode node) {
|
||||
if (currentArg == Argument.Type.MOTION &&
|
||||
node.getActionHolder().getAction().getType() != Command.Type.MOTION) {
|
||||
state = State.BAD_COMMAND;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -645,44 +767,13 @@ public class KeyHandler {
|
||||
return action != null && executeAction(action, context);
|
||||
}
|
||||
|
||||
private void handleBranchNode(@NotNull Editor editor,
|
||||
@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)
|
||||
if (!node.getFlags().contains(CommandFlags.FLAG_ALLOW_MID_COUNT)) {
|
||||
state = State.COMMAND;
|
||||
}
|
||||
editorState.setCurrentNode(node);
|
||||
|
||||
ArgumentNode arg = (ArgumentNode)((BranchNode)editorState.getCurrentNode()).getArgumentNode();
|
||||
if (arg != null) {
|
||||
if (currentArg == Argument.Type.MOTION && arg.getCmdType() != Command.Type.MOTION) {
|
||||
editorState.popState();
|
||||
state = State.BAD_COMMAND;
|
||||
return;
|
||||
}
|
||||
if (editorState.isRecording() && arg.getFlags().contains(CommandFlags.FLAG_NO_ARG_RECORDING)) {
|
||||
handleKey(editor, KeyStroke.getKeyStroke(' '), context);
|
||||
}
|
||||
|
||||
if (arg.getArgType() == Argument.Type.EX_STRING) {
|
||||
VimPlugin.getProcess().startSearchCommand(editor, context, count, key);
|
||||
state = State.NEW_COMMAND;
|
||||
currentArg = Argument.Type.EX_STRING;
|
||||
editorState.pushState(CommandState.Mode.EX_ENTRY, CommandState.SubMode.NONE, MappingMode.CMD_LINE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* @param editor The editor to reset.
|
||||
*/
|
||||
private void partialReset(@Nullable Editor editor) {
|
||||
public void partialReset(@Nullable Editor editor) {
|
||||
count = 0;
|
||||
keys = new ArrayList<>();
|
||||
CommandState editorState = CommandState.getInstance(editor);
|
||||
@@ -700,7 +791,7 @@ public class KeyHandler {
|
||||
partialReset(editor);
|
||||
state = State.NEW_COMMAND;
|
||||
currentCmd.clear();
|
||||
currentArg = Argument.Type.NONE;
|
||||
currentArg = null;
|
||||
digraph = null;
|
||||
}
|
||||
|
||||
@@ -717,13 +808,63 @@ public class KeyHandler {
|
||||
lastChar = 0;
|
||||
lastWasBS = false;
|
||||
VimPlugin.getRegister().resetRegister();
|
||||
if (editor != null) {
|
||||
VisualGroupKt.updateCaretState(editor);
|
||||
editor.getSelectionModel().removeSelection();
|
||||
}
|
||||
}
|
||||
|
||||
// This method is copied from com.intellij.openapi.editor.actionSystem.EditorAction.getProjectAwareDataContext
|
||||
@NotNull
|
||||
private static DataContext getProjectAwareDataContext(@NotNull final Editor editor,
|
||||
@NotNull final DataContext original) {
|
||||
if (PROJECT.getData(original) == editor.getProject()) {
|
||||
return new DialogAwareDataContext(original);
|
||||
}
|
||||
|
||||
return dataId -> {
|
||||
if (PROJECT.is(dataId)) {
|
||||
final Project project = editor.getProject();
|
||||
if (project != null) {
|
||||
return project;
|
||||
}
|
||||
}
|
||||
return original.getData(dataId);
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// This class is copied from com.intellij.openapi.editor.actionSystem.DialogAwareDataContext.DialogAwareDataContext
|
||||
private final static class DialogAwareDataContext implements DataContext {
|
||||
private static final DataKey[] keys = {PROJECT, PROJECT_FILE_DIRECTORY, EDITOR, VIRTUAL_FILE, PSI_FILE};
|
||||
private final Map<String, Object> values = new HashMap<>();
|
||||
|
||||
DialogAwareDataContext(DataContext context) {
|
||||
for (DataKey key : keys) {
|
||||
values.put(key.getName(), key.getData(context));
|
||||
}
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Object getData(@NotNull @NonNls String dataId) {
|
||||
if (values.containsKey(dataId)) {
|
||||
return values.get(dataId);
|
||||
}
|
||||
final Editor editor = (Editor)values.get(EDITOR.getName());
|
||||
if (editor != null) {
|
||||
return DataManager.getInstance().getDataContext(editor.getContentComponent()).getData(dataId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This was used as an experiment to execute actions as a runnable.
|
||||
*/
|
||||
static class ActionRunner implements Runnable {
|
||||
public ActionRunner(Editor editor, DataContext context, Command cmd, KeyStroke key) {
|
||||
@Contract(pure = true)
|
||||
ActionRunner(Editor editor, DataContext context, Command cmd, KeyStroke key) {
|
||||
this.editor = editor;
|
||||
this.context = context;
|
||||
this.cmd = cmd;
|
||||
@@ -735,7 +876,8 @@ public class KeyHandler {
|
||||
CommandState editorState = CommandState.getInstance(editor);
|
||||
boolean wasRecording = editorState.isRecording();
|
||||
|
||||
executeAction(cmd.getAction(), context);
|
||||
KeyHandler.getInstance().state = State.NEW_COMMAND;
|
||||
executeVimAction(editor, cmd.getAction(), context);
|
||||
if (editorState.getMode() == CommandState.Mode.INSERT || editorState.getMode() == CommandState.Mode.REPLACE) {
|
||||
VimPlugin.getChange().processCommand(editor, cmd);
|
||||
}
|
||||
@@ -771,18 +913,26 @@ public class KeyHandler {
|
||||
}
|
||||
|
||||
private enum State {
|
||||
NEW_COMMAND, COMMAND, READY, ERROR, BAD_COMMAND
|
||||
/** Awaiting a new command */
|
||||
NEW_COMMAND,
|
||||
// TODO This should be probably processed in some better way
|
||||
/** Awaiting for char or digraph input. In this mode mappings doesn't work (even for <C-K>) */
|
||||
CHAR_OR_DIGRAPH,
|
||||
READY,
|
||||
BAD_COMMAND
|
||||
}
|
||||
|
||||
private int count;
|
||||
private List<KeyStroke> keys;
|
||||
private State state;
|
||||
private List<KeyStroke> keys = new ArrayList<>();
|
||||
private State state = State.NEW_COMMAND;
|
||||
@NotNull private final Stack<Command> currentCmd = new Stack<>();
|
||||
@NotNull private Argument.Type currentArg;
|
||||
@Nullable private Argument.Type currentArg;
|
||||
private TypedActionHandler origHandler;
|
||||
@Nullable private DigraphSequence digraph = null;
|
||||
private char lastChar;
|
||||
private boolean lastWasBS;
|
||||
|
||||
private boolean forwardSearch = true;
|
||||
|
||||
private static KeyHandler instance;
|
||||
}
|
||||
|
@@ -13,67 +13,58 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.ex.ActionManagerEx;
|
||||
import com.maddyhome.idea.vim.action.VimCommandActionBase;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandFlags;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.intellij.openapi.extensions.ExtensionPointName;
|
||||
import com.maddyhome.idea.vim.group.KeyGroup;
|
||||
import com.maddyhome.idea.vim.handler.ActionBeanClass;
|
||||
import com.maddyhome.idea.vim.handler.EditorActionHandlerBase;
|
||||
import com.maddyhome.idea.vim.key.Shortcut;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.EnumSet;
|
||||
|
||||
class RegisterActions {
|
||||
public class RegisterActions {
|
||||
|
||||
public static final ExtensionPointName<ActionBeanClass> VIM_ACTIONS_EP =
|
||||
ExtensionPointName.create("IdeaVIM.vimAction");
|
||||
private static boolean actionsRegistered = false;
|
||||
|
||||
/**
|
||||
* Register all the key/action mappings for the plugin.
|
||||
*/
|
||||
static void registerActions() {
|
||||
if (actionsRegistered) return;
|
||||
actionsRegistered = true;
|
||||
|
||||
registerVimCommandActions();
|
||||
registerSystemMappings();
|
||||
registerEmptyShortcuts();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public static EditorActionHandlerBase findAction(@NotNull String id) {
|
||||
return VIM_ACTIONS_EP.extensions().filter(vimActionBean -> vimActionBean.getActionId().equals(id)).findFirst()
|
||||
.map(ActionBeanClass::getAction).orElse(null);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static EditorActionHandlerBase findActionOrDie(@NotNull String id) {
|
||||
EditorActionHandlerBase action = findAction(id);
|
||||
if (action == null) throw new RuntimeException("Action " + id + " is not registered");
|
||||
return action;
|
||||
}
|
||||
|
||||
private static void registerVimCommandActions() {
|
||||
final ActionManagerEx manager = ActionManagerEx.getInstanceEx();
|
||||
for (String actionId : manager.getPluginActions(VimPlugin.getPluginId())) {
|
||||
final AnAction action = manager.getAction(actionId);
|
||||
if (action instanceof VimCommandActionBase) {
|
||||
VimPlugin.getKey().registerCommandAction((VimCommandActionBase)action, actionId);
|
||||
}
|
||||
}
|
||||
KeyGroup parser = VimPlugin.getKey();
|
||||
VIM_ACTIONS_EP.extensions().forEach(parser::registerCommandAction);
|
||||
}
|
||||
|
||||
private static void registerSystemMappings() {
|
||||
private static void registerEmptyShortcuts() {
|
||||
final KeyGroup parser = VimPlugin.getKey();
|
||||
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, "CollapseRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zC"));
|
||||
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, "ExpandRegionRecursively", Command.Type.OTHER_READONLY, new Shortcut("zO"));
|
||||
|
||||
parser.registerAction(MappingMode.I, "EditorBackSpace", Command.Type.INSERT, EnumSet.noneOf(CommandFlags.class),
|
||||
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, EnumSet.of(CommandFlags.FLAG_SAVE_STROKE),
|
||||
new Shortcut[]{new Shortcut(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0))});
|
||||
parser.registerAction(MappingMode.I, "EditorDown", Command.Type.INSERT, EnumSet.of(CommandFlags.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, EnumSet.of(CommandFlags.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, EnumSet.of(CommandFlags.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.N, "QuickJavaDoc", Command.Type.OTHER_READONLY, new Shortcut('K'));
|
||||
|
||||
// Digraph shortcuts are handled directly by KeyHandler#handleKey, so they don't have an action. But we still need to
|
||||
// register the shortcuts or the editor will swallow them. Technically, the shortcuts will be registered as part of
|
||||
|
260
src/com/maddyhome/idea/vim/StatusBar.kt
Normal file
@@ -0,0 +1,260 @@
|
||||
package com.maddyhome.idea.vim
|
||||
|
||||
import com.intellij.ide.BrowserUtil
|
||||
import com.intellij.ide.DataManager
|
||||
import com.intellij.ide.plugins.InstalledPluginsState
|
||||
import com.intellij.ide.plugins.PluginManager
|
||||
import com.intellij.ide.plugins.PluginManagerMain
|
||||
import com.intellij.ide.plugins.RepositoryHelper
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.actionSystem.DefaultActionGroup
|
||||
import com.intellij.openapi.application.ApplicationInfo
|
||||
import com.intellij.openapi.options.ShowSettingsUtil
|
||||
import com.intellij.openapi.progress.PerformInBackgroundOption
|
||||
import com.intellij.openapi.progress.ProgressIndicator
|
||||
import com.intellij.openapi.progress.Task
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.Messages
|
||||
import com.intellij.openapi.ui.popup.JBPopupFactory
|
||||
import com.intellij.openapi.ui.popup.ListPopup
|
||||
import com.intellij.openapi.updateSettings.impl.PluginDownloader
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateChecker
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateInstaller
|
||||
import com.intellij.openapi.updateSettings.impl.UpdateSettings
|
||||
import com.intellij.openapi.util.Ref
|
||||
import com.intellij.openapi.wm.StatusBar
|
||||
import com.intellij.openapi.wm.StatusBarWidget
|
||||
import com.intellij.openapi.wm.StatusBarWidgetProvider
|
||||
import com.intellij.ui.awt.RelativePoint
|
||||
import com.intellij.util.Consumer
|
||||
import com.intellij.util.text.VersionComparatorUtil
|
||||
import com.maddyhome.idea.vim.group.NotificationService
|
||||
import com.maddyhome.idea.vim.option.OptionsManager
|
||||
import com.maddyhome.idea.vim.ui.VimEmulationConfigurable
|
||||
import icons.VimIcons
|
||||
import java.awt.Point
|
||||
import java.awt.event.MouseEvent
|
||||
import javax.swing.Icon
|
||||
import javax.swing.SwingConstants
|
||||
|
||||
private class StatusBarIconProvider : StatusBarWidgetProvider {
|
||||
override fun getWidget(project: Project): VimStatusBar? = if (OptionsManager.ideastatusbar.isSet) VimStatusBar else null
|
||||
}
|
||||
|
||||
object VimStatusBar : StatusBarWidget, StatusBarWidget.IconPresentation {
|
||||
|
||||
private var statusBar: StatusBar? = null
|
||||
|
||||
override fun ID(): String = "IdeaVim-Icon"
|
||||
|
||||
override fun install(statusBar: StatusBar) {
|
||||
this.statusBar = statusBar
|
||||
}
|
||||
|
||||
override fun dispose() {}
|
||||
|
||||
override fun getTooltipText() = "IdeaVim"
|
||||
|
||||
override fun getIcon(): Icon = if (VimPlugin.isEnabled()) VimIcons.IDEAVIM else VimIcons.IDEAVIM_DISABLED
|
||||
|
||||
override fun getClickConsumer() = Consumer<MouseEvent> { event ->
|
||||
val component = event.component
|
||||
val popup = VimActionsPopup.getPopup(DataManager.getInstance().getDataContext(component))
|
||||
val dimension = popup.content.preferredSize
|
||||
|
||||
val at = Point(0, -dimension.height)
|
||||
popup.show(RelativePoint(component, at))
|
||||
}
|
||||
|
||||
// TODO [VERSION UPDATE] After 193 use `getPresentation()`
|
||||
@Suppress("DEPRECATION", "UnstableApiUsage")
|
||||
override fun getPresentation(type: StatusBarWidget.PlatformType): StatusBarWidget.WidgetPresentation? = this
|
||||
|
||||
fun update() {
|
||||
statusBar?.updateWidget(this.ID())
|
||||
}
|
||||
}
|
||||
|
||||
class VimActions : DumbAwareAction() {
|
||||
|
||||
companion object {
|
||||
const val actionPlace = "VimActionsPopup"
|
||||
}
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val project = e.project ?: return
|
||||
VimActionsPopup.getPopup(e.dataContext).showCenteredInCurrentWindow(project)
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
val project = e.project
|
||||
e.presentation.isEnabledAndVisible = project != null && !project.isDisposed
|
||||
}
|
||||
}
|
||||
|
||||
private object VimActionsPopup {
|
||||
fun getPopup(dataContext: DataContext): ListPopup {
|
||||
val actions = getActions()
|
||||
val popup = JBPopupFactory.getInstance()
|
||||
.createActionGroupPopup("IdeaVim", actions,
|
||||
dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, false,
|
||||
VimActions.actionPlace)
|
||||
popup.setAdText("Version ${VimPlugin.getVersion()}", SwingConstants.CENTER)
|
||||
|
||||
return popup
|
||||
}
|
||||
|
||||
private fun getActions(): DefaultActionGroup {
|
||||
val actionGroup = DefaultActionGroup()
|
||||
actionGroup.isPopup = true
|
||||
|
||||
actionGroup.add(ActionManager.getInstance().getAction("VimPluginToggle"))
|
||||
actionGroup.addSeparator()
|
||||
actionGroup.add(NotificationService.OpenIdeaVimRcAction(null))
|
||||
actionGroup.add(ShortcutConflictsSettings)
|
||||
actionGroup.addSeparator()
|
||||
|
||||
val eapGroup = DefaultActionGroup("EAP" + if (JoinEap.eapActive()) " (Active)" else "", true)
|
||||
eapGroup.add(JoinEap)
|
||||
eapGroup.add(HelpLink("About EAP...", "https://github.com/JetBrains/ideavim#get-early-access", null))
|
||||
actionGroup.add(eapGroup)
|
||||
|
||||
val helpGroup = DefaultActionGroup("Contacts && Help", true)
|
||||
helpGroup.add(HelpLink("Contact on Twitter", "https://twitter.com/ideavim", VimIcons.TWITTER))
|
||||
helpGroup.add(HelpLink("Create an Issue", "https://youtrack.jetbrains.com/issues/VIM", VimIcons.YOUTRACK))
|
||||
helpGroup.add(HelpLink("Contribute on GitHub", "https://github.com/JetBrains/ideavim", VimIcons.GITHUB))
|
||||
actionGroup.add(helpGroup)
|
||||
|
||||
return actionGroup
|
||||
}
|
||||
}
|
||||
|
||||
private class HelpLink(
|
||||
name: String,
|
||||
val link: String,
|
||||
icon: Icon?
|
||||
) : DumbAwareAction(name, null, icon) {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
BrowserUtil.browse(link)
|
||||
}
|
||||
}
|
||||
|
||||
private object ShortcutConflictsSettings : DumbAwareAction("Settings...") {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
ShowSettingsUtil.getInstance().editConfigurable(e.project, VimEmulationConfigurable())
|
||||
}
|
||||
}
|
||||
|
||||
private object JoinEap : DumbAwareAction() {
|
||||
private const val EAP_LINK = "https://plugins.jetbrains.com/plugins/eap/ideavim"
|
||||
|
||||
fun eapActive() = EAP_LINK in UpdateSettings.getInstance().storedPluginHosts
|
||||
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
if (eapActive()) {
|
||||
UpdateSettings.getInstance().storedPluginHosts -= EAP_LINK
|
||||
VimPlugin.getNotifications(e.project).notifyEapFinished()
|
||||
} else {
|
||||
UpdateSettings.getInstance().storedPluginHosts += EAP_LINK
|
||||
checkForUpdates(e.project)
|
||||
}
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
if (eapActive()) {
|
||||
e.presentation.text = "Finish EAP"
|
||||
} else {
|
||||
e.presentation.text = "Get Early Access..."
|
||||
}
|
||||
}
|
||||
|
||||
private fun checkForUpdates(project: Project?) {
|
||||
val notificator = VimPlugin.getNotifications(project)
|
||||
|
||||
val pluginRef = Ref.create<PluginDownloader>()
|
||||
|
||||
// [VERSION UPDATE] 193+ remove suppressing
|
||||
@Suppress("UnstableApiUsage")
|
||||
object : Task.Backgroundable(null, "Checking for IdeaVim EAP version", true) {
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
val downloaders = mutableListOf<PluginDownloader>()
|
||||
val build = ApplicationInfo.getInstance().build
|
||||
for (host in RepositoryHelper.getPluginHosts()) {
|
||||
val newPluginDescriptor = RepositoryHelper
|
||||
.loadPlugins(host, null, indicator)
|
||||
.filter { it.pluginId == VimPlugin.getPluginId() }
|
||||
.maxWith(java.util.Comparator { o1, o2 -> VersionComparatorUtil.compare(o1.version, o2.version) })
|
||||
?: continue
|
||||
|
||||
downloaders += PluginDownloader.createDownloader(newPluginDescriptor, host, build)
|
||||
}
|
||||
val plugin = downloaders.maxWith(java.util.Comparator { o1, o2 -> VersionComparatorUtil.compare(o1.pluginVersion, o2.pluginVersion) })
|
||||
pluginRef.set(plugin)
|
||||
}
|
||||
|
||||
// [VERSION UPDATE] 193+ remove suppressing
|
||||
@Suppress("MissingRecentApi", "UnstableApiUsage")
|
||||
override fun onSuccess() {
|
||||
val downloader: PluginDownloader = pluginRef.get() ?: run {
|
||||
notificator.notifySubscribedToEap()
|
||||
return
|
||||
}
|
||||
val currentVersion = PluginManager.getPlugin(VimPlugin.getPluginId())?.version ?: ""
|
||||
if (VersionComparatorUtil.compare(downloader.pluginVersion, currentVersion) <= 0) {
|
||||
notificator.notifySubscribedToEap()
|
||||
return
|
||||
}
|
||||
|
||||
val version = downloader.pluginVersion
|
||||
val message = "Do you want to install the EAP version of IdeaVim?"
|
||||
@Suppress("MoveVariableDeclarationIntoWhen")
|
||||
val res = Messages.showYesNoCancelDialog(project, message, "IdeaVim $version", null)
|
||||
when (res) {
|
||||
Messages.YES -> updatePlugin(project, downloader)
|
||||
Messages.NO -> notificator.notifySubscribedToEap()
|
||||
Messages.CANCEL -> if (eapActive()) UpdateSettings.getInstance().storedPluginHosts -= EAP_LINK
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
notificator.notifySubscribedToEap()
|
||||
}
|
||||
|
||||
override fun onThrowable(error: Throwable) {
|
||||
notificator.notifySubscribedToEap()
|
||||
}
|
||||
}.queue()
|
||||
}
|
||||
|
||||
private fun updatePlugin(project: Project?, downloader: PluginDownloader) {
|
||||
val notificator = VimPlugin.getNotifications(project)
|
||||
return object : Task.Backgroundable(null, "Plugin Updates", true, PerformInBackgroundOption.DEAF) {
|
||||
private var updated = false
|
||||
override fun run(indicator: ProgressIndicator) {
|
||||
val state = InstalledPluginsState.getInstance()
|
||||
state.onDescriptorDownload(downloader.descriptor)
|
||||
UpdateChecker.checkAndPrepareToInstall(downloader, state, mutableMapOf(VimPlugin.getPluginId() to downloader), mutableListOf(), indicator)
|
||||
updated = UpdateInstaller.installPluginUpdates(listOf(downloader), indicator)
|
||||
}
|
||||
|
||||
override fun onSuccess() {
|
||||
if (updated) {
|
||||
PluginManagerMain.notifyPluginsUpdated(null)
|
||||
} else {
|
||||
notificator.notifyFailedToDownloadEap()
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCancel() {
|
||||
notificator.notifyFailedToDownloadEap()
|
||||
}
|
||||
|
||||
override fun onThrowable(error: Throwable) {
|
||||
notificator.notifyFailedToDownloadEap()
|
||||
}
|
||||
}.queue()
|
||||
}
|
||||
}
|
@@ -13,12 +13,11 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://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
|
||||
@@ -30,8 +29,10 @@ import org.jdom.Element
|
||||
* @author Alex Plate
|
||||
*/
|
||||
|
||||
@State(name = "VimLocalSettings",
|
||||
storages = [Storage("$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED)])
|
||||
@State(name = "VimLocalSettings", storages = [
|
||||
Storage("\$APP_CONFIG$$/vim_local_settings.xml", roamingType = RoamingType.DISABLED, deprecated = true),
|
||||
Storage("\$APP_CONFIG$/vim_local_settings.xml", roamingType = RoamingType.DISABLED)
|
||||
])
|
||||
class VimLocalConfig : PersistentStateComponent<Element> {
|
||||
override fun getState(): Element {
|
||||
val element = Element("ideavim-local")
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
@@ -21,9 +21,7 @@ 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;
|
||||
@@ -46,11 +44,11 @@ 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.vimscript.VimScriptParser;
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionRegistrar;
|
||||
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.MacKeyRepeat;
|
||||
import com.maddyhome.idea.vim.listener.VimListenerManager;
|
||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||
@@ -92,65 +90,24 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
|
||||
// It is enabled by default to avoid any special configuration after plugin installation
|
||||
private boolean enabled = true;
|
||||
private boolean initialized = false;
|
||||
|
||||
private static final Logger LOG = Logger.getInstance(VimPlugin.class);
|
||||
|
||||
@NotNull private final MotionGroup motion;
|
||||
@NotNull private final ChangeGroup change;
|
||||
@NotNull private final CommandGroup command;
|
||||
@NotNull private final MarkGroup mark;
|
||||
@NotNull private final RegisterGroup register;
|
||||
@NotNull private final FileGroup file;
|
||||
@NotNull private final SearchGroup search;
|
||||
@NotNull private final ProcessGroup process;
|
||||
@NotNull private final MacroGroup macro;
|
||||
@NotNull private final DigraphGroup digraph;
|
||||
@NotNull private final HistoryGroup history;
|
||||
@NotNull private final KeyGroup key;
|
||||
@NotNull private final WindowGroup window;
|
||||
@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() {
|
||||
motion = new MotionGroup();
|
||||
change = new ChangeGroup();
|
||||
command = new CommandGroup();
|
||||
mark = new MarkGroup();
|
||||
register = new RegisterGroup();
|
||||
file = new FileGroup();
|
||||
search = new SearchGroup();
|
||||
process = new ProcessGroup();
|
||||
macro = new MacroGroup();
|
||||
digraph = new DigraphGroup();
|
||||
history = new HistoryGroup();
|
||||
key = new KeyGroup();
|
||||
window = new WindowGroup();
|
||||
editor = new EditorGroup();
|
||||
visualMotion = new VisualMotionGroup();
|
||||
yank = new YankGroup();
|
||||
put = new PutGroup();
|
||||
|
||||
state = new VimState();
|
||||
|
||||
LOG.debug("VimPlugin ctr");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return IDEAVIM_COMPONENT_NAME;
|
||||
}
|
||||
|
||||
|
||||
@NotNull private final VimState state = new VimState();
|
||||
|
||||
// [VERSION UPDATE] 193+ replace with com.intellij.openapi.components.PersistentStateComponent.initializeComponent
|
||||
@Override
|
||||
public void initComponent() {
|
||||
LOG.debug("initComponent");
|
||||
|
||||
if (isEnabled()) initializePlugin();
|
||||
if (enabled) turnOnPlugin();
|
||||
|
||||
LOG.debug("done");
|
||||
}
|
||||
@@ -179,6 +136,12 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
return getInstance().state;
|
||||
}
|
||||
|
||||
|
||||
@NotNull
|
||||
public static MotionGroup getMotion() {
|
||||
return ServiceManager.getService(MotionGroup.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reports statistics about installed IdeaVim and enabled Vim emulation.
|
||||
* <p>
|
||||
@@ -227,94 +190,84 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
}
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static MotionGroup getMotion() {
|
||||
return getInstance().motion;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ChangeGroup getChange() {
|
||||
return getInstance().change;
|
||||
return ServiceManager.getService(ChangeGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static CommandGroup getCommand() {
|
||||
return getInstance().command;
|
||||
return ServiceManager.getService(CommandGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static MarkGroup getMark() {
|
||||
return getInstance().mark;
|
||||
return ServiceManager.getService(MarkGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static RegisterGroup getRegister() {
|
||||
return getInstance().register;
|
||||
return ServiceManager.getService(RegisterGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static FileGroup getFile() {
|
||||
return getInstance().file;
|
||||
return ServiceManager.getService(FileGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static SearchGroup getSearch() {
|
||||
return getInstance().search;
|
||||
return ServiceManager.getService(SearchGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static ProcessGroup getProcess() {
|
||||
return getInstance().process;
|
||||
return ServiceManager.getService(ProcessGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static MacroGroup getMacro() {
|
||||
return getInstance().macro;
|
||||
return ServiceManager.getService(MacroGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static DigraphGroup getDigraph() {
|
||||
return getInstance().digraph;
|
||||
return ServiceManager.getService(DigraphGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static HistoryGroup getHistory() {
|
||||
return getInstance().history;
|
||||
return ServiceManager.getService(HistoryGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static KeyGroup getKey() {
|
||||
return getInstance().key;
|
||||
return ServiceManager.getService(KeyGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static WindowGroup getWindow() {
|
||||
return getInstance().window;
|
||||
return ServiceManager.getService(WindowGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static EditorGroup getEditor() {
|
||||
return getInstance().editor;
|
||||
return ServiceManager.getService(EditorGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static VisualMotionGroup getVisualMotion() {
|
||||
return getInstance().visualMotion;
|
||||
return ServiceManager.getService(VisualMotionGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static YankGroup getYank() {
|
||||
return getInstance().yank;
|
||||
return ServiceManager.getService(YankGroup.class);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static PutGroup getPut() {
|
||||
return getInstance().put;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static NotificationService getNotifications() {
|
||||
return getNotifications(null);
|
||||
return ServiceManager.getService(PutGroup.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -328,34 +281,23 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
state.setAttribute("enabled", Boolean.toString(enabled));
|
||||
element.addContent(state);
|
||||
|
||||
key.saveData(element);
|
||||
editor.saveData(element);
|
||||
getKey().saveData(element);
|
||||
getEditor().saveData(element);
|
||||
this.state.saveData(element);
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
private void initializePlugin() {
|
||||
if (initialized) return;
|
||||
initialized = true;
|
||||
@NotNull
|
||||
private static NotificationService getNotifications() {
|
||||
return getNotifications(null);
|
||||
}
|
||||
|
||||
Notifications.Bus.register(NotificationService.IDEAVIM_STICKY_NOTIFICATION_ID, NotificationDisplayType.STICKY_BALLOON);
|
||||
private boolean ideavimrcRegistered = false;
|
||||
|
||||
ApplicationManager.getApplication().invokeLater(this::updateState);
|
||||
|
||||
getEditor().turnOn();
|
||||
getSearch().turnOn();
|
||||
VimListenerManager.INSTANCE.turnOn();
|
||||
|
||||
// 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();
|
||||
private void registerIdeavimrc() {
|
||||
if (ideavimrcRegistered) return;
|
||||
ideavimrcRegistered = true;
|
||||
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
final File ideaVimRc = VimScriptParser.findIdeaVimRc();
|
||||
@@ -370,14 +312,16 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
return PluginId.getId(IDEAVIM_PLUGIN_ID);
|
||||
}
|
||||
|
||||
// [VERSION UPDATE] 193+ remove suppress
|
||||
@SuppressWarnings({"MissingRecentApi", "UnstableApiUsage"})
|
||||
@NotNull
|
||||
public static String getVersion() {
|
||||
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(getPluginId());
|
||||
if (!ApplicationManager.getApplication().isInternal()) {
|
||||
final IdeaPluginDescriptor plugin = PluginManager.getPlugin(getPluginId());
|
||||
return plugin != null ? plugin.getVersion() : "SNAPSHOT";
|
||||
}
|
||||
else {
|
||||
return "INTERNAL";
|
||||
return "INTERNAL" + (plugin != null ? " - " + plugin.getVersion() : "");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,6 +339,8 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
if (enabled) {
|
||||
getInstance().turnOnPlugin();
|
||||
}
|
||||
|
||||
VimStatusBar.INSTANCE.update();
|
||||
}
|
||||
|
||||
public static boolean isError() {
|
||||
@@ -446,19 +392,27 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
|
||||
@NotNull
|
||||
private static VimPlugin getInstance() {
|
||||
return (VimPlugin)ApplicationManager.getApplication().getComponent(IDEAVIM_COMPONENT_NAME);
|
||||
return ApplicationManager.getApplication().getComponent(VimPlugin.class);
|
||||
}
|
||||
|
||||
private void turnOnPlugin() {
|
||||
if (initialized) {
|
||||
KeyHandler.getInstance().fullReset(null);
|
||||
ApplicationManager.getApplication().invokeLater(this::updateState);
|
||||
|
||||
getEditor().turnOn();
|
||||
getSearch().turnOn();
|
||||
VimListenerManager.INSTANCE.turnOn();
|
||||
} else {
|
||||
initializePlugin();
|
||||
}
|
||||
getEditor().turnOn();
|
||||
getSearch().turnOn();
|
||||
VimListenerManager.INSTANCE.turnOn();
|
||||
|
||||
// Register vim actions in command mode
|
||||
RegisterActions.registerActions();
|
||||
|
||||
// Register ex handlers
|
||||
CommandParser.getInstance().registerHandlers();
|
||||
|
||||
// Register extensions
|
||||
VimExtensionRegistrar.registerExtensions();
|
||||
|
||||
// Execute ~/.ideavimrc
|
||||
registerIdeavimrc();
|
||||
}
|
||||
|
||||
private void turnOffPlugin() {
|
||||
@@ -470,19 +424,23 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
ExEntryPanel.fullReset();
|
||||
}
|
||||
|
||||
private boolean stateUpdated = false;
|
||||
|
||||
private void updateState() {
|
||||
if (stateUpdated) return;
|
||||
if (isEnabled() && !ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
stateUpdated = true;
|
||||
if (SystemInfo.isMac) {
|
||||
final MacKeyRepeat keyRepeat = MacKeyRepeat.getInstance();
|
||||
final Boolean enabled = keyRepeat.isEnabled();
|
||||
final Boolean isKeyRepeat = editor.isKeyRepeat();
|
||||
final Boolean isKeyRepeat = getEditor().isKeyRepeat();
|
||||
if ((enabled == null || !enabled) && (isKeyRepeat == null || isKeyRepeat)) {
|
||||
if (VimPlugin.getNotifications().enableRepeatingMode() == Messages.YES) {
|
||||
editor.setKeyRepeat(true);
|
||||
getEditor().setKeyRepeat(true);
|
||||
keyRepeat.setEnabled(true);
|
||||
}
|
||||
else {
|
||||
editor.setKeyRepeat(false);
|
||||
getEditor().setKeyRepeat(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -528,13 +486,13 @@ public class VimPlugin implements BaseComponent, PersistentStateComponent<Elemen
|
||||
|
||||
if (previousStateVersion > 0 && previousStateVersion < 5) {
|
||||
// Migrate settings from 4 to 5 version
|
||||
mark.readData(element);
|
||||
register.readData(element);
|
||||
search.readData(element);
|
||||
history.readData(element);
|
||||
getMark().readData(element);
|
||||
getRegister().readData(element);
|
||||
getSearch().readData(element);
|
||||
getHistory().readData(element);
|
||||
}
|
||||
key.readData(element);
|
||||
editor.readData(element);
|
||||
getKey().readData(element);
|
||||
getEditor().readData(element);
|
||||
this.state.readData(element);
|
||||
}
|
||||
}
|
||||
|
@@ -13,7 +13,7 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim
|
||||
|
@@ -10,7 +10,6 @@ import kotlin.reflect.KProperty
|
||||
class VimState {
|
||||
var isIdeaJoinNotified by StateProperty("idea-join")
|
||||
var isIdeaPutNotified by StateProperty("idea-put")
|
||||
var isTemplateInSelectModeNotified by StateProperty("template-selectmode")
|
||||
|
||||
fun readData(element: Element) {
|
||||
val notifications = element.getChild("notifications")
|
||||
|
@@ -13,13 +13,11 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim;
|
||||
|
||||
import com.intellij.codeInsight.lookup.Lookup;
|
||||
import com.intellij.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
@@ -27,12 +25,9 @@ import com.intellij.openapi.editor.actionSystem.ActionPlan;
|
||||
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.listener.SelectionVimListenerSuppressor;
|
||||
import com.maddyhome.idea.vim.listener.VimListenerSuppressor;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.KeyEvent;
|
||||
|
||||
/**
|
||||
* Accepts all regular keystrokes and passes them on to the Vim key handler.
|
||||
@@ -51,40 +46,16 @@ public class VimTypedActionHandler implements TypedActionHandlerEx {
|
||||
|
||||
@Override
|
||||
public void beforeExecute(@NotNull Editor editor, char charTyped, @NotNull DataContext context, @NotNull ActionPlan plan) {
|
||||
if (isEnabled(editor)) {
|
||||
handler.beforeHandleKey(editor, KeyStroke.getKeyStroke(charTyped), context, plan);
|
||||
}
|
||||
else {
|
||||
TypedActionHandler originalHandler = handler.getOriginalHandler();
|
||||
if (originalHandler instanceof TypedActionHandlerEx) {
|
||||
((TypedActionHandlerEx)originalHandler).beforeExecute(editor, charTyped, context, plan);
|
||||
}
|
||||
}
|
||||
handler.beforeHandleKey(editor, KeyStroke.getKeyStroke(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);
|
||||
}
|
||||
try {
|
||||
handler.handleKey(editor, KeyStroke.getKeyStroke(charTyped), new EditorDataContext(editor));
|
||||
}
|
||||
else {
|
||||
try (final VimListenerSuppressor ignored = SelectionVimListenerSuppressor.INSTANCE.lock()) {
|
||||
TypedActionHandler origHandler = handler.getOriginalHandler();
|
||||
origHandler.execute(editor, charTyped, context);
|
||||
}
|
||||
catch (Throwable e) {
|
||||
logger.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isEnabled(@NotNull Editor editor) {
|
||||
if (VimPlugin.isEnabled()) {
|
||||
final Lookup lookup = LookupManager.getActiveLookup(editor);
|
||||
return lookup == null || !lookup.isFocused();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@@ -0,0 +1,7 @@
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
interface ComplicatedKeysAction {
|
||||
val keyStrokesSet: Set<List<KeyStroke>>
|
||||
}
|
@@ -0,0 +1,16 @@
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
/**
|
||||
* There are some double-character commands like `cc`, `dd`, `yy`.
|
||||
* During the execution these commands are replaced with `c_`, `d_`, `y_`, etc.
|
||||
*
|
||||
* This is not any kind of workaround, this is exactly how the original vim works.
|
||||
* The `dd` command (and others) should not be processed as a monolith command, or it will lead to problems
|
||||
* like this: https://youtrack.jetbrains.com/issue/VIM-1189
|
||||
*
|
||||
* If some command implements this interface, and the user enters motion operator that is the same as the command itself, the
|
||||
* motion operator will be replaced with `_`.
|
||||
*/
|
||||
interface DuplicableOperatorAction {
|
||||
val duplicateWith: Char
|
||||
}
|
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* 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.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ExEntryAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.NVO;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet(":");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Command.Type getType() {
|
||||
return Command.Type.OTHER_READONLY;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
33
src/com/maddyhome/idea/vim/action/ExEntryAction.kt
Normal file
@@ -0,0 +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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
|
||||
class ExEntryAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_READONLY
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
VimPlugin.getProcess().startExCommand(editor, context, cmd)
|
||||
return true
|
||||
}
|
||||
}
|
@@ -1,65 +0,0 @@
|
||||
/*
|
||||
* 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.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
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 javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ResetModeAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@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;
|
||||
}
|
||||
}
|
34
src/com/maddyhome/idea/vim/action/ResetModeAction.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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.getTopLevelEditor
|
||||
|
||||
class ResetModeAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.RESET
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
KeyHandler.getInstance().fullReset(editor.getTopLevelEditor())
|
||||
return true
|
||||
}
|
||||
}
|
@@ -1,136 +0,0 @@
|
||||
/*
|
||||
* 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,53 +0,0 @@
|
||||
/*
|
||||
* 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.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.ToggleAction;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
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
|
||||
* but could also be used as a toolbar item.
|
||||
*/
|
||||
public class VimPluginToggleAction extends ToggleAction implements DumbAware {
|
||||
/**
|
||||
* Indicates if the toggle is on or off
|
||||
*
|
||||
* @param event The event that triggered the action
|
||||
* @return true if the toggle is on, false if off
|
||||
*/
|
||||
@Override
|
||||
public boolean isSelected(@NotNull AnActionEvent event) {
|
||||
return VimPlugin.isEnabled();
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies whether the toggle should be on or off
|
||||
*
|
||||
* @param event The event that triggered the action
|
||||
* @param b The new state - true is on, false is off
|
||||
*/
|
||||
@Override
|
||||
public void setSelected(@NotNull AnActionEvent event, boolean b) {
|
||||
VimPlugin.setEnabled(b);
|
||||
}
|
||||
}
|
44
src/com/maddyhome/idea/vim/action/VimPluginToggleAction.kt
Normal file
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.project.DumbAwareToggleAction
|
||||
import com.maddyhome.idea.vim.VimActions
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
|
||||
/**
|
||||
* This class is used to handle the Vim Plugin enabled/disabled toggle. This is most likely used as a menu option
|
||||
* but could also be used as a toolbar item.
|
||||
*/
|
||||
class VimPluginToggleAction : DumbAwareToggleAction() {
|
||||
override fun isSelected(event: AnActionEvent): Boolean = VimPlugin.isEnabled()
|
||||
|
||||
override fun setSelected(event: AnActionEvent, b: Boolean) {
|
||||
VimPlugin.setEnabled(b)
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
super.update(e)
|
||||
|
||||
e.presentation.text = if (VimActions.actionPlace == e.place) {
|
||||
if (VimPlugin.isEnabled()) "Enabled" else "Enable"
|
||||
} else "Vim Emulator"
|
||||
}
|
||||
}
|
@@ -1,245 +0,0 @@
|
||||
/*
|
||||
* 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.codeInsight.lookup.LookupManager;
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil;
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
import com.intellij.openapi.project.DumbAware;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.Key;
|
||||
import com.maddyhome.idea.vim.KeyHandler;
|
||||
import com.maddyhome.idea.vim.VimPlugin;
|
||||
import com.maddyhome.idea.vim.action.change.insert.InsertExitModeAction;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.helper.CommandStateHelper;
|
||||
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.option.ListOption;
|
||||
import com.maddyhome.idea.vim.option.OptionsManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.InputEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.util.*;
|
||||
|
||||
import static java.awt.event.KeyEvent.*;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
public class VimShortcutKeyAction extends AnAction implements DumbAware {
|
||||
private static final String ACTION_ID = "VimShortcutKeyAction";
|
||||
|
||||
@NotNull public static final Set<KeyStroke> VIM_ONLY_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
|
||||
.addAll(getKeyStrokes(VK_ENTER, 0))
|
||||
.addAll(getKeyStrokes(VK_ESCAPE, 0))
|
||||
.addAll(getKeyStrokes(VK_TAB, 0))
|
||||
.addAll(getKeyStrokes(VK_BACK_SPACE, 0, CTRL_MASK))
|
||||
.addAll(getKeyStrokes(VK_INSERT, 0))
|
||||
.addAll(getKeyStrokes(VK_DELETE, 0, CTRL_MASK))
|
||||
.addAll(getKeyStrokes(VK_UP, 0, CTRL_MASK, SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_DOWN, 0, CTRL_MASK, SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_LEFT, 0, CTRL_MASK, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_RIGHT, 0, CTRL_MASK, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_HOME, 0, CTRL_MASK, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_END, 0, CTRL_MASK, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_PAGE_UP, 0, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(VK_PAGE_DOWN, 0, SHIFT_MASK, CTRL_MASK | SHIFT_MASK))
|
||||
.build();
|
||||
|
||||
@NotNull private static final Set<KeyStroke> NON_FILE_EDITOR_KEYS = ImmutableSet.<KeyStroke>builder()
|
||||
.addAll(getKeyStrokes(VK_ENTER, 0))
|
||||
.addAll(getKeyStrokes(VK_ESCAPE, 0))
|
||||
.addAll(getKeyStrokes(VK_TAB, 0))
|
||||
.addAll(getKeyStrokes(VK_UP, 0))
|
||||
.addAll(getKeyStrokes(VK_DOWN, 0))
|
||||
.build();
|
||||
|
||||
private static final Logger ourLogger = Logger.getInstance(VimShortcutKeyAction.class.getName());
|
||||
private static AnAction ourInstance = null;
|
||||
|
||||
@Override
|
||||
public void actionPerformed(@NotNull AnActionEvent e) {
|
||||
final Editor editor = getEditor(e);
|
||||
final KeyStroke keyStroke = getKeyStroke(e);
|
||||
if (editor != null && keyStroke != null) {
|
||||
final ShortcutOwner owner = VimPlugin.getKey().getSavedShortcutConflicts().get(keyStroke);
|
||||
if (owner == ShortcutOwner.UNDEFINED) {
|
||||
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 (ProcessCanceledException ignored) {
|
||||
// Control-flow exceptions (like ProcessCanceledException) should never be logged
|
||||
// See {@link com.intellij.openapi.diagnostic.Logger.checkException}
|
||||
}
|
||||
catch (Throwable throwable) {
|
||||
ourLogger.error(throwable);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update(@NotNull AnActionEvent e) {
|
||||
e.getPresentation().setEnabled(isEnabled(e));
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static AnAction getInstance() {
|
||||
if (ourInstance == null) {
|
||||
final AnAction originalAction = ActionManager.getInstance().getAction(ACTION_ID);
|
||||
ourInstance = EmptyAction.wrap(originalAction);
|
||||
}
|
||||
return ourInstance;
|
||||
}
|
||||
|
||||
private boolean isEnabled(@NotNull AnActionEvent e) {
|
||||
if (!VimPlugin.isEnabled()) return false;
|
||||
|
||||
final Editor editor = getEditor(e);
|
||||
final KeyStroke keyStroke = getKeyStroke(e);
|
||||
if (editor != null && keyStroke != null) {
|
||||
// Workaround for smart step into
|
||||
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;
|
||||
}
|
||||
// Debug watch, Python console, etc.
|
||||
if (NON_FILE_EDITOR_KEYS.contains(keyStroke) && !EditorHelper.isFileEditor(editor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (VIM_ONLY_EDITOR_KEYS.contains(keyStroke)) {
|
||||
return true;
|
||||
}
|
||||
final Map<KeyStroke, ShortcutOwner> savedShortcutConflicts = VimPlugin.getKey().getSavedShortcutConflicts();
|
||||
final ShortcutOwner owner = savedShortcutConflicts.get(keyStroke);
|
||||
if (owner == ShortcutOwner.VIM) {
|
||||
return true;
|
||||
}
|
||||
else if (owner == ShortcutOwner.IDE) {
|
||||
return !isShortcutConflict(keyStroke);
|
||||
}
|
||||
else {
|
||||
if (isShortcutConflict(keyStroke)) {
|
||||
savedShortcutConflicts.put(keyStroke, ShortcutOwner.UNDEFINED);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
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);
|
||||
if (fileEditorManager == null) return false;
|
||||
return Arrays.stream(fileEditorManager.getAllEditors())
|
||||
.anyMatch(fileEditor -> editor.equals(EditorUtil.getEditorEx(fileEditor)));
|
||||
}
|
||||
|
||||
private boolean isEnabledForLookup(@NotNull KeyStroke keyStroke) {
|
||||
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
|
||||
if (keys.size() == 1 && keyStroke.equals(keys.get(0))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
//noinspection RedundantIfStatement
|
||||
if (keyStroke.equals(KeyStroke.getKeyStroke(VK_BACK_SPACE, 0))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isShortcutConflict(@NotNull KeyStroke keyStroke) {
|
||||
return !VimPlugin.getKey().getKeymapConflicts(keyStroke).isEmpty();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private static List<KeyStroke> getKeyStrokes(int keyCode, @NotNull int... modifiers) {
|
||||
final List<KeyStroke> keyStrokes = new ArrayList<>();
|
||||
for (int modifier : modifiers) {
|
||||
keyStrokes.add(KeyStroke.getKeyStroke(keyCode, modifier));
|
||||
}
|
||||
return keyStrokes;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private KeyStroke getKeyStroke(@NotNull AnActionEvent e) {
|
||||
final InputEvent inputEvent = e.getInputEvent();
|
||||
if (inputEvent instanceof KeyEvent) {
|
||||
final KeyEvent keyEvent = (KeyEvent)inputEvent;
|
||||
return KeyStroke.getKeyStrokeForEvent(keyEvent);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
private Editor getEditor(@NotNull AnActionEvent e) {
|
||||
return e.getData(PlatformDataKeys.EDITOR);
|
||||
}
|
||||
}
|
223
src/com/maddyhome/idea/vim/action/VimShortcutKeyAction.kt
Normal file
@@ -0,0 +1,223 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action
|
||||
|
||||
import com.google.common.collect.ImmutableSet
|
||||
import com.intellij.codeInsight.lookup.LookupManager
|
||||
import com.intellij.openapi.actionSystem.ActionManager
|
||||
import com.intellij.openapi.actionSystem.AnAction
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent
|
||||
import com.intellij.openapi.actionSystem.EmptyAction
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||
import com.intellij.openapi.diagnostic.Logger
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.intellij.openapi.editor.ex.util.EditorUtil
|
||||
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
|
||||
import com.intellij.openapi.progress.ProcessCanceledException
|
||||
import com.intellij.openapi.project.DumbAware
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.ui.KeyStrokeAdapter
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.helper.EditorDataContext
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.StringHelper
|
||||
import com.maddyhome.idea.vim.helper.inInsertMode
|
||||
import com.maddyhome.idea.vim.helper.inNormalMode
|
||||
import com.maddyhome.idea.vim.key.ShortcutOwner
|
||||
import com.maddyhome.idea.vim.listener.IdeaSpecifics.aceJumpActive
|
||||
import com.maddyhome.idea.vim.option.OptionsManager
|
||||
import java.awt.event.InputEvent
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
/**
|
||||
* Handles Vim keys that are treated as action shortcuts by the IDE.
|
||||
*
|
||||
*
|
||||
* These keys are not passed to [com.maddyhome.idea.vim.VimTypedActionHandler] and should be handled by actions.
|
||||
*/
|
||||
class VimShortcutKeyAction : AnAction(), DumbAware {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
val editor = getEditor(e)
|
||||
val keyStroke = getKeyStroke(e)
|
||||
if (editor != null && keyStroke != null) {
|
||||
val owner = VimPlugin.getKey().savedShortcutConflicts[keyStroke]
|
||||
if (owner == ShortcutOwner.UNDEFINED) {
|
||||
VimPlugin.getNotifications(editor.project).notifyAboutShortcutConflict(keyStroke)
|
||||
}
|
||||
// Should we use HelperKt.getTopLevelEditor(editor) here, as we did in former EditorKeyHandler?
|
||||
try {
|
||||
KeyHandler.getInstance().handleKey(editor, keyStroke, EditorDataContext(editor))
|
||||
} catch (ignored: ProcessCanceledException) {
|
||||
// Control-flow exceptions (like ProcessCanceledException) should never be logged
|
||||
// See {@link com.intellij.openapi.diagnostic.Logger.checkException}
|
||||
} catch (throwable: Throwable) {
|
||||
ourLogger.error(throwable)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
e.presentation.isEnabled = isEnabled(e)
|
||||
}
|
||||
|
||||
private fun isEnabled(e: AnActionEvent): Boolean {
|
||||
if (!VimPlugin.isEnabled()) return false
|
||||
val editor = getEditor(e)
|
||||
val keyStroke = getKeyStroke(e)
|
||||
if (editor != null && keyStroke != null) {
|
||||
// Workaround for smart step into
|
||||
@Suppress("DEPRECATION")
|
||||
val 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
|
||||
if (aceJumpActive()) return false
|
||||
val keyCode = keyStroke.keyCode
|
||||
if (LookupManager.getActiveLookup(editor) != null) {
|
||||
return LookupKeys.isEnabledForLookup(keyStroke)
|
||||
}
|
||||
if (keyCode == KeyEvent.VK_ESCAPE) {
|
||||
return isEnabledForEscape(editor)
|
||||
}
|
||||
if (editor.inInsertMode) { // XXX: <Tab> won't be recorded in macros
|
||||
if (keyCode == KeyEvent.VK_TAB) {
|
||||
VimPlugin.getChange().tabAction = true
|
||||
return false
|
||||
}
|
||||
// Debug watch, Python console, etc.
|
||||
if (NON_FILE_EDITOR_KEYS.contains(keyStroke) && !EditorHelper.isFileEditor(editor)) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (VIM_ONLY_EDITOR_KEYS.contains(keyStroke)) {
|
||||
return true
|
||||
}
|
||||
val savedShortcutConflicts = VimPlugin.getKey().savedShortcutConflicts
|
||||
return when (savedShortcutConflicts[keyStroke]) {
|
||||
ShortcutOwner.VIM -> true
|
||||
ShortcutOwner.IDE -> !isShortcutConflict(keyStroke)
|
||||
else -> {
|
||||
if (isShortcutConflict(keyStroke)) {
|
||||
savedShortcutConflicts[keyStroke] = ShortcutOwner.UNDEFINED
|
||||
}
|
||||
true
|
||||
}
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
private fun isEnabledForEscape(editor: Editor): Boolean {
|
||||
return isPrimaryEditor(editor) || EditorHelper.isFileEditor(editor) && !editor.inNormalMode
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the editor is a primary editor in the main editing area.
|
||||
*/
|
||||
private fun isPrimaryEditor(editor: Editor): Boolean {
|
||||
val project = editor.project ?: return false
|
||||
val fileEditorManager = FileEditorManagerEx.getInstanceEx(project) ?: return false
|
||||
return fileEditorManager.allEditors.any { fileEditor -> editor == EditorUtil.getEditorEx(fileEditor) }
|
||||
}
|
||||
|
||||
private fun isShortcutConflict(keyStroke: KeyStroke): Boolean {
|
||||
return VimPlugin.getKey().getKeymapConflicts(keyStroke).isNotEmpty()
|
||||
}
|
||||
|
||||
/**
|
||||
* getDefaultKeyStroke is needed for NEO layout keyboard VIM-987
|
||||
* but we should cache the value because on the second call (isEnabled -> actionPerformed)
|
||||
* the event is already consumed
|
||||
*/
|
||||
private var keyStrokeCache: Pair<KeyEvent?, KeyStroke?> = null to null
|
||||
|
||||
private fun getKeyStroke(e: AnActionEvent): KeyStroke? {
|
||||
val inputEvent = e.inputEvent
|
||||
if (inputEvent is KeyEvent) {
|
||||
val defaultKeyStroke = KeyStrokeAdapter.getDefaultKeyStroke(inputEvent)
|
||||
val strokeCache = keyStrokeCache
|
||||
if (defaultKeyStroke != null) {
|
||||
keyStrokeCache = inputEvent to defaultKeyStroke
|
||||
return defaultKeyStroke
|
||||
} else if (strokeCache.first === inputEvent) {
|
||||
keyStrokeCache = null to null
|
||||
return strokeCache.second
|
||||
}
|
||||
return KeyStroke.getKeyStrokeForEvent(inputEvent)
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun getEditor(e: AnActionEvent): Editor? = e.getData(PlatformDataKeys.EDITOR)
|
||||
|
||||
/**
|
||||
* Every time the key pressed with an active lookup, there is a decision:
|
||||
* should this key be processed by IdeaVim, or by IDE. For example, dot and enter should be processed by IDE, but
|
||||
* <C-W> by IdeaVim.
|
||||
*
|
||||
* The list of keys that should be processed by IDE is stored in [OptionsManager.lookupKeys]. So, we should search
|
||||
* if the pressed key is presented in this list. The caches are used to speedup the process.
|
||||
*/
|
||||
private object LookupKeys {
|
||||
private var parsedLookupKeys: Set<KeyStroke> = parseLookupKeys()
|
||||
|
||||
init {
|
||||
OptionsManager.lookupKeys.addOptionChangeListener { _, _ ->
|
||||
parsedLookupKeys = parseLookupKeys()
|
||||
}
|
||||
}
|
||||
|
||||
fun isEnabledForLookup(keyStroke: KeyStroke): Boolean = keyStroke !in parsedLookupKeys
|
||||
|
||||
private fun parseLookupKeys() = OptionsManager.lookupKeys.values()
|
||||
.map { StringHelper.parseKeys(it) }.filter { it.isNotEmpty() }.map { it.first() }.toSet()
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val VIM_ONLY_EDITOR_KEYS: Set<KeyStroke> = ImmutableSet.builder<KeyStroke>().addAll(getKeyStrokes(KeyEvent.VK_ENTER, 0)).addAll(getKeyStrokes(KeyEvent.VK_ESCAPE, 0))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_TAB, 0)).addAll(getKeyStrokes(KeyEvent.VK_BACK_SPACE, 0, InputEvent.CTRL_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_INSERT, 0)).addAll(getKeyStrokes(KeyEvent.VK_DELETE, 0, InputEvent.CTRL_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_UP, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK)).addAll(getKeyStrokes(KeyEvent.VK_DOWN, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_LEFT, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_RIGHT, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_HOME, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_END, 0, InputEvent.CTRL_MASK, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_PAGE_UP, 0, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_PAGE_DOWN, 0, InputEvent.SHIFT_MASK, InputEvent.CTRL_MASK or InputEvent.SHIFT_MASK)).build()
|
||||
|
||||
private const val ACTION_ID = "VimShortcutKeyAction"
|
||||
|
||||
private val NON_FILE_EDITOR_KEYS: Set<KeyStroke> = ImmutableSet.builder<KeyStroke>()
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_ENTER, 0))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_ESCAPE, 0))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_TAB, 0))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_UP, 0))
|
||||
.addAll(getKeyStrokes(KeyEvent.VK_DOWN, 0))
|
||||
.build()
|
||||
|
||||
private val ourLogger = Logger.getInstance(VimShortcutKeyAction::class.java.name)
|
||||
|
||||
@JvmStatic
|
||||
val instance: AnAction by lazy {
|
||||
EmptyAction.wrap(ActionManager.getInstance().getAction(ACTION_ID))
|
||||
}
|
||||
|
||||
private fun getKeyStrokes(keyCode: Int, vararg modifiers: Int) = modifiers.map { KeyStroke.getKeyStroke(keyCode, it) }
|
||||
}
|
||||
}
|
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* 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);
|
||||
}
|
||||
}
|
63
src/com/maddyhome/idea/vim/action/change/OperatorAction.kt
Normal file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 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 <https://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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.SelectionType
|
||||
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.helper.commandState
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class OperatorAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
val operatorFunction = VimPlugin.getKey().operatorFunction
|
||||
if (operatorFunction != null) {
|
||||
val argument = cmd.argument
|
||||
if (argument != null) {
|
||||
if (!editor.commandState.isDotRepeatInProgress) {
|
||||
VimRepeater.Extension.argumentCaptured = argument
|
||||
}
|
||||
val motion = argument.motion
|
||||
val range = MotionGroup
|
||||
.getMotionRange(editor, editor.caretModel.primaryCaret, context, cmd.count, cmd.rawCount, argument)
|
||||
if (range != null) {
|
||||
VimPlugin.getMark().setChangeMarks(editor, range)
|
||||
val selectionType = SelectionType.fromCommandFlags(motion.flags)
|
||||
KeyHandler.getInstance().reset(editor)
|
||||
return operatorFunction.apply(editor, context, selectionType)
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
VimPlugin.showMessage(MessageHelper.message("E774"))
|
||||
return false
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* 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.action.VimCommandAction;
|
||||
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.UndoRedoHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class RedoAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -13,27 +13,18 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
package com.maddyhome.idea.vim.ex;
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.UndoRedoHelper.redo
|
||||
|
||||
/**
|
||||
* Exception class
|
||||
*/
|
||||
public class InvalidArgumentException extends ExException {
|
||||
/**
|
||||
* Constructs an <code>InvalidArgumentException</code> with no specified detail message.
|
||||
*/
|
||||
public InvalidArgumentException() {
|
||||
}
|
||||
class RedoAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
/**
|
||||
* Constructs an <code>InvalidArgumentException</code> with the specified detail message.
|
||||
*
|
||||
* @param s the detail message.
|
||||
*/
|
||||
public InvalidArgumentException(String s) {
|
||||
super(s);
|
||||
}
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean = redo(context)
|
||||
}
|
@@ -1,107 +0,0 @@
|
||||
/*
|
||||
* 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.Argument;
|
||||
import com.maddyhome.idea.vim.command.Command;
|
||||
import com.maddyhome.idea.vim.command.CommandState;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class RepeatChangeAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet(".");
|
||||
}
|
||||
|
||||
@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) {
|
||||
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();
|
||||
int lastFTCmd = VimPlugin.getMotion().getLastFTCmd();
|
||||
char lastFTChar = VimPlugin.getMotion().getLastFTChar();
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
141
src/com/maddyhome/idea/vim/action/change/RepeatChangeAction.kt
Normal file
@@ -0,0 +1,141 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext
|
||||
import com.intellij.openapi.command.CommandProcessor
|
||||
import com.intellij.openapi.editor.Editor
|
||||
import com.maddyhome.idea.vim.KeyHandler
|
||||
import com.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.extension.VimExtensionHandler
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.commandState
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
class RepeatChangeAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_WRITABLE
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
val state = editor.commandState
|
||||
val lastCommand = VimRepeater.lastChangeCommand
|
||||
|
||||
if (lastCommand == null && VimRepeater.Extension.lastExtensionHandler == null) return false
|
||||
|
||||
// Save state
|
||||
val save = state.command
|
||||
val lastFTCmd = VimPlugin.getMotion().lastFTCmd
|
||||
val lastFTChar = VimPlugin.getMotion().lastFTChar
|
||||
val reg = VimPlugin.getRegister().currentRegister
|
||||
val lastHandler = VimRepeater.Extension.lastExtensionHandler
|
||||
val repeatHandler = VimRepeater.repeatHandler
|
||||
|
||||
state.isDotRepeatInProgress = true
|
||||
VimPlugin.getRegister().selectRegister(VimRepeater.lastChangeRegister)
|
||||
|
||||
try {
|
||||
if (repeatHandler && lastHandler != null) {
|
||||
val processor = CommandProcessor.getInstance()
|
||||
processor.executeCommand(editor.project, { lastHandler.execute(editor, context) }, "Vim " + lastHandler.javaClass.simpleName, null)
|
||||
} else if (!repeatHandler && lastCommand != null) {
|
||||
if (cmd.rawCount > 0) {
|
||||
lastCommand.count = cmd.count
|
||||
val arg = lastCommand.argument
|
||||
if (arg != null) {
|
||||
val mot = arg.motion
|
||||
mot.count = 0
|
||||
}
|
||||
}
|
||||
state.setCommand(lastCommand)
|
||||
|
||||
KeyHandler.executeVimAction(editor, lastCommand.action, context)
|
||||
|
||||
VimRepeater.saveLastChange(lastCommand)
|
||||
}
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
|
||||
state.isDotRepeatInProgress = false
|
||||
|
||||
// Restore state
|
||||
if (save != null) state.setCommand(save)
|
||||
VimPlugin.getMotion().setLastFTCmd(lastFTCmd, lastFTChar)
|
||||
if (lastHandler != null) VimRepeater.Extension.lastExtensionHandler = lastHandler
|
||||
VimRepeater.repeatHandler = repeatHandler
|
||||
VimRepeater.Extension.reset()
|
||||
VimPlugin.getRegister().selectRegister(reg)
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
object VimRepeater {
|
||||
var repeatHandler = false
|
||||
|
||||
var lastChangeCommand: Command? = null
|
||||
private set
|
||||
var lastChangeRegister = VimPlugin.getRegister().defaultRegister
|
||||
private set
|
||||
|
||||
fun saveLastChange(command: Command) {
|
||||
lastChangeCommand = command
|
||||
lastChangeRegister = VimPlugin.getRegister().currentRegister
|
||||
}
|
||||
|
||||
object Extension {
|
||||
var lastExtensionHandler: VimExtensionHandler? = null
|
||||
var argumentCaptured: Argument? = null
|
||||
|
||||
private val keyStrokes = mutableListOf<KeyStroke>()
|
||||
private val strings = mutableListOf<String>()
|
||||
|
||||
private var keystrokePointer = 0
|
||||
private var stringPointer = 0
|
||||
|
||||
fun addKeystroke(key: KeyStroke) = keyStrokes.add(key)
|
||||
fun addString(key: String) = strings.add(key)
|
||||
|
||||
fun consumeKeystroke(): KeyStroke? {
|
||||
if (keystrokePointer in keyStrokes.indices) {
|
||||
keystrokePointer += 1
|
||||
return keyStrokes[keystrokePointer - 1]
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun consumeString(): String? {
|
||||
if (stringPointer in strings.indices) {
|
||||
stringPointer += 1
|
||||
return strings[stringPointer - 1]
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
fun reset() {
|
||||
keystrokePointer = 0
|
||||
stringPointer = 0
|
||||
}
|
||||
|
||||
fun clean() {
|
||||
keyStrokes.clear()
|
||||
strings.clear()
|
||||
keystrokePointer = 0
|
||||
stringPointer = 0
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,71 +0,0 @@
|
||||
/*
|
||||
* 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.action.VimCommandAction;
|
||||
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.ExException;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class RepeatExCommandAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("@:");
|
||||
}
|
||||
|
||||
@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 command) {
|
||||
int count = command.getCount();
|
||||
try {
|
||||
return CommandParser.getInstance().processLastCommand(editor, context, count);
|
||||
}
|
||||
catch (ExException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -1,64 +0,0 @@
|
||||
/*
|
||||
* 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.action.VimCommandAction;
|
||||
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.UndoRedoHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class UndoAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
39
src/com/maddyhome/idea/vim/action/change/UndoAction.kt
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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 <https://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.action.ComplicatedKeysAction
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.StringHelper
|
||||
import com.maddyhome.idea.vim.helper.UndoRedoHelper.undo
|
||||
import java.awt.event.KeyEvent
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
class UndoAction : VimActionHandler.SingleExecution(), ComplicatedKeysAction {
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = setOf(
|
||||
StringHelper.parseKeys("u"),
|
||||
listOf(KeyStroke.getKeyStroke(KeyEvent.VK_UNDO, 0))
|
||||
)
|
||||
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean = undo(context)
|
||||
}
|
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
final public class AutoIndentLinesVisualAction 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) {
|
||||
VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true));
|
||||
return true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.V;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("=");
|
||||
}
|
||||
|
||||
@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_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL);
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class AutoIndentLinesVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
VimPlugin.getChange().autoIndentRange(editor, caret, context, range.toVimTextRange(true))
|
||||
return true
|
||||
}
|
||||
}
|
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCaseLowerMotionAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("gu");
|
||||
}
|
||||
|
||||
@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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
class ChangeCaseLowerMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override val duplicateWith: Char = 'u'
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_LOWER, argument)
|
||||
}
|
||||
}
|
@@ -1,89 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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 com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import com.maddyhome.idea.vim.helper.HelperKt;
|
||||
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 ChangeCaseLowerVisualAction 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("u");
|
||||
}
|
||||
|
||||
@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,50 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.helper.getTopLevelEditor
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeCaseLowerVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
val topLevelEditor = editor.getTopLevelEditor()
|
||||
return VimPlugin.getChange()
|
||||
.changeCaseRange(topLevelEditor, caret, range.toVimTextRange(false), CharacterHelper.CASE_LOWER)
|
||||
}
|
||||
}
|
@@ -1,73 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCaseToggleCharacterAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
class ChangeCaseToggleCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return VimPlugin.getChange().changeCaseToggleCharacter(editor, caret, count)
|
||||
}
|
||||
}
|
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCaseToggleMotionAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
class ChangeCaseToggleMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override val duplicateWith: Char = '~'
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_TOGGLE, argument)
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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 com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
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 ChangeCaseToggleVisualAction 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()
|
||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.V;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("~");
|
||||
}
|
||||
|
||||
@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,48 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeCaseToggleVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
return VimPlugin.getChange()
|
||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_TOGGLE)
|
||||
}
|
||||
}
|
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCaseUpperMotionAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
|
||||
class ChangeCaseUpperMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override val duplicateWith: Char = 'U'
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return argument != null &&
|
||||
VimPlugin.getChange()
|
||||
.changeCaseMotion(editor, caret, context, count, rawCount, CharacterHelper.CASE_UPPER, argument)
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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 com.maddyhome.idea.vim.helper.CharacterHelper;
|
||||
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 ChangeCaseUpperVisualAction 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()
|
||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.V;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("U");
|
||||
}
|
||||
|
||||
@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,48 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.CharacterHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeCaseUpperVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
return VimPlugin.getChange()
|
||||
.changeCaseRange(editor, caret, range.toVimTextRange(false), CharacterHelper.CASE_UPPER)
|
||||
}
|
||||
}
|
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCharacterAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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());
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -13,57 +13,34 @@
|
||||
* 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/>.
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package com.maddyhome.idea.vim.action.change.shift
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.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.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
import javax.swing.KeyStroke
|
||||
|
||||
|
||||
class ShiftLeftLinesAction : VimCommandAction() {
|
||||
override val mappingModes: Set<MappingMode> = MappingMode.I
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<C-D>")
|
||||
|
||||
override val type: Command.Type = Command.Type.INSERT
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = EnumSet.of(CommandFlags.FLAG_SAVE_STROKE)
|
||||
|
||||
override fun makeActionHandler(): VimActionHandler = ShiftLeftLinesActionHandler
|
||||
}
|
||||
|
||||
class ShiftLeftLinesNormalModeAction : VimCommandAction() {
|
||||
override val mappingModes: Set<MappingMode> = MappingMode.N
|
||||
|
||||
override val keyStrokesSet: Set<List<KeyStroke>> = parseKeysSet("<<")
|
||||
|
||||
class ChangeCharacterAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override fun makeActionHandler(): VimActionHandler = ShiftLeftLinesActionHandler
|
||||
}
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_ALLOW_DIGRAPH)
|
||||
|
||||
private object ShiftLeftLinesActionHandler : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
VimPlugin.getChange().indentLines(editor, caret, context, count, -1)
|
||||
|
||||
return true
|
||||
return argument != null && VimPlugin.getChange().changeCharacter(editor, caret, count, argument.character)
|
||||
}
|
||||
}
|
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeCharactersAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
class ChangeCharactersAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_NO_REPEAT_INSERT, CommandFlags.FLAG_MULTIKEY_UNDO)
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return VimPlugin.getChange().changeCharacters(editor, caret, count)
|
||||
}
|
||||
}
|
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeEndOfLineAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
class ChangeEndOfLineAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_NO_REPEAT_INSERT, CommandFlags.FLAG_MULTIKEY_UNDO)
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return VimPlugin.getChange().changeEndOfLine(editor, caret, count)
|
||||
}
|
||||
}
|
@@ -1,75 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
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.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.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeLastGlobalSearchReplaceAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("g&");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Command.Type getType() {
|
||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||
}
|
||||
|
||||
@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", "//~/&");
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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 <https://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.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.ex.ranges.LineRange
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
|
||||
class ChangeLastGlobalSearchReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
val range = LineRange(0, EditorHelper.getLineCount(editor) - 1)
|
||||
return VimPlugin.getSearch()
|
||||
.searchAndReplace(editor, editor.caretModel.primaryCaret, range, "s", "//~/&")
|
||||
}
|
||||
}
|
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.handler.ChangeEditorActionHandler;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeLastSearchReplaceAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("&");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Command.Type getType() {
|
||||
return Command.Type.OTHER_SELF_SYNCHRONIZED;
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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 <https://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.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.ex.ranges.LineRange
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
class ChangeLastSearchReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.OTHER_SELF_SYNCHRONIZED
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
var result = true
|
||||
for (caret in editor.caretModel.allCarets) {
|
||||
val line = caret.logicalPosition.line
|
||||
if (!VimPlugin.getSearch().searchAndReplace(editor, caret, LineRange(line, line), "s", "//~/")) {
|
||||
result = false
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
}
|
@@ -1,81 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeLineAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
class ChangeLineAction : ChangeEditorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_NO_REPEAT_INSERT, CommandFlags.FLAG_MULTIKEY_UNDO)
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return VimPlugin.getChange().changeLine(editor, caret, count, context)
|
||||
}
|
||||
}
|
@@ -1,88 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeMotionAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.handler.ChangeEditorActionHandler
|
||||
|
||||
class ChangeMotionAction : ChangeEditorActionHandler.ForEachCaret(), DuplicableOperatorAction {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override val duplicateWith: Char = 'c'
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
return argument != null && VimPlugin.getChange().changeMotion(editor, caret, context, count, rawCount, argument)
|
||||
}
|
||||
}
|
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
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.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.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ChangeReplaceAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 <https://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.maddyhome.idea.vim.VimPlugin
|
||||
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.handler.ChangeEditorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
class ChangeReplaceAction : ChangeEditorActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MULTIKEY_UNDO)
|
||||
|
||||
override fun execute(editor: Editor,
|
||||
context: DataContext,
|
||||
count: Int,
|
||||
rawCount: Int,
|
||||
argument: Argument?): Boolean {
|
||||
VimPlugin.getChange().changeReplace(editor, context)
|
||||
return true
|
||||
}
|
||||
}
|
@@ -1,86 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
final public class ChangeVisualAction 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().changeRange(editor, caret, range.toVimTextRange(false), range.getType(), context);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.V;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("c", "s");
|
||||
}
|
||||
|
||||
@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_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||
}
|
||||
}
|
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeVisualAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
return VimPlugin.getChange().changeRange(editor, caret, range.toVimTextRange(false), range.type, context)
|
||||
}
|
||||
}
|
@@ -1,95 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.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;
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
final public class ChangeVisualCharacterAction 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("r");
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Command.Type getType() {
|
||||
return Command.Type.CHANGE;
|
||||
}
|
||||
|
||||
@Contract(pure = true)
|
||||
@NotNull
|
||||
@Override
|
||||
final public Argument.Type getArgumentType() {
|
||||
return Argument.Type.DIGRAPH;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public EnumSet<CommandFlags> getFlags() {
|
||||
return EnumSet.of(CommandFlags.FLAG_ALLOW_DIGRAPH, CommandFlags.FLAG_EXIT_VISUAL);
|
||||
}
|
||||
}
|
@@ -0,0 +1,51 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.group.visual.VimSelection
|
||||
import com.maddyhome.idea.vim.handler.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeVisualCharacterAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.DIGRAPH
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_ALLOW_DIGRAPH, CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
val argument = cmd.argument
|
||||
return argument != null &&
|
||||
VimPlugin.getChange().changeCharacterRange(editor, range.toVimTextRange(false), argument.character)
|
||||
}
|
||||
}
|
@@ -1,92 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.helper.EditorHelper;
|
||||
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 ChangeVisualLinesAction 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("R", "S");
|
||||
}
|
||||
|
||||
@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_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||
}
|
||||
}
|
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
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.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeVisualLinesAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
val textRange = range.toVimTextRange(true)
|
||||
val lineRange = TextRange(EditorHelper.getLineStartForOffset(editor, textRange.startOffset),
|
||||
EditorHelper.getLineEndForOffset(editor, textRange.endOffset) + 1)
|
||||
return VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context)
|
||||
}
|
||||
}
|
@@ -1,104 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
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.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.helper.EditorHelper;
|
||||
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 ChangeVisualLinesEndAction 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) {
|
||||
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++) {
|
||||
if (ends[i] > starts[i]) {
|
||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i]);
|
||||
}
|
||||
}
|
||||
final TextRange blockRange = new TextRange(starts, ends);
|
||||
return VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE, context);
|
||||
}
|
||||
else {
|
||||
final TextRange lineRange = new TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.getStartOffset()),
|
||||
EditorHelper.getLineEndForOffset(editor, vimTextRange.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;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("C");
|
||||
}
|
||||
|
||||
@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_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL);
|
||||
}
|
||||
}
|
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* 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 <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.maddyhome.idea.vim.action.change.change
|
||||
|
||||
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.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
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.VisualOperatorActionHandler
|
||||
import com.maddyhome.idea.vim.helper.EditorHelper
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class ChangeVisualLinesEndAction : VisualOperatorActionHandler.ForEachCaret() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MOT_LINEWISE, CommandFlags.FLAG_MULTIKEY_UNDO, CommandFlags.FLAG_EXIT_VISUAL)
|
||||
|
||||
override fun executeAction(editor: Editor,
|
||||
caret: Caret,
|
||||
context: DataContext,
|
||||
cmd: Command,
|
||||
range: VimSelection): Boolean {
|
||||
val vimTextRange = range.toVimTextRange(true)
|
||||
return if (range.type == SelectionType.BLOCK_WISE && vimTextRange.isMultiple) {
|
||||
val starts = vimTextRange.startOffsets
|
||||
val ends = vimTextRange.endOffsets
|
||||
for (i in starts.indices) {
|
||||
if (ends[i] > starts[i]) {
|
||||
ends[i] = EditorHelper.getLineEndForOffset(editor, starts[i])
|
||||
}
|
||||
}
|
||||
val blockRange = TextRange(starts, ends)
|
||||
VimPlugin.getChange().changeRange(editor, caret, blockRange, SelectionType.BLOCK_WISE, context)
|
||||
} else {
|
||||
val lineRange = TextRange(EditorHelper.getLineStartForOffset(editor, vimTextRange.startOffset),
|
||||
EditorHelper.getLineEndForOffset(editor, vimTextRange.endOffset) + 1)
|
||||
VimPlugin.getChange().changeRange(editor, caret, lineRange, SelectionType.LINE_WISE, context)
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
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.MappingMode;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class FilterCountLinesAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("!!");
|
||||
}
|
||||
|
||||
@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,111 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
import com.intellij.openapi.editor.Editor;
|
||||
import com.intellij.openapi.editor.LogicalPosition;
|
||||
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.CommandFlags;
|
||||
import com.maddyhome.idea.vim.command.MappingMode;
|
||||
import com.maddyhome.idea.vim.common.TextRange;
|
||||
import com.maddyhome.idea.vim.group.MotionGroup;
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.EnumSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class FilterMotionAction extends VimCommandAction {
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<MappingMode> getMappingModes() {
|
||||
return MappingMode.N;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("!");
|
||||
}
|
||||
|
||||
@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 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;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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 <https://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.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.action.DuplicableOperatorAction
|
||||
import com.maddyhome.idea.vim.command.Argument
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.group.MotionGroup
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.endOffsetInclusive
|
||||
|
||||
|
||||
class FilterMotionAction : VimActionHandler.SingleExecution(), DuplicableOperatorAction {
|
||||
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val argumentType: Argument.Type = Argument.Type.MOTION
|
||||
|
||||
override val duplicateWith: Char = '!'
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
val argument = cmd.argument ?: return false
|
||||
val range = MotionGroup
|
||||
.getMotionRange(editor, editor.caretModel.primaryCaret, context, cmd.count, cmd.rawCount,
|
||||
argument)
|
||||
?: return false
|
||||
|
||||
val current = editor.caretModel.logicalPosition
|
||||
val start = editor.offsetToLogicalPosition(range.startOffset)
|
||||
val end = editor.offsetToLogicalPosition(range.endOffsetInclusive)
|
||||
if (current.line != start.line) {
|
||||
MotionGroup.moveCaret(editor, editor.caretModel.primaryCaret, range.startOffset)
|
||||
}
|
||||
|
||||
val count = if (start.line < end.line) end.line - start.line + 1 else 1
|
||||
|
||||
VimPlugin.getProcess().startFilterCommand(editor, context, Argument.EMPTY_COMMAND.copy(rawCount = count))
|
||||
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
@@ -1,80 +0,0 @@
|
||||
/*
|
||||
* 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;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataContext;
|
||||
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.handler.VimActionHandler;
|
||||
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 FilterVisualLinesAction 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) {
|
||||
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;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
final public Set<List<KeyStroke>> getKeyStrokesSet() {
|
||||
return parseKeysSet("!");
|
||||
}
|
||||
|
||||
@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_MOT_LINEWISE);
|
||||
}
|
||||
}
|
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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 <https://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.maddyhome.idea.vim.VimPlugin
|
||||
import com.maddyhome.idea.vim.command.Command
|
||||
import com.maddyhome.idea.vim.command.CommandFlags
|
||||
import com.maddyhome.idea.vim.handler.VimActionHandler
|
||||
import com.maddyhome.idea.vim.helper.enumSetOf
|
||||
import com.maddyhome.idea.vim.helper.exitVisualMode
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
* @author vlan
|
||||
*/
|
||||
class FilterVisualLinesAction : VimActionHandler.SingleExecution() {
|
||||
override val type: Command.Type = Command.Type.CHANGE
|
||||
|
||||
override val flags: EnumSet<CommandFlags> = enumSetOf(CommandFlags.FLAG_MOT_LINEWISE)
|
||||
|
||||
override fun execute(editor: Editor, context: DataContext, cmd: Command): Boolean {
|
||||
VimPlugin.getProcess().startFilterCommand(editor, context, cmd)
|
||||
editor.exitVisualMode()
|
||||
return true
|
||||
}
|
||||
}
|