Add deepl mappings to git after moving api key to pass storage
This commit is contained in:
parent
00ec5eca12
commit
a8e4f7a113
10
after/plugin/deepl.vim
Normal file
10
after/plugin/deepl.vim
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
let g:deepl#endpoint = "https://api-free.deepl.com/v2/translate"
|
||||||
|
function TranslateSelection(lang)
|
||||||
|
if !exists('g:deepl#auth_key')
|
||||||
|
let g:deepl#auth_key = pass#get('web/deepl.com', 'apikey')
|
||||||
|
endif
|
||||||
|
call deepl#v(a:lang)
|
||||||
|
endfun
|
||||||
|
|
||||||
|
vmap <leader><C-e> <Cmd>call TranslateSelection("EN")<CR>
|
||||||
|
vmap <leader><C-d> <Cmd>call TranslateSelection("DE")<CR>
|
|
@ -10,6 +10,7 @@ Plug 'fladson/vim-kitty'
|
||||||
|
|
||||||
" generic
|
" generic
|
||||||
Plug 'ryicoh/deepl.vim'
|
Plug 'ryicoh/deepl.vim'
|
||||||
|
Plug 'tsuyoshicho/vim-pass'
|
||||||
|
|
||||||
" tim pope stuff
|
" tim pope stuff
|
||||||
Plug 'tpope/vim-repeat' " . for commands from plugins
|
Plug 'tpope/vim-repeat' " . for commands from plugins
|
||||||
|
|
Loading…
Reference in a new issue