1.4 KiB
Raw Permalink Blame History


Use Deepl's API to translate from the command line.

Get an API account on



Copy or symlink deepl to a directory in your $PATH, like ~/.local/bin/.


# ~/.config/deepl/config
# The default target language is used when not using the command line flag `-t`

# The API key can either be set directly, or fetched on-the-fly from a command
#deepl_key="$(pass show deepl)"

# Set to '' to use a paid plan

All the examples below assume that you have set the API key in the config file. Otherwise, add a -k <key> argument.


From the command-line:

deepl -t FR <<< "Integrate the worlds best machine translation technology directly into your own products and platforms."

Replace the current Vim buffer with its French translation:

:% !deepl -t FR

Set a command in Vim or neovim

Once deepl is somewhere in your $PATH, add this to your init.vim:

command -nargs=? -range=% Translate <line1>,<line2>!deepl <args>

Then you can replace the whole current buffer (or just the selected lines) with its translation to the default target_lang:


Or with a language of your choice:

:Translate -t RU