Friday, January 17, 2014

How to map the Kana key on Japanese keyboards

Japanese keyboards have a Kana key that allows me to easily switch between Japanese and English input.

Is very common for me during insert mode to press the Kana key to input some Japanese text after which I press esc to go back to normal mode.


The problem is that after entering normal mode the input method is still in Japanese and it is totally useless in vim normal mode. It is impossible to input any command with the Japanese input and since I get no feedback it takes some seconds before I realize why everything I type seems to do nothing in vim.

I would like to make a mapping so when I exit insert mode (or enter normal mode) the input method is always reset back to English. Unfortunately I am unable to find how to map this key.

Bonus points if I can make remember the last input method used in insert mode and restore it when entering insert mode again.

Other, possibly better solution, is to find out how to change the input method via command line and make a autocmd that executes the command when entering normal mode. Unfortunately I still cannot find a way to manipulate the input method from the command line. BTW: I use Linux (Kubuntu) with ibus as input method manager.


thanks,

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment