FollieHiyuki-dotfiles/home/.config/nvim/plug-config/translator.vim
2021-02-13 19:28:59 +03:00

23 lines
913 B
VimL

let g:translator_target_lang = 'ja'
let g:translator_source_lang = 'auto'
let g:translator_default_engines = ['trans']
let g:translator_history_enable = v:false
" Echo translation in the cmdline
nmap <silent> <Leader>Tt <Plug>Translate
vmap <silent> <Leader>Tt <Plug>TranslateV
" Display translation in a window
nmap <silent> <Leader>Tw <Plug>TranslateW
vmap <silent> <Leader>Tw <Plug>TranslateWV
" Replace the text with translation
nmap <silent> <Leader>Tr <Plug>TranslateR
vmap <silent> <Leader>Tr <Plug>TranslateRV
" Translate the text in clipboard
nmap <silent> <Leader>Tx <Plug>TranslateX
" Scrolling the popup window
nnoremap <silent><expr> <M-f> translator#window#float#has_scroll() ?
\ translator#window#float#scroll(1) : "\<M-f>"
nnoremap <silent><expr> <M-b> translator#window#float#has_scroll() ?
\ translator#window#float#scroll(0) : "\<M-f>"