deepl extension for coc.nvim
First, install coc-deepl.
:CocInstall coc-deepl
Then set an environment variable named COC_DEEPL_API_KEY
with the API key of deepl.
export COC_DEEPL_API_KEY=your-deepl-api-key
If you don't have a Deepl API key, you can create one for free.
https://www.deepl.com/docs-api/introduction/
Add the following configuration to your .vimrc
" Displays the result of translating the word under the cursor with deepl
nmap <silent> <space>t <Plug>(coc-deepl)
" Displays the result of translating the string that is selected the cursor with deepl
vmap <silent> <space>t <Plug>(coc-deepl-selected)
deepl.isShowSource
Boolean indicate to show translate source in translation result
boolean
false
deepl.targetLanguage
Language after translation. detail
"BG" | "CS" | "DA" | "DE" | "EL" | "EN-GB" | "EN-US" | "EN" | "ES" | "ET" | "FI" | "FR" | "HU" | "IT" | "JA" | "LT" | "LV" | "NL" | "PL" | "PT-PT" | "PT-BR" | "PT" | "RO" | "RU" | "SK" | "SL" | "SV" | "ZH"
EN