4tlzia
Last Updated: February 25, 2016
·
975
· subosito

Automatic text translation with Vim

Use my fork of vim-translator. Install the plugin using Vundle or Pathogen or by copying into plugins folder on your .vim.

If you are using vundle, put these line on your .vimrc:

Bundle 'subosito/vim-translator'

Run :BundleInstall to install the plugins.

Add another line to .vimrc to configure translation plugin:

let g:goog_user_conf = { 'langpair': 'en|it', 'v_key': 'T', 'charset': 'utf-8' }

You can edit configuration to fit your needs. Above configuration is translate en (english) into it (italian), using key T on visual mode, and perform charset conversion to utf-8.

Now you can just select text using visual mode and then press T and selected text will be automatically translated into your desired language.