coc-translator
Translation extension for coc.nvim.
Install
:CocInstall coc-translator
Features
- Multiple translator engines
- Translation history(CocList)
- Proxy support(see coc.nvim doc)
Configuration
Properties
translator.toLang
: Target language type, input it if it's not fould in the candidates.
Type: (('zh_CN' | 'zh_TW' | 'en' | 'fr' | 'de' | 'ja' | 'ko' | 'ru') | string) & string
Default: "zh_CN"
translator.engines
: .
Type: string[]
Default: [
"bing",
"google",
"youdao",
"haici"
]
translator.proxy
: Address of proxy, i.e., `socks://127.0.0.1:1081`.
Type: string
translator.enableHover
: Translate when mouse hover.
Type: boolean
Default: false
translator.window.enableBorder
: .
Type: boolean
Default: true
translator.window.maxWidth
: .
Type: number
Default: 80
translator.window.maxHeight
: .
Type: number
Default: 20
Keymaps
Example
" NOTE: do NOT use `nore` mappings
" popup
nmap <Leader>t <Plug>(coc-translator-p)
vmap <Leader>t <Plug>(coc-translator-pv)
" echo
nmap <Leader>e <Plug>(coc-translator-e)
vmap <Leader>e <Plug>(coc-translator-ev)
" replace
nmap <Leader>r <Plug>(coc-translator-r)
vmap <Leader>r <Plug>(coc-translator-rv)
Commands
! Commands were not supported yet
Work with translation lists
run :CocList translation
to open the translation list.
- Filter your translation items and perform operations via
<Tab>
- Use operation
delete
to delete the translation item under the cursor - Use operation
yank
to yank ... - Use operation
jumpto
to jump to the location where you've performed translating - Use operation
append
to append the word to the end of cursor position - Use operation
pretend
to pretend ...
License
MIT