vim-translator


Ⅰ. 插件描述

vim plugin for fast translate and pronounce using https://github.com/soimort/google-translate-cli

Ⅱ. 基本信息

创建日期:  2014-08-12
使用用户:  2
Github星:  9
插件作者:  zc he

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'blindfs/vim-translator-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'blindfs/vim-translator-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'blindfs/vim-translator-is-written-on'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/blindfs/vim-translator

Ⅳ. 文档说明

## Dependencies

  • A translation tool. I suggest translate-shell.
  • A player for pronunciation. Defaults to mplayer

Install

If you don't have a preferred method,
I encourage you to use neobundle.vim.

NeoBundleLazy 'farseer90718/vim-translator', {
            \ 'mappings' : '<Plug>Translate'
            \ }

Usage

Create you own mappings like this in your vimrc

vmap T <Plug>Translate
vmap R <Plug>TranslateReplace
vmap P <Plug>TranslateSpeak
  • Assign g:translate_cmd to your preferred command for example ydcv,
  1. first target language specified is used in "translate and replace".
  • Assign g:translate_player to your preferred cli stream player.

Demo

gif

License

MIT

添加新评论