Show HN: Using Vim as an input method editor (IME) for X11 apps (github.com)
As a Vim user, I often use Vim to write some text and then copy & paste it into another text field of GUI apps (e.g. browsers, chat apps, etc.),
because almost all of these text fields provide only very basic editing functions.
A while ago, I came up with an idea: what if we could use Vim as an IME?
Ordinary IMEs are used to input some non-English characters, but the essential functions of IME are 1) receiving a keyboard sequence 2) process the key sequence and outputting a text
These functions are the same as text editor's. So I thought implementing an IME that can be used with Vim keybindings could be a good solution for the above problem.
After that I learned mechanisms of IME for Linux desktop and tried to develop an experimental IME.
27 comments
[ 4.2 ms ] story [ 67.5 ms ] thread[1]: https://github.com/tecosaur/emacs-everywhere
I don't daily-drive it though, mostly because I never found time to update rather limited set of keybindings, a task that seems way more involving than a couple of little fixes that were needed to support GTK3.
Q: Why not publish it to crates.io (cargo publish)?
Curious: Did you consider neovim over vim and if so what made you stick with vim? AAUI neovim has these kinds of "embedded" use-cases in mind and intends to be smoother than vanilla vim.
FYI, since this IME embeds a terminal emulator it should be able to use with other terminal-based editors (including Neovim) by applying almost no changes to the editor's codebase.
https://github.com/glacambre/firenvim
Thanks for sharing!
[0] https://github.com/akahuku/wasavi
Back in the '90s I had made an X Input Method that used vim -- essentially forked a gvim process on a temporary file and read the file upon termination. It was a nice learning experience, but not very useful.
Besides textareas in browsers (the main use, where a number of other solutions currently exist), a fun demo was to use vi for changing formulas in a spreadsheet (I assume it must have been StarOffice back then).