sponsor Vim development Vim logo Vim Book Ad

vim-rusmode : Bind pressing russian key in normal mode to toggle layout and repeat same key.

 script karma  Rating 44/13, Downloaded by 2005  Comments, bugs, improvements  Vim wiki

created by
Arseny Zarechnev
 
script type
utility
 
description
https://github.com/evindor/vim-rusmode
Rusmode.vim

No Windows support for now.

When you press russian key in normal mode this script will change your system layout and repeat same key press in appropriate language.

Settings:

Set layout to switch to. Defaults to 'U.S.'.
let g:rusmode_normal_layout='U.S.'
You can find out the name of layout by switching on it and running changeInput binary in plugin directory.

Automatically toggle to normal layout on leaving the insert mode. Defaults to 0.
let g:rusmode_autotoggle_insertleave=1
 
install details
Install with Vundle or Pathogen.

Linux users need to provide correct commands to get and set current layout:

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:ctrl_shift_toggle,grp_led:scroll" -layout "us,ru"'
let g:rusmode_normal_layout='us'

The following was tested under Ubuntu 12.10
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
vim-rusmode.zip 0.3.1 2013-04-03 7.0 Arseny Zarechnev Handle dot and slash in all layouts;
vim-rusmode.zip 0.3 2013-04-02 7.0 Arseny Zarechnev Linux support;
Sample commands;
vim-rusmode.zip 0.2 2013-03-31 7.0 Arseny Zarechnev Fixed counts and sequences;
Added user setting for default layout;
Added user setting for layout switching automatically on leaving insert mode.
vim-rusmode.zip 0.1 2013-03-29 7.0 Arseny Zarechnev Initial upload
ip used for rating: 3.144.48.135

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github