trans.nvim is a plugin for Neovim to translate text with Google Translator.
You must first set up authentication by creating a API Key or service account of GCP.
Then you need to install the Go of version 1.11 or more.
The API Key documentation can be found here.
Please set the environment variable TRANS_API_KEY
to the API Key.
The service account documentation can be found here.
Please set the environment variable GOOGLE_APPLICATION_CREDENTIALS
to the file path of the JSON file that contains your service account key.
You need a little bit of money to use google translate API.
e.g. it costs $0.06 for 2889 characters.
For vim-plug
Plug 'utahta/trans.nvim', {'do': 'make'}
let g:trans_lang_locale = 'ja'
let g:trans_lang_output = 'preview'
Floating windows are supported in neovim >= 0.4.0.
let g:trans_lang_output = 'float'
A Floating window is automatically hide when cursor is moved.