I already use an IME (fcitx-mozc) to input Japanese text, but that feels really limited and special-case to me. It'd be neat to be able to switch to e.g. Fraktur "font" by using https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols , or any other variation, by writing a simple call to convert the text in Bash, Python or whatever else. Since an IME already commonly shows you a separate text input field where you can prepare the text that is eventually inserted into the original context, I thought of using that same mechanism to implement a REPL — provide temporary text to an interpreter, get the evaluated result back, and insert that into the main text field. Perhaps the system could allow for further editing of the result first; or with a language like Python that has typed results, the handling could be type-dependent (e.g. if the code evaluates to a list, the UI could show a window with the results and allow for selecting one, just like how Japanese IMEs let you choose the kanji you want after inputting ambiguous romaji).
Does anything like that exist for Linux already? It seems like something that would take quite a bit of effort (mainly research) to create from scratch.
kej•1h ago
If you like vim, you could just use one of those methods to do everything you described. If not, you could probably use one of those as a starting point and just change the part that calls vim to call some other text-generating program or custom repl instead.