/dps-translate-vim

Translation plugin for Vim / Neovim by denops.vim

Primary LanguageTypeScriptMIT LicenseMIT

dps-translate-vim

The translate plugin for Vim/Neovim using denops.vim.

Respect for skanehira/translate.vim.

Install

This plugin is depends on denops.vim.

  • vim-plug
    Plug 'vim-denops/denops.vim'
    Plug 'Omochice/dps-translate-vim'
  • dein.vim
    call dein#add("vim-denops/denops.vim")
    call dein#add("Omochice/dps-translate-vim")

Usage

  • Set g:dps_translate_source and g:dps_translate_target

    let g:dps_translate_source = "en"
    let g:dps_translate_target = "ja"
  • Run :Translate on Normal mode, The result of translation is shown.

on_normal_mode

  • Run :Translate! can translate reverse.

on_normal_mode_reverse

  • Can give a sentence as an argument also.

    :Translate <sentence>
  • In visual mode, can select row and translate it.

on_visual_mode

  • If you want to translate multiple sentences as one sentence, Use TranslateJoin.

Join

VARIABLES

  • g:dps_translate_source The string of translation source language. Default: 'en'

  • g:dps_translate_target The string of translation source language. Default: 'ja'

  • g:dps_translate_engine Use engine. Default: 'google'

  • g:dps_translate_deepl_token Token for using deepl. Default: None

  • g:dps_translate_deepl_is_pro Either pro plan or free plan. Default: v:false

  • g:dps_translate_border Dict for border like:

    let g:dps_translate_border = {
        \ 'topLeft': '',
        \ 'top':  '',
        \ 'topRight': '',
        \ 'left': '',
        \ 'right': '',
        \ 'bottomLeft': '',
        \ 'bottom':  '',
        \ 'bottomRight': '',
        \ }

    Default: 'none' (no border)

LICENSE

MIT