Ⅰ. 插件描述
Bind pressing russian key in normal mode to toggle layout and repeat same key.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'evindor/vim-rusmode'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'evindor/vim-rusmode'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'evindor/vim-rusmode'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone 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=1Install
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