Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/uga-rosa/deepl.nvim

Hit deepl api from neovim and display in floating window
https://github.com/uga-rosa/deepl.nvim

Last synced: about 1 month ago
JSON representation

Hit deepl api from neovim and display in floating window

Awesome Lists containing this project

README

        

**Use translate.nvim**

[translate.nvim](https://github.com/uga-rosa/translate.nvim)

# deepl.nvim

Hit deepl api from neovim and display in floating window

# Require

- neovim 0.5.0+
- [deepl API account](https://www.deepl.com/en/pro-api/)

# Setup

```lua
require("deepl").setup({
authkey = "", -- your deepl api's auth_key
plan = "free" -- your plan ("free" or "pro")
})
```

# How to use

Translate.

```lua
require("deepl").translate(, , from, to, mode)
```

- \: start line
- \: last line
- from: from language (e.g. "EN", "JA")
- to: to language (same above)
- mode: "f" (floating window) or "r" (replace)

Close a floating window.

```lua
lua require("deepl").close()
```

# Example setting

Register in command.

```vim
command! -range DeeplJa2EnFloat lua require("deepl").translate(, , "JA", "EN", "f")
command! DeeplClose lua require("deepl").close()
```