Ⅰ. 插件描述
Transliteration mode (russian, greek, etc) plugin for vimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'einars/translit'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'einars/translit'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'einars/translit'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/einars/translit.vim
Ⅳ. 文档说明
translit.vim
Author: Einar Lielmanis <einars@gmail.com>
Home: http://github.com/einars/translit.vim
About
This plugin allows you to write texts in transliterated russian (or any
other language you'll write a definition for). That means, you write
"Cheburashka" and it gets automagically converted to "Чебурашка", or
write "Ellada" and it converts to "Ελλαδα"
This plugin is loosely based on russian_plansliterated.vim plugin by
Krzystof Goj (http://www.vim.org/scripts/script.php?script_id=2401) and was
used as my playground for learning vimscript.
Configuration
g:translit_cursor_bg <color>
Cursor color for gvim when in the transliteration mode. Default = red.
g:translit_map "translit.ru"
Sets the initial keyboard mapping scheme. Currently "translit.ru",
"PLanslit" and "greek" are supported.
g:translit_toggle_keymap "<C-T>"
Default keybinding to toggle translit mode, Ctrl-Shift-t.
Set up multiple transliteration maps in .vimrc, for example:
inoremap <C-G> <C-r>=Translit('greek')<cr>
nnoremap <C-G> :exec Translit('greek')<cr>
Basic Usage
Drop plugin under ~/.vim/plugins and switch translit mode on/off with
Ctrl-Shift-t.
Custom Translit Maps
use TranslitAddMap(name, table) to set up your own translit mode. The
mapping is in format "key1:result1, key2:result2", whitespace is stripped.