Home

Awesome

vim-translate Build Status

🌎 A tiny translate-shell wrapper for Vim.

<p align="center"> <img width="600" src="https://user-images.githubusercontent.com/7091110/39960996-7012d8fa-562d-11e8-9216-b604d43ad284.gif"></img> </p>

Installation

Use your favorite plugin manager. Example with vim-plug:

Plug 'VincentCordobes/vim-translate'

Make sure you've installed translate-shell

Usage

Translate the whole buffer and put it in a scratch buffer

Translate a visual selection and put it in a scratch buffer

Translate and replace a visual selection

Quit the translation buffer

See here to know more about options

For convenience, you can create custom key mappings:

nnoremap <silent> <leader>tt :Translate<CR>
vnoremap <silent> <leader>tt :TranslateVisual<CR>
vnoremap <silent> <leader>tr :TranslateReplace<CR>

Using motions:

nmap <leader>ts <Plug>Translate
nmap <leader>tr <Plug>TranslateReplace

Configuration

g:translate#default_languages

A dictionary of defaults source → target

let g:translate#default_languages = {
      \ 'fr': 'en',
      \ 'en': 'fr'
      \ }

License

MIT