Add deepl mappings to git after moving api key to pass storage

This commit is contained in:
Alexander Gehrke 2023-02-14 17:36:45 +01:00
parent 00ec5eca12
commit a8e4f7a113
2 changed files with 11 additions and 0 deletions

10
after/plugin/deepl.vim Normal file
View 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>

View file

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