├── .gitignore
├── LICENSE
├── README.md
├── build.gradle.kts
├── ideavim_extension.iml
└── src
└── main
├── kotlin
└── io
│ └── github
│ └── hadixlin
│ └── iss
│ ├── InputMethodAutoSwitcher.kt
│ ├── InputMethodSwitcher.kt
│ ├── KeepEnglishInNormalAndRestoreInInsertExtension.kt
│ ├── KeepEnglishInNormalExtension.kt
│ ├── SystemInputMethodSwitcher.kt
│ ├── lin
│ ├── LinFcitx5RimeSwitcher.kt
│ ├── LinFcitxRemoteSwitcher.kt
│ └── LinuxIbusSwitcher.kt
│ ├── mac
│ ├── MacInputMethodSwitcher.kt
│ └── MacNative.kt
│ └── win
│ ├── WinInputMethodSwitcher.kt
│ └── WinNative.kt
└── resources
├── META-INF
└── plugin.xml
├── darwin-aarch64
└── libinput-source-switcher.dylib
└── darwin
└── libinput-source-switcher.dylib
/.gitignore:
--------------------------------------------------------------------------------
1 | # Created by .ignore support plugin (hsz.mobi)
2 | ### Java template
3 | # Compiled class file
4 | *.class
5 |
6 | # BlueJ files
7 | *.ctxt
8 |
9 | # Mobile Tools for Java (J2ME)
10 | .mtj.tmp/
11 |
12 | # Package Files #
13 | *.war
14 | *.ear
15 | *.tar.gz
16 | *.rar
17 |
18 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
19 | hs_err_pid*
20 | ### macOS template
21 | *.DS_Store
22 | .AppleDouble
23 | .LSOverride
24 |
25 | # Icon must end with two \r
26 | Icon
27 |
28 |
29 | # Thumbnails
30 | ._*
31 |
32 | # Files that might appear in the root of a volume
33 | .DocumentRevisions-V100
34 | .fseventsd
35 | .Spotlight-V100
36 | .TemporaryItems
37 | .Trashes
38 | .VolumeIcon.icns
39 | .com.apple.timemachine.donotpresent
40 |
41 | # Directories potentially created on remote AFP share
42 | .AppleDB
43 | .AppleDesktop
44 | Network Trash Folder
45 | Temporary Items
46 | .apdisk
47 | ### Gradle template
48 | .gradle
49 | /build/
50 |
51 | # Ignore Gradle GUI config
52 | gradle-app.setting
53 |
54 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
55 | !gradle-wrapper.jar
56 |
57 | # Cache of project
58 | .gradletasknamecache
59 |
60 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
61 | # gradle/wrapper/gradle-wrapper.properties
62 | ### JetBrains template
63 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
64 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
65 |
66 | # User-specific stuff:
67 | .idea
68 | ## File-based project format:
69 | *.iws
70 |
71 | ## Plugin-specific files:
72 |
73 | # IntelliJ
74 | /out/
75 |
76 | # mpeltonen/sbt-idea plugin
77 | .idea_modules/
78 |
79 | # JIRA plugin
80 | atlassian-ide-plugin.xml
81 |
82 | # Crashlytics plugin (for Android Studio and IntelliJ)
83 | com_crashlytics_export_strings.xml
84 | crashlytics.properties
85 | crashlytics-build.properties
86 | fabric.properties
87 |
88 | # gradle
89 | gradlew*
90 | gradle/
91 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "[]"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright [yyyy] [name of copyright owner]
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # IdeaVim扩展
2 |
3 | [](https://app.fossa.io/projects/git%2Bgithub.com%2Fhadix-lin%2Fideavim_extension?ref=badge_shield)
4 |
5 | 本插件作为[IdeaVim](https://plugins.jetbrains.com/plugin/164)的扩展存在.暂时只有一个功能,就是在退出插入模式时可以切换回系统的英文输入法.
6 |
7 | 支持Windows,MacOS和Linux
8 |
9 | - Windows 需要开启英语美国键盘
10 | - MacOS 需要开启英语美国键盘或ABC键盘
11 | - Linux 需要使用fcitx输入法,通过fcitx-remote切换,或使用ibus输入引擎
12 |
13 | ## 构建/安装方法
14 |
15 | 本项目使用gradle进行管理.
16 |
17 | 执行如下命令进行构建
18 |
19 | ```shell
20 | gradle buildPlugin
21 | ```
22 |
23 | 之后会生成 **build/distributions/IdeaVimExtension-\*.\*.\*.zip**.
24 |
25 | 通过idea的插件配置对话框选择 **install plugin from disk**即可安装该插件
26 |
27 | ## 使用
28 |
29 | 输入法自动切换功能**不会**默认启用.
30 |
31 | 编辑器中normal模式下输入下面的指令来启用自动切换输入法功能:
32 |
33 | * `:set keep-english-in-normal` 开启输入法自动切换功能
34 | * `:set keep-english-in-normal-and-restore-in-insert` 回到insert模式时恢复输入法
35 | * `:set nokeep-english-in-normal-and-restore-in-insert` 保留输入法自动切换功能,但是回到insert模式不恢复输入法
36 | * `:set nokeep-english-in-normal` 关闭输入法自动切换功能
37 |
38 | 也可以通过将`set keep-english-in-normal[-and-restore-in-insert]`加入到`~/.ideavimrc`文件中并重启IDE来启用插件功能
39 |
40 | 在macOS中,normal模式的输入法可以通过变量`keep_input_source_in_normal`来设置,仅支持在`~/.ideavimrc`
41 | 中使用.例如`let keep_input_source_in_normal="com.apple.keylayout.ABC"`
42 |
43 | 注:可以使用 [im-select](https://github.com/daipeihust/im-select) 来获取当前使用的`input source id`。比如:`ABC` 对应 `com.apple.keylayout.ABC`、`ABC Extended` 对应 `com.apple.keylayout.USExtended`。
44 |
45 | ideavim.rc中还可以通过以下几个变量控制插件行为:
46 |
47 | `let keep_input_source_in_insert=[input source id]` 设置insert模式使用到非英文输入法
48 |
49 | `let keep_input_source_in_normal=[input source id]` 设置normal模式使用到输入英文到输入法
50 |
51 | 注意:上面两个变量仅在windows和macOS中有效
52 |
53 | `let context_aware=1` 进入insert模式时根据上下文判断是否恢复输入法,0禁用,1启用
54 |
55 | Linux 下的 fcitx5-rime 可以设置 `let rime_ascii = 1` 在 normal 模式使用 Rime 的 ASCII Mode。
56 |
57 | 版本要求:
58 | - `fcitx5 > 5.0.20`
59 | - `fcitx5-rime > 5.0.8`
60 |
61 | ## 更新历史
62 | * 1.7.4
63 |
64 | 修正[issue] #121中提到的由于安装中文语言包导致无法自动切换输入法的问题
65 |
66 | * 1.7.3
67 |
68 | 兼容IdeaVIM 2.7.0
69 |
70 | * 1.7.0
71 |
72 | 支持 Linux 下的 fcitx5-rime 使用 Rime ASCII 模式切换输入法。
73 | 需要在ideavim.rc中设置`let rime_ascii = 1`
74 |
75 | - fcitx5 和 fcitx5-rime 版本要求:
76 | - `fcitx5 > 5.0.20`
77 | - `fcitx5-rime > 5.0.8`
78 |
79 | * 1.6.12
80 |
81 | 修正由于配置顺序导致无法恢复输入法的问题
82 |
83 | * 1.6.11
84 |
85 | 回退到1.6.8的编辑器焦点处理行为
86 |
87 | * 1.6.10
88 |
89 | 默认激活编辑器焦点事件切换输入法功能
90 |
91 | * 1.6.9
92 |
93 | 合并PR#113,当前编辑器失去焦点时恢复输入法
94 |
95 | * 1.6.8
96 |
97 | 修正问题[#111](https://github.com/hadix-lin/ideavim_extension/issues/111)
98 |
99 | * 1.6.7
100 |
101 | 兼容IdeaVIM 2.0.0,Idea-IC 2022.3.1+
102 |
103 | * 1.6.6
104 |
105 | 兼容IdeaVIM 2.0.0,Idea-IC 2022.3.1+
106 |
107 | * 1.6.6
108 |
109 | 兼容IdeaVIM 2.0.0,Idea-IC 2022.3+
110 | context_aware默认设置为0,对不清楚用法对用户避免产生不稳定的输入发切换行为
111 |
112 | * 1.6.5
113 |
114 | 修正问题[#96](https://github.com/hadix-lin/ideavim_extension/issues/96)
115 | 使用独立线程池执行输入法切换动作,避免IDE卡顿
116 |
117 | * 1.6.4
118 |
119 | 修正问题[#95](https://github.com/hadix-lin/ideavim_extension/issues/95)
120 | 去除对独立线程池的使用,改为使用应用管理器执行输入法切换动作,减少资源消耗
121 |
122 | * 1.6.3 修正非预期情况下切换输入法的问题
123 | * 1.6.2 支持在ideavim.rc中通过以下三个变量控制插件行为:
124 |
125 | `let keep_input_source_in_insert=[input source id]` 设置insert模式使用到非英文输入法
126 |
127 | `let keep_input_source_in_normal=[input source id]` 设置normal模式使用到输入英文到输入法
128 |
129 | 注意:上面两个变量仅在windows和macOS中有效
130 |
131 | `let context_aware=1` 进入insert模式时根据上下文判断是否恢复输入法,0禁用,1启用
132 |
133 | 注意:仅在`set keep-english-in-normal-and-restore-in-insert`时有意义
134 | * 1.6.1 修正[#87](https://github.com/hadix-lin/ideavim_extension/issues/87)
135 | * 1.6.0 返回insert模式时,根据当前输入位置的字符是否为ASCII来决策是否恢复输入法
136 | * 1.5.2 兼容"IdeaVIM 1.10.0"
137 | * 1.5.0 支持Linux下的IBUS输入引擎,解决[#76](https://github.com/hadix-lin/ideavim_extension/issues/76)
138 | * 1.4.12 修正windows中的npe[问题](https://github.com/hadix-lin/ideavim_extension/issues/72)
139 | * 1.4.11 在macOS中,normal模式的输入法可以通过`keep_input_source_in_normal`来设置
140 | * 1.4.10 兼容"IdeaVIM 0.67"
141 | * 1.4.9 支持apple silicon
142 | * 1.4.8 兼容"IdeaVIM 0.61"
143 | * 1.4.7 在MacOS下支持,Unicode16进制输入法
144 | * 1.4.6 支持fcitx5
145 | * 1.4.5 兼容IdeaVim 0.56, Intellij IDEA 2020.1
146 | * 1.4.4
147 | 修正编辑器重新获取焦点时保存的输入法状态不正确的问题[#48](https://github.com/hadix-lin/ideavim_extension/issues/48)
148 | * 1.4.3 修正非预期的输入法回复问题 [#44](https://github.com/hadix-lin/ideavim_extension/issues/44)
149 | * 1.4.2
150 | 1. 根据vim指令执行后编辑器状态来判断是否需要恢复输入法
151 | 2. 修正某些情况下恢复输入法出错的问题
152 | * 1.4.1 修复某些插入命令无法恢复输入法的问题
153 | * 1.4.0 支持IdeaVim 0.54, 从这个版本起兼容性策略与IdeaVim保持一致
154 | * 1.3.9 支持IdeaVim 0.52
155 | * 1.3.8 支持自定义"Exit Insert Mode"动作的IDE快捷键
156 | * 1.3.7 修正在`~/.ideavimrc`中使用`set keep-english-in-normal-and-restore-in-insert`无效的问题
157 | * 1.3.6 默认启用输入法自动切换功能,无须使用`set xxx`命令
158 | * 1.3.5 避免抛出NoSuchFieldException
159 | * 1.3.4 修复某些插入命令无法恢复输入法的问题
160 | * 1.3.3 增加Linux下Fcitx输入法支持,ubuntu 18.04下测试通过,理论上支持所有`fcitx`
161 | * 1.3.2 修正自动切换输入法功能在旧版IDEA失效问题
162 | * 1.3.1 编辑器重新获得焦点时,如果编辑器处于NORMAL/VISUAL模式,保持输入法为英文状态
163 | * 1.3.0 使用kotlin重写插件
164 | * 1.2.3 利用异步操作避免IDE失去响应
165 | * 1.2.2 修正导致IDE崩溃的bug
166 | * 1.2.1 修正导致不能恢复到英文输入法的问题
167 | * 1.2 增加对Windows的支持, support Windows.
168 | * 1.1.5 增加对macOS的ABC键盘支持. support keylayout ABC.
169 | * 1.1.3 解决一个偶尔出现的空值异常问题. resolve a NPE problem which happen rarely;
170 | * 1.1.2 增加英文说明.append information in English.
171 | * 1.1.1 更改自动注册的按键映射为`:nnoremap :set keep-english-in-normal
to enable the auto-switch
193 | feature.
194 |
195 | Use`:set keep-english-in-normal-and-restore-in-insert` instead, if you want to restore original input method after
196 | return insert mode.
197 |
198 | Or add the command to the file `~/.ideavimrc`.
199 |
200 | Use `:set nokeep-english-in-normal[-and-restore-in-insert]` to disable the auto-switch feature.
201 |
202 | ### Notice:
203 |
204 | The plugin supports **macOS** and **Windows**, support **Linux** via fcitx
205 |
206 | ### Thanks:
207 |
208 | [trydofor](https://github.com/trydofor) contributed code to support fcitx under linux
209 | [yangxuanx](https://github.com/yangxuanx) helps to test in linux environment
210 | [yuzhou721](https://github.com/yuzhou721) contributed code to support ibus under linux
211 |
212 | ## License
213 |
214 | [](https://app.fossa.io/projects/git%2Bgithub.com%2Fhadix-lin%2Fideavim_extension?ref=badge_large)
215 |
--------------------------------------------------------------------------------
/build.gradle.kts:
--------------------------------------------------------------------------------
1 | import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
2 |
3 | plugins {
4 | kotlin("jvm") version "1.8.10"
5 | id("org.jetbrains.intellij") version "1.17.2"
6 | }
7 |
8 | intellij {
9 | pluginName.set("IdeaVimExtension")
10 | version.set("2023.1.2")
11 | plugins.add("IdeaVIM:2.7.0")
12 | updateSinceUntilBuild.set(false)
13 | downloadSources.set(true)
14 | }
15 |
16 | tasks.withType
auto-switch feature is disabled by default
15 |16 | enable the feature with the commands below, input in normal mode: 17 |
:set keep-english-in-normal
enable auto-switch feature:set keep-english-in-normal-and-restore-in-insert
restore input method when return insert mode.:set nokeep-english-in-normal-and-restore-in-insert
keep auto-switch feature, but doesn't restore input method when return insert mode:set nokeep-english-in-normal
disable auto-switch featureThe plugin support MacOS and Windows and Linux(with fcitx)
29 |
30 | MacOS need enable en_US OR ABC keyboard
31 | Windows need enable en_US keyboard
32 | Linux need fcitx-remote, or ibus
33 |
35 | Support for controlling plugin behavior in ideavim.rc via the following three variables:
36 | let keep_input_source_in_insert=[input source id]
set input method for non-English used in insert mode
37 | let keep_input_source_in_normal=[input source id]
set input method for English used in normal mode
38 | Note: The above two variables are only valid in windows and macOS
39 | let context_aware=1
When entering insert mode, judge whether to restore the input method according to the context, 0 to disable, 1 to enable
40 | Note: Only meaningful when set keep-english-in-normal-and-restore-in-insert
41 |
GitHub RepositorySource and Feedback
43 |为IdeaVim插件增加自动切换为英文输入法的功能
输入法自动切换功能不会默认启用
46 |47 | 编辑器中normal模式下输入输入下面的指令以启用自动切换输入法功能: 48 |
:set keep-english-in-normal
开启输入法自动切换功能:set keep-english-in-normal-and-restore-in-insert
回到insert模式时恢复输入法:set nokeep-english-in-normal-and-restore-in-insert
保留输入法自动切换功能,但是回到insert模式不恢复输入法:set nokeep-english-in-normal
关闭输入法自动切换功能
58 | MacOS需要开启英语美国键盘或ABC键盘
59 | Windows需要开启英语美国键盘
60 | Linux需要使用fcitx输入法,通过fcitx-remote切换,或使用ibus输入引擎
61 |
63 | 支持在ideavim.rc中通过以下三个变量控制插件行为:
64 | let keep_input_source_in_insert=[input source id]
设置insert模式使用的非英文输入法
65 | let keep_input_source_in_normal=[input source id]
设置normal模式使用的输入英文到输入法
66 | 注意:上面两个变量仅在windows和macOS中有效
67 | let context_aware=1
进入insert模式时根据上下文判断是否恢复输入法,0禁用,1启用
68 | 注意:仅在set keep-english-in-normal-and-restore-in-insert
时有意义
69 |
71 |
72 | Linux 下的 fcitx5-rime 可以设置 `let rime_ascii = 1` 在 normal 模式使用 Rime 的 ASCII Mode。 73 | 版本要求: 74 | - `fcitx5 > 5.0.20` 75 | - `fcitx5-rime > 5.0.8` 76 |77 | 78 |
GitHub Repository: 源码和问题反馈
79 | ]]> 80 | 81 |1.7.3
85 | Compatible with "IdeaVIM 2.7.0"
86 |
1.7.0
87 |
88 | support using "Rime ASCII" mode to switch input method 89 | 90 | require set `let rime_ascii = 1` in ideavim.rc. 91 | - fcitx5 and fcitx5-rime version must follow: 92 | - `fcitx5 > 5.0.20` 93 | - `fcitx5-rime > 5.0.8` 94 |95 |
1.6.12
96 | Fix the problem of being unable to restore the input method due to configuration order
97 |
1.6.11
98 | Fallback to editor focus handling behavior of 1.6.8
99 |
1.6.10
100 | default open focus auto
101 |
1.6.9
102 | merged PR#113, restore the input method when the current editor loses focus
103 |
1.6.8
104 | fix #111
105 |
1.6.7
106 | Compatible with IdeaVIM 2.0.0, Idea-IC 2022.3.1+
107 |
1.6.6
108 | Compatible with IdeaVIM 2.0.0, Idea-IC 2022.3+
109 | context_aware
is set to 0 by default, avoiding unstable input method switching behaviors for users who are unclear about usage
110 |
1.6.5
111 | Fix #96
112 | Use an independent thread pool to perform input method switching to avoid IDE lag
113 |
1.6.4
114 | Fix #95
115 | Eliminate the use of independent thread pools, use ApplicationManager to perform input method switching action, and reduce resource consumption
116 |
1.6.3
117 | Fix the problem of switching input methods in unexpected situations
118 |
1.6.2
119 | Support for controlling plugin behavior in ideavim.rc via the following three variables:
120 | let keep_input_source_in_insert=[input source id]
set input method for non-English used in insert mode
121 | let keep_input_source_in_normal=[input source id]
set input method for English used in normal mode
122 | Note: The above two variables are only valid in windows and macOS
123 | let context_aware=1
When entering insert mode, judge whether to restore the input method according to the context, 0 to disable, 1 to enable
124 | Note: Only meaningful when set keep-english-in-normal-and-restore-in-insert
125 |
1.6.1
126 | Fix Issue #87
127 |
1.6.0
128 | When returning to insert mode, decide whether to restore the input method according to whether the character at the current input position is ASCII or not
129 |
1.5.2
131 | Compatible with "IdeaVIM 1.10.0"
132 |
1.5.0
134 | Support IBUS input engine under Linux, fix #76
135 |
1.4.12
137 | Fix npe Issue #72 in windows
138 |
1.4.11
140 | In macOS, the input method in normal mode can be set by keep_input_source_in_normal,but it is only supported in ~/.ideavimrc`
.
141 | For example, let keep_input_source_in_normal="com .apple.keylayout.ABC"
142 |
1.4.10
144 | Compatible with "IdeaVIM 0.67"
145 |
1.4.9
147 | support apple silicon
148 |
1.4.8
150 | Compatible with "IdeaVIM 0.61"
151 |
1.4.7
153 | Support Unicode Hex Input Method in MacOS.
154 |
1.4.6
156 | Support fcitx5.
157 |
1.4.5
159 | Compatible with "IdeaVIM 0.56" and "Intellij IDEA 2020.1"
160 |
1.4.4
162 | Fix the [issue] #48 caused by incorrect input method state saved when the editor regains focus
163 |
1.4.3
165 | Fixed the unexpected input method restoration issue
166 |
1.4.2
168 | 1.Determine whether to restore the input method based on the state of the editor after the vim instruction is executed
169 | 2.Fix the problem of recovering input method in some cases
170 |
1.4.1
172 | fix the problem that some insert commands cannot restore input method
173 |
1.4.0
175 | support IdeaVim 0.54, keep consistent compatibility strategy with IdeaVim starting with this version.
176 |
1.7.4
180 | 修正[issue] #121中提到的由于安装中文语言包导致无法自动切换输入法的问题
181 |
1.7.3
182 | 兼容"IdeaVIM 2.7.0"
183 |
1.7.0
184 |
185 | 支持 Linux 下的 fcitx5-rime 使用 Rime ASCII 模式切换输入法。 186 | 需要在ideavim.rc中设置`let rime_ascii = 1` 187 | - fcitx5 和 fcitx5-rime 版本要求: 188 | - `fcitx5 > 5.0.20` 189 | - `fcitx5-rime > 5.0.8` 190 |191 |
1.6.12
192 | 修正由于配置顺序导致无法恢复输入法的问题
193 |
1.6.11
194 | 回退到1.6.8的编辑器焦点处理行为
195 |
1.6.10
196 | 默认激活编辑器焦点事件切换输入法功能
197 |
1.6.9
198 | 合并PR#113,当前编辑器失去焦点时恢复输入法
199 |
1.6.8
200 | 修正问题 #111
201 |
1.6.7
202 | 兼容IdeaVIM 2.0.0,Idea-IC 2022.3.1+
203 |
1.6.6
204 | 兼容IdeaVIM 2.0.0,Idea-IC 2022.3+
205 | context_aware默认设置为0,对不清楚用法对用户避免产生不稳定的输入发切换行为
206 |
1.6.5
207 | 修正问题#96
208 | 使用独立线程池执行输入法切换动作,避免IDE卡顿
209 |
1.6.4
210 | 修正问题#95
211 | 去除对独立线程池的使用,改为使用应用管理器执行输入法切换动作,减少资源消耗
212 |
1.6.3
213 | 修正非预期情况下切换输入法的问题
214 |
1.6.2
215 | 支持在ideavim.rc中通过以下三个变量控制插件行为:
216 | let keep_input_source_in_insert=[input source id]
设置insert模式使用到非英文输入法
217 | let keep_input_source_in_normal=[input source id]
设置normal模式使用到输入英文到输入法
218 | 注意:上面两个变量仅在windows和macOS中有效
219 | let context_aware=1
进入insert模式时根据上下文判断是否恢复输入法,0禁用,1启用
220 | 注意:仅在set keep-english-in-normal-and-restore-in-insert
时有意义
221 |
1.6.1
222 | 修正#87
223 |
1.6.0
224 | 返回insert模式时,根据当前输入位置的字符是否为ASCII来决策是否恢复输入法
225 |
1.5.2
227 | 兼容"IdeaVIM 1.10.0"
228 |
1.5.0
230 | 支持Linux下的IBUS输入引擎,解决#76
231 |
1.4.12
233 | 修正windows中的npe问题#72
234 |
1.4.11
236 | 在macOS中,normal模式的输入法可以通过keep_input_source_in_normal来设置,但仅支持在~/.ideavimrc`
中使用.
237 | 例如let keep_input_source_in_normal="com.apple.keylayout.ABC"
238 |
1.4.10
240 | 兼容"IdeaVIM 0.67"
241 |
1.4.9
243 | 支持apple silicon
244 |
1.4.8
246 | 兼容"IdeaVIM 0.61"
247 |
1.4.7
249 | 在MacOS下支持,Unicode16进制输入法
250 |
1.4.6
252 | 支持fcitx5
253 |
1.4.5
255 | 兼容"IdeaVim 0.56"和"Intellij IDEA 2020.1"
256 |
1.4.4
258 | 修正编辑器重新获取焦点时保存的输入法状态不正确的问题
259 |
1.4.3
261 | 修正非预期的输入法恢复问题
262 |
1.4.2
264 | 1.根据vim指令执行后编辑器状态来判断是否需要恢复输入法
265 | 2.修正某些情况下恢复输入法出错的问题
266 |
1.4.1
268 | 修复某些插入命令无法恢复输入法的问题
269 |
1.4.0
271 | 支持IdeaVim 0.54, 从这个版本开始兼容性策略与IdeaVim保持一致
272 |