Skip to content

kqito/coc-deepl

Repository files navigation

coc-deepl

deepl extension for coc.nvim

Npm version License

demo

Installation

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/

Usage

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)

Configuration

deepl.enable

Description

Whether enable coc-deepl extension or not.

Type

boolean

Default value

true

deepl.plan

Description

Plans for using deepl API

Type

'free' | 'pro'

Default value

free

deepl.isShowSource

Description

Boolean indicate to show translate source in translation result

Type

boolean

Default value

false

deepl.targetLanguage

Description

Language after translation. detail

Type

"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"

Default value

EN

License

MIT © kqito