vim-rusmode
vim-rusmode copied to clipboard
Add support for keyboard layout variants
I'm not a native russian, so I use a phonetic layout.
I tried configuring your plugin like this:
call vam#ActivateAddons([ 'vim-rusmode'], {'auto_install' : 0})
let g:rusmode_autotoggle_insertleave=0 'Setting it to 1, didn't seem to make a difference
let g:rusmode_get_layout_command = 'setxkbmap -print | grep xkb_symbols | awk "{split($0,arr,\"+\")} END{print arr[2]}"'
let g:rusmode_set_layout_command = 'setxkbmap -option "grp:caps_toggle" -layout "us,ru" -variant ",ownvariant"'
let g:rusmode_normal_layout='us'
However, when I press a key in Russian when using my own variant, it takes the position where that key would be in the "JCUKEN" layout and then inserts the key that would be at that location if I were using the US layout. Fixing this won't be easy, because right now you are directly mapping keys from JCUKEN to QWERTY.
Yeah, I don't think there are any other ways than mapping keys directly. Or mapping them in a loop over layout keys array, essentially the same thing but with less typing.
Shouldn't be that hard to add another layout though, just boring :)