惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

美团技术团队
人人都是产品经理
人人都是产品经理
月光博客
月光博客
V
V2EX
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
宝玉的分享
宝玉的分享
雷峰网
雷峰网
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
博客园 - Franky
博客园 - 聂微东
博客园 - 司徒正美
博客园 - 【当耐特】
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志

林中阴影

林中阴影 | 关于蓝光刻录的一些调查 林中阴影 | 与IPv6地址战斗 林中阴影 | 半年前的NAS升级 林中阴影 | “智能” 家居笔记:一→两年后的回顾 林中阴影 | 旧手机做RDP客户端的一些尝试 林中阴影 | 一些矿渣的耗电量 林中阴影 | 穷人的IP-KVM远程访问 林中阴影 | 内网访问第三季:在运营商的CGNAT网络下 林中阴影 | “智能”家居笔记,其之二 林中阴影 | “智能”家居笔记,其之一 林中阴影 | 仅IPv6家庭内网服务实现v6+v4双栈访问 林中阴影 | 下载装小蜜监理拍摄的图片 林中阴影 | 几物互联 林中阴影 | 整了个“新”平板 林中阴影 | 获取招商信用卡账单的另一种方法 林中阴影 | 我在GitHub的⭐ 林中阴影 | Python与光学计算,2021 林中阴影 | 你可能并不需要内网穿透 林中阴影 | 2020 林中阴影 | 和(基本上)什么也不能连的电脑传递信息 林中阴影 | 我将贻笑于大方之家 林中阴影 | 一个新主题 林中阴影 | 2019过去了,我…… 林中阴影 | Beancount试用,半年后 林中阴影 | 自动输入剪贴板中的内容 林中阴影 | Unicode与数学公式 林中阴影 | Python中光学计算相关的库/Awesome Python for Optics 林中阴影 | 一本厕纸小说 林中阴影 | 震惊!为了在Windows上访问EXT4分区,他竟然做出了这样的事! 林中阴影 | 我的2018
Auto-Switch IME in Vim-Mode-Plus for Atom Editor
2017-09-05 · via 林中阴影

Update 2018-5: Now vim-mode-plus introduced new method to disable IME in the setting page. It's time for this post to retire.


As a vim-user and Chinese-speaker, I prefer vim-mode-plus for Atom editor, but always disrupted by the IME in normal mode, like this:

IME-in-atom

If we could disable IMEs in normal mode then everything will be fine again. However, due to the lack of the APIs, it is hardly possible to solve the problem in the editor.

Thus, we could solve it out of the box. There is a package named atom-vim-mode-plus-auto-ime, which could run a custom command when the mode changes. The goal now is to find some commands to control the IME:

  • macOS users can use input-source-switcher to toogle the IME.
  • For Linux, the IME fcitx has a command fcitx-remote to control itself.
  • And for Windows, I wrote a python script to switch the IME of the foreground window.

Then we could configure this package.

#windows:
python E:\\path\\to\\ime_helper.py --current #Get Current Input Source
python E:\\path\\to\\ime_helper.py --dec ${source} #insert
python E:\\path\\to\\ime_helper.py --locale en_US #normal
python E:\\path\\to\\ime_helper.py --locale en_US #visual
#linux:
/usr/bin/fcitx-remote #Get Current Input Source
if (( "${source}" <= "1" ));then /usr/bin/fcitx-remote -c; else /usr/bin/fcitx-remote -o ;fi #insert
/usr/bin/fcitx-remote -c #normal
/usr/bin/fcitx-remote -c #visual
#macOS: just use the default config

configure