/translate.vim

translate language plugin

Primary LanguageVim scriptMIT LicenseMIT

translate.vim

This plugin is not maintained, please use denops-translate.vim

This is translate language plugin.

Features

  • translate

Requirement

  • curl
  • vim 8.1.1513 or above/Neovim

Installtion

You can use the plugin manager or Vim8 package manager. eg: dein.vim

[[plugins]]
repo = 'skanehira/translate.vim'

Usage

The default is to translate English into Japanese.

The language code is bellow. https://cloud.google.com/translate/docs/languages

Translate current line

:Translate

Translate specified words

" result: こんにちは私の名前はゴリラです
:Translate hello my name is gorilla

Reverse between resource and target to translate when using "!"

" result: It's a gorilla
:Translate! ゴリラです

Translate selected lines

:'<,'>Translate

You can use below options

let g:translate_source = "en"
let g:translate_target = "ja"
let g:translate_popup_window = 0 " if you want use popup window, set value 1
let g:translate_winsize = 10 " set buffer window height size if you doesn't use popup window

You can also set key mappings.

nmap gr <Plug>(Translate)
vmap t <Plug>(VTranslate)

If you using popup window and you want yank translate result, you can use y to do it.