gtrans


Ⅰ. 插件描述

VIm 的谷歌翻译插件(A google translater for vim)

Ⅱ. 基本信息

创建日期:  2014-08-20
使用用户:  1
Github星:  3
插件作者:  xcodebuild

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'codefalling/gtrans'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

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

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'codefalling/gtrans'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'codefalling/gtrans'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

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

Ⅳ. 文档说明

# gtrans

Introduction 介绍

gtrans is a vim plugin which allow you to translate words or sentences by using Google Translate.

gtrans 是一个基于 Google Translate 的 vim 插件,可以翻译词语和句子。

Requirements 要求

  • vim compiled with python (+python option)

    包含 python 支持的 vim
    

Install 安装

Plugin 'CodeFalling/gtrans'

Variables 变量

let g:gtrans_input_language = 'en'      # 要翻译的语言,默认为英文
let g:gtrans_output_language = 'zh-CN'  # 翻译为,默认为简体中文

Usage 使用

Add below to your .vimrc to bind key

将下面的代码加入你的 .vimrc 以绑定按键

nmap <C-t> :Gtrans<CR>
imap <C-t> <ESC>:Gtrans<CR>i
vmap <C-t> :call Gtrans()<CR>

Features 特性

  • Show result with new window.

用一个弹出窗口显示翻译结果

  • Auto exit Vim when only translate window

当只剩下翻译窗口时自动退出 Vim

ScreenShot 截屏

word

sentence

添加新评论